/* ========================================
   FONDATIONS : variables partagées par tout le site
   Toutes les pages s'appuient sur ces valeurs : une couleur ou un
   espacement se change ici, une seule fois.
======================================== */
:root {
    /* Marque */
    --brand: #007C70;
    --brand-hover: #00665C;
    --brand-soft: #E6F2F1;

    /* Texte */
    --text: #0F172A;
    /* Contrastes sur fond blanc (norme WCAG : 4,5:1 minimum) */
    --text-2: #1E293B;  /* texte principal : 14,6:1 */
    --muted: #475569;   /* texte secondaire : 7,6:1 */
    --subtle: #64748B;  /* mentions discrètes : 4,8:1 */
    --nav: #334155;

    /* Surfaces et bordures */
    --bg: #FFFFFF;
    --bg-subtle: #F8FAFC;
    --surface: #FFFFFF;
    --border: #E2E8F0;
    --border-strong: #CBD5E1;

    /* Gains / pertes */
    --pos: #059669;
    --pos-soft: #ECFDF5;
    --neg: #DC2626;
    --neg-soft: #FEF2F2;

    /* Mise en page */
    --wrap: 1200px;
    --gutter: 24px;
    --header-h: 64px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);

    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ========================================
   BASE
======================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

main {
    flex: 1 0 auto;
}

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, p {
    margin: 0;
}

a {
    color: var(--brand);
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Conteneur unique : tous les blocs s'alignent sur les mêmes bords. */
.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.num {
    font-variant-numeric: tabular-nums;
}

/* Lien de texte, utilisé dans les paragraphes de toutes les pages. */
.table-link,
.text-link {
    color: var(--brand);
    font-weight: 500;
    text-decoration: none;
}

.table-link:hover,
.text-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ========================================
   NAVIGATION
======================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}

.brand img {
    width: auto;
    height: 36px;
}

.brand span {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--brand);
}

.nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    color: var(--nav);
    text-decoration: none;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-subtle);
}

.nav-link.is-active {
    color: var(--brand);
    background: var(--brand-soft);
}

.nav-toggle {
    display: none;
    margin-left: auto;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.nav-toggle svg {
    width: 20px;
    height: 20px;
}

.nav-toggle .icon-close {
    display: none;
}

.site-header.is-open .nav-toggle .icon-open {
    display: none;
}

.site-header.is-open .nav-toggle .icon-close {
    display: block;
}

/* ========================================
   PIED DE PAGE
======================================== */
.site-footer {
    flex-shrink: 0;
    margin-top: 64px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.footer-inner {
    padding-top: 16px;
    padding-bottom: 16px;
}

.footer-row {
    display: flex;
    align-items: center;
    gap: 8px 24px;
    flex-wrap: wrap;
}

.footer-copy {
    font-size: 13px;
    color: var(--muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
}

.footer-links a {
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-social {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    opacity: 0.55;
    transition: opacity 0.15s ease;
}

.footer-social:hover {
    opacity: 1;
}

.footer-social img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.footer-advice {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--subtle);
}

.footer-advice a {
    color: inherit;
}

/* ========================================
   EN-TÊTE DE PAGE (titre, introduction, date de mise à jour)
======================================== */
.page-head {
    padding-top: 40px;
    padding-bottom: 24px;
}

/* Petit titre vert en capitales (Stratégies, Paris) */
.eyebrow {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand);
}

.page-title {
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.page-lead {
    margin-top: 8px;
    max-width: 720px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--muted);
}

.update-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    color: var(--muted);
    background: var(--surface);
}

.update-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pos);
}

/* ========================================
   CARTES ET TABLEAUX DE DONNÉES (Paris, Historique, Statistiques)
======================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.table-card {
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

/* Chiffres à chasse fixe sur les colonnes numériques seulement :
   appliquée au texte, elle élargit les tirets (« Pays-Bas »). */
.data-table .ta-r,
.data-table .ta-c {
    font-variant-numeric: tabular-nums;
}

.data-table th {
    position: sticky;
    top: 0;
    padding: 10px 16px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover td {
    background: var(--bg-subtle);
}

.data-table .ta-r { text-align: right; }
.data-table .ta-c { text-align: center; }
.data-table .muted { color: var(--muted); }
.data-table .strong { color: var(--text); font-weight: 600; }
.data-table .nowrap { white-space: nowrap; }

.is-pos { color: var(--pos) !important; }
.is-neg { color: var(--neg) !important; }

/* Pastilles de statut et étiquettes de stratégie */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
}

.badge--win { color: var(--pos); background: var(--pos-soft); }
.badge--loss { color: var(--neg); background: var(--neg-soft); }
.badge--neutral { color: var(--muted); background: var(--bg-subtle); }

