/* ========== RESET & VARIABLES ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --dark: #1e293b;
    --text: #1e293b;
    --text-secondary: #64748b;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --red: #ef4444;
    --green: #22c55e;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ========== UTILS ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== HEADER (site public) ========== */
.site-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    cursor: pointer;
}

.main-nav {
    display: flex;
    gap: 32px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--dark);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ========== BOUTONS ========== */
.btn {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-family: inherit;
    text-align: center;
}

.btn-ghost {
    background: transparent;
    color: var(--dark);
    padding: 10px 15px;
}

.btn-ghost:hover {
    color: var(--primary);
    background-color: #eef2ff;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    padding: 10px 20px;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 10px rgba(99, 102, 241, 0.3);
}

.btn-block {
    width: 100%;
    display: block;
    padding: 14px;
    font-size: 1rem;
}

.btn-danger {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red);
}

.btn-danger:hover {
    background: var(--red);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* ========== HERO (accueil) ========== */
.hero {
    text-align: center;
    padding: 80px 20px 60px;
    background: radial-gradient(circle at top right, #eef2ff, #fff);
}

.badge {
    display: inline-block;
    background: #eef2ff;
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 30px;
}

.mockup {
    max-width: 700px;
    margin: 50px auto;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    height: 350px;
    border-radius: 30px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    font-weight: 900;
    box-shadow: 0 30px 60px rgba(99, 102, 241, 0.2);
}

.float-card {
    position: absolute;
    background: white;
    padding: 15px;
    border-radius: 15px;
    color: var(--dark);
    font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: float 5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ========== FEATURES ========== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    padding: 80px 20px;
    background: var(--bg);
}

.feat-card {
    background: var(--white);
    padding: 35px;
    border-radius: var(--radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    text-align: center;
}

.feat-card .icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.feat-card h3 {
    margin-bottom: 10px;
}

/* ========== FOOTER ========== */
.footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 60px 20px 30px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto 40px;
    gap: 40px;
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 15px;
}

.footer-links {
    display: flex;
    gap: 60px;
    flex-wrap: wrap;
}

.footer-column h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.footer-column a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.footer-column a:hover {
    color: var(--primary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 25px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-bottom .socials a {
    margin-left: 15px;
    text-decoration: none;
    color: var(--text-secondary);
}

.footer-bottom .socials a:hover {
    color: var(--primary);
}

/* ========== LOGIN CARD ========== */
.login-card {
    background: var(--white);
    max-width: 420px;
    margin: 60px auto;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.login-card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* ========== FORMULAIRES ========== */
.form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-select {
    width: 100%;
    padding: 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-size: 1rem;
    font-family: inherit;
}

/* ========== NAVIGATION MOBILE (connecté) ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 15px;
    z-index: 999;
}

.bottom-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-align: center;
    font-weight: 500;
}

.bottom-nav a .icon {
    display: block;
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.bottom-nav a.active {
    color: var(--primary);
    font-weight: 700;
}

/* ========== DASHBOARD ========== */
.balance-card {
    background: var(--primary);
    color: white;
    padding: 25px;
    border-radius: 24px;
    margin-bottom: 25px;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

.balance-card .label {
    opacity: 0.8;
    font-size: 0.9rem;
}

.balance-card .amount {
    font-size: 2.5rem;
    font-weight: 800;
    margin-top: 5px;
}

.expense-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.expense-item {
    background: var(--white);
    padding: 16px;
    border-radius: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.expense-item .info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.expense-icon {
    width: 45px;
    height: 45px;
    background: #f1f5f9;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* ========== PAGE GROUPE ========== */
.balance-item {
    background: var(--white);
    padding: 16px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.user-tag {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #eef2ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.amount.pos { color: var(--green); font-weight: 700; }
.amount.neg { color: var(--red); font-weight: 700; }

/* ========== AJOUTER UNE DÉPENSE ========== */
.type-switch {
    display: flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 25px;
}

.type-switch button {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.2s;
}

.type-switch button.active {
    background: var(--white);
    color: var(--dark);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.split-list {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
}

.split-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .hero h1 { font-size: 2rem; }
    .footer-content { flex-direction: column; }
    .footer-links { gap: 30px; }
}