/* static/css/style.css */
/* Design System - Financial Precision Aesthetic */

/* scroll-behavior: smooth retiré — cause du jank sur GPU intégré (Intel Iris Xe) */

/* --- 1. DESIGN SYSTEM (VARIABLES) --- */
:root {
    /* Palette Principale - Financial Blue */
    --primary-color: #1e3a8a;       /* Bleu profond professionnel */
    --primary-hover: #1e40af;       /* Bleu légèrement plus clair au hover */
    --primary-light: #dbeafe;       /* Bleu très pâle */
    --primary-dark: #0f172a;        /* Bleu nuit pour textes */

    /* Accents Financiers */
    --accent-gold: #f59e0b;         /* Or/Amber - Premium */
    --accent-green: #059669;        /* Vert finance - Positif */
    --accent-red: #dc2626;          /* Rouge - Négatif/Urgent */

    /* Palette Neutre Premium */
    --bg-body: #fafafa;             /* Gris ultra-léger */
    --bg-card: #ffffff;             /* Blanc pur */
    --bg-subtle: #f8f9fa;           /* Gris très subtil */
    --text-main: #0f172a;           /* Texte principal intense */
    --text-secondary: #475569;      /* Texte secondaire lisible */
    --text-muted: #64748b;          /* Texte tertiaire */
    --border-color: #e2e8f0;        /* Bordures fines */
    --border-strong: #cbd5e1;       /* Bordures marquées */

    /* Ombres & Élévations */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 30px 60px rgba(15, 23, 42, 0.15);

    /* Rayons de bordure */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 2. RESET & BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- 3. FLASH MESSAGES (ALERTS) --- */
.flash-messages-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
}

.flash-message {
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.flash-message::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.flash-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.flash-content {
    flex: 1;
}

/* Success - Vert professionnel */
.flash-message.flash-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #86efac;
    color: #065f46;
}

.flash-message.flash-success::before {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

/* Info - Bleu clair professionnel */
.flash-message.flash-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.flash-message.flash-info::before {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

/* Warning - Orange/Amber professionnel */
.flash-message.flash-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
    color: #92400e;
}

.flash-message.flash-warning::before {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

/* Error - Rouge doux (pas agressif) */
.flash-message.flash-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.flash-message.flash-error::before {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

/* Bouton fermer */
.flash-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.flash-close:hover {
    opacity: 1;
}

/* --- 4. NAVBAR --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    /* backdrop-filter: blur retiré — coûteux sur GPU intégré */
}

/* Container interne : 3 zones [logo | centre | droite] */
.navbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 48px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-logo {
    text-decoration: none;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-logo-icon {
    height: 32px;
    width: auto;
}

/* Zone centrale : liens de navigation */
.nav-center {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Liens nav : même comportement que .btn-login au hover */
.nav-center a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}

.nav-center a:hover,
.nav-center a.active {
    background-color: var(--bg-subtle);
    color: var(--primary-color);
}

/* Zone droite : Connexion + CTA */
.nav-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Bouton CTA navbar compact */
.btn-nav-cta {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white !important;
    padding: 8px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    text-decoration: none;
    margin-left: 4px;
}

.btn-nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
}

/* Compensation pour navbar fixed - applique a toutes les pages landing */
.hero {
    padding-top: 64px;
}

.article-header {
    padding-top: 144px; /* 64px navbar + 80px original padding */
}

.logo {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.04em;
    color: var(--text-main);
    transition: transform var(--transition-base);
}

.logo:hover {
    transform: translateX(-2px);
}

.dot {
    color: var(--primary-color);
    font-size: 1.8rem;
    line-height: 0;
    font-weight: 900;
}

/* .nav-links conservé pour compatibilité éventuelle */
.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a:not(.btn-login) {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:not(.btn-login):hover,
.nav-links a:not(.btn-login).active {
    color: var(--primary-color);
}

/* --- 4. BOUTONS & BADGES --- */
.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    text-align: center;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--transition-slow);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-block;
    background: transparent;
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1.5px solid var(--border-strong);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
}

.btn-login {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.btn-login:hover {
    background-color: var(--bg-subtle);
    color: var(--primary-color);
}

.badge-soft {
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: inline-block;
}

/* Texte surligné (Highlight) */
.highlight {
    background: linear-gradient(120deg, var(--primary-light) 0%, var(--primary-light) 100%);
    background-size: 100% 40%;
    background-position: 0 85%;
    background-repeat: no-repeat;
    color: var(--primary-color);
    font-weight: 800;
    position: relative;
    white-space: nowrap;
}

/* --- TOGGLE SWITCH (Composant reutilisable) --- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #e2e8f0;
    transition: 0.2s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

/* Mobile Navbar */
@media (max-width: 768px) {
    .nav-center,
    .nav-right {
        display: none;
    }

    .navbar-inner {
        padding: 0 20px;
    }
}