.chips {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 4px;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-2);
    background: var(--surface);
}

/* Tri des colonnes (Historique) */
.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    color: var(--text);
}

.sort-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 9px;
    opacity: 0.5;
}

/* État vide */
.empty-state {
    padding: 56px 24px;
    text-align: center;
}

.empty-state svg {
    width: 40px;
    height: 40px;
    color: var(--subtle);
}

.empty-state h2 {
    margin-top: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.empty-state p {
    margin-top: 4px;
    font-size: 14px;
    color: var(--muted);
}

/* Bouton principal */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border: none;
    border-radius: var(--radius);
    background: var(--brand);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 124, 112, 0.2);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
    background: var(--brand-hover);
}

.btn:active {
    transform: translateY(1px);
}

.btn--ghost {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn--ghost:hover {
    background: var(--bg-subtle);
}

/* ========================================
   PAGES DE TEXTE (Concept, FAQ, Mentions légales, Confidentialité, Contact)
======================================== */
.description-container {
    max-width: 768px;
    margin: 0 auto;
    padding: 48px var(--gutter) 0;
}

.description {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-2);
}

.description > h1:first-child,
.description > h2:first-child {
    margin-bottom: 16px;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

/* « Dernière mise à jour » placé sous le titre des pages légales */
.description > h1:first-child + p,
.description > h2:first-child + p {
    font-size: 13px;
    color: var(--muted);
}

.description h2 {
    margin-top: 40px;
    margin-bottom: 8px;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

.description h3 {
    margin-top: 24px;
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.description p {
    margin-bottom: 14px;
}

.description ul,
.description ol {
    margin: 0 0 14px;
    padding-left: 22px;
}

.description li {
    margin-bottom: 4px;
}

.description .lead {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text);
}

.email-link {
    color: var(--brand);
    font-weight: 500;
}

/* FAQ : une question par bloc, séparés par un filet */
.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item:last-of-type {
    border-bottom: none;
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
}

.faq-question::-webkit-details-marker {
    display: none;
}

/* Chevron qui pivote à l'ouverture */
.faq-question::after {
    content: "";
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-right: 4px;
    border-right: 2px solid var(--subtle);
    border-bottom: 2px solid var(--subtle);
    transform: rotate(45deg) translateY(-3px);
    transition: transform 0.2s ease;
}

.faq-item[open] > .faq-question::after {
    transform: rotate(225deg) translate(-3px, 0);
}

.faq-question:hover {
    color: var(--brand);
}

.faq-answer {
    padding-bottom: 20px;
    color: var(--text-2);
}

/* Contact */
.contact-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 340px));
    gap: 12px;
    margin-top: 24px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 20px;
    text-decoration: none;
    transition: border-color 0.15s ease;
}

.contact-item:hover {
    border-color: var(--brand);
}

.contact-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.contact-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 800px) {
    :root {
        --gutter: 16px;
        --header-h: 56px;
    }

    .nav-toggle {
        display: inline-flex;
    }

    /* Menu mobile : panneau déroulant sous la barre */
    .nav {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 8px var(--gutter) 16px;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
    }

    .site-header.is-open .nav {
        display: flex;
    }

    .nav-link {
        padding: 12px;
        font-size: 16px;
    }

    .page-head {
        padding-top: 28px;
        padding-bottom: 20px;
    }

    .page-title,
    .description > h1:first-child,
    .description > h2:first-child {
        font-size: 24px;
    }

    .description-container {
        padding-top: 32px;
    }

    .site-footer {
        margin-top: 48px;
    }

    .footer-social {
        margin-left: 0;
    }
}

/* Barre de filtres */
.filters {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.filter-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.filter select,
.filter input[type="date"] {
    height: 38px;
    min-width: 180px;
    max-width: 280px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease;
}

.filter select:hover,
.filter input[type="date"]:hover {
    border-color: var(--border-strong);
}

.filter select:focus-visible,
.filter input[type="date"]:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

.filters-reset {
    height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--brand);
    text-decoration: none;
}

.filters-reset:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Champs de date : pas de flèche de liste, calendrier natif du navigateur */
.filter input[type="date"] {
    min-width: 150px;
    padding: 0 12px;
    background-image: none;
    cursor: text;
}

/* Du / Au, affichés seulement pour une période personnalisée */
.period-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.period-dates[hidden] {
    display: none;
}

@media (max-width: 800px) {
    .filter {
        flex: 1 1 140px;
    }

    .filter select,
    .filter input[type="date"] {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .period-dates {
        flex: 1 1 100%;
    }
}

