/* ============================================================================================= */
/* Taille du texte — préférence utilisateur (classe fs-N sur <html>, réglable
   dans les paramètres). Tout ce qui est en rem suit l'échelle. fs-3 = défaut. */
html.fs-1 { font-size: 12.5px; }
html.fs-2 { font-size: 13.5px; }
html.fs-3 { font-size: 14.5px; }
html.fs-4 { font-size: 16px; }
html.fs-5 { font-size: 17.5px; }

/* ============================================================================================= */
/* Variables CSS pour les thèmes */
:root {
    /* Variables communes */
    --primary-blue: #013861;
    --accent-red: #ff4757;
    --accent-orange: #ffa502;
    --accent-green: #2ed573;
    --accent-clear: #e7e7e7ff;
    --transition: all 0.3s ease;
}

/* THÈME CLAIR (par défaut) */
:root, .theme-light {
    --primary-blue: #013861;
    --bg-color: #ffffff;
    --bg-gradient: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #e1f5fe 100%);
    --bg-secondary: #f8fafc;
    --text-color: #333333;
    --text-secondary: #666666;
    --text-muted: #555555;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --input-bg: #f8fbfd;
    --code-bg: #e6f0fa;
    --footer-bg: #013861;
    --select-bg: #013861;
    --select-color: #e7e7e7ff;
    --blockquote-border: #013861;
    --shadow-light: rgba(1, 56, 97, 0.1);
    --shadow-medium: rgba(1, 56, 97, 0.15);
    --shadow-strong: rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --success-bg: #d4edda;
    --success-text: #155724;
    --error-bg: #edd4d4ff;
    --error-text: #571515ff;
    --stats-item-bg: rgba(255, 255, 255, 0.1);
    --stats-border: rgba(255, 255, 255, 0.2);
}

/* THÈME SOMBRE */
.theme-dark {
    --primary-blue: #376a91ff;
    --bg-color: #1a1a1a;
    --bg-gradient: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1e3a5f 100%);
    --bg-secondary: #2d2d2d;
    --text-color: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #a0a0a0;
    --border-color: #404040;
    --card-bg: #2d2d2d;
    --input-bg: #262626;
    --code-bg: #2a3f5f;
    --footer-bg: #172027;
    --select-bg: #e7e7e7ff;
    --select-color: #013861;
    --blockquote-border: #4a90e2;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.5);
    --shadow-strong: rgba(0, 0, 0, 0.8);
    --nav-bg: rgba(26, 26, 26, 0.95);
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --success-bg: #1e4d2b;
    --success-text: #90ee90;
    --error-bg: #4a1e1e;
    --error-text: #ff9999;
    --stats-item-bg: rgba(255, 255, 255, 0.05);
    --stats-border: rgba(255, 255, 255, 0.1);
}

/* Thème sombre automatique basé sur les préférences système */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-blue: #376a91ff;
        --bg-color: #1a1a1a;
        --bg-gradient: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1e3a5f 100%);
        --bg-secondary: #2d2d2d;
        --text-color: #e0e0e0;
        --text-secondary: #b0b0b0;
        --text-muted: #a0a0a0;
        --border-color: #404040;
        --card-bg: #2d2d2d;
        --input-bg: #262626;
        --code-bg: #2a3f5f;
        --footer-bg: #172027;
        --select-bg: #e7e7e7ff;
        --select-color: #013861;
        --blockquote-border: #4a90e2;
        --shadow-light: rgba(0, 0, 0, 0.3);
        --shadow-medium: rgba(0, 0, 0, 0.5);
        --shadow-strong: rgba(0, 0, 0, 0.8);
        --nav-bg: rgba(26, 26, 26, 0.95);
        --overlay-bg: rgba(0, 0, 0, 0.7);
        --success-bg: #1e4d2b;
        --success-text: #90ee90;
        --error-bg: #4a1e1e;
        --error-text: #ff9999;
        --stats-item-bg: rgba(255, 255, 255, 0.05);
        --stats-border: rgba(255, 255, 255, 0.1);
    }
}

/* ============================================================================================= */
/* STYLES DE BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    background: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
    min-width:368px;
}

h1, h2, h3 {
    color: var(--primary-blue);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.6em;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2rem;
    letter-spacing: -0.015em;
}

h3 {
    font-size: 1.5rem;
    letter-spacing: -0.01em;
}

p {
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 1em;
    line-height: 1.6;
}

strong {
    font-weight: 700;
}

ul {
    margin-left: 1.5em;
    margin-bottom: 1em;
    color: var(--text-color);
}

li {
    margin-bottom: 0.5em;
}

hr {
    border: none;
    border-top: 2px solid var(--primary-blue);
    margin: 2em 0;
    opacity: 0.3;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover,
a:focus {
    color: #005b9f;
    outline: none;
}

blockquote {
    border-left: 4px solid var(--blockquote-border);
    padding-left: 1em;
    color: var(--text-color);
    font-style: italic;
    margin: 1em 0;
}

code {
    background: var(--code-bg);
    color: var(--primary-blue);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Source Code Pro', monospace, monospace;
    font-size: 0.9em;
}

section {
    padding: 0px;
}
.section-info{
    padding: 20px 32px;
    width: 100%;
    margin: auto;
}
/* Mobile responsiveness */
@media (max-width: 600px) {
    h1 {
        font-size: 1.8rem;
    }
    h2 {
        font-size: 1.5rem;
    }
    h3 {
        font-size: 1.2rem;
    }
    p, li {
        font-size: 0.95rem;
    }
    ul {
        margin-left: 1em;
    }
    hr {
        margin: 1.5em 0;
    }
}

/* ============================================================================================= */
/* MESSAGES ET NOTIFICATIONS */
.messagetopwrapper {
    position: fixed;
    top: 0px;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    pointer-events: none;
}

.messagetop {
    background: var(--success-bg);
    color: var(--success-text);
    padding: 10px 20px;
    border-radius: 5px;
    opacity: 0;
    margin: auto;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(-20px);
    pointer-events: all;
}

.errormessagetop {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 10px 20px;
    border-radius: 5px;
    opacity: 0;
    margin: auto;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(-20px);
    pointer-events: all;
}

.show {
    opacity: 1;
    transform: translateY(0);
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.loading::before {
    content: "";
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 5px solid #7ec8e3;
    border-top-color: var(--primary-blue);
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

.loading-text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.2rem;
    color: var(--primary-blue);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    background-color: var(--error-bg);
    color: var(--error-text);
    border: 1.5px solid var(--accent-red);
    padding: 15px 20px;
    border-radius: 6px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 20px auto;
    box-shadow: 0 2px 5px var(--shadow-light);
}

.error strong {
    font-weight: 700;
    margin-right: 6px;
}


/* ============================================================================================= */
/* LAYOUT ET NAVIGATION */
/* Sélecteur de langue : bouton compact + liste déroulante (prévu pour ~10 langues) */
.lang-switch-nav { position: relative; display: inline-flex; align-items: center; }
.lang-current {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .4rem .6rem; border: 1px solid var(--border-color); border-radius: 999px;
    background: transparent; color: var(--text-color); cursor: pointer;
    font-size: .85rem; font-weight: 600; line-height: 1; white-space: nowrap;
    transition: var(--transition);
}
.lang-current:hover { border-color: var(--primary-blue); color: var(--primary-blue); }
.lang-caret { font-size: .65rem; opacity: .7; transition: transform .2s ease; }
.lang-switch-nav.open .lang-caret { transform: rotate(180deg); }

.lang-menu {
    position: absolute; top: calc(100% + .5rem); right: 0; z-index: 1100;
    display: none; list-style: none; margin: 0; padding: .35rem;
    min-width: 190px; max-height: 320px; overflow-y: auto;
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 12px; box-shadow: 0 12px 34px var(--shadow-medium);
}
.lang-switch-nav.open .lang-menu { display: block; }
.lang-menu li { margin: 0; }
.lang-opt {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .7rem; border-radius: 8px;
    color: var(--text-color); text-decoration: none; font-size: .9rem; white-space: nowrap;
}
.lang-opt:hover { background: var(--hover-bg); }
.lang-opt.active { color: var(--primary-blue); font-weight: 600; }
.lang-opt .fa-check { margin-left: auto; font-size: .75rem; }
.lang-badge {
    flex: 0 0 auto; min-width: 26px; text-align: center;
    background: var(--hover-bg); border-radius: 5px;
    padding: .1rem .3rem; font-size: .72rem; font-weight: 700; letter-spacing: .03em;
}
.lang-selector { display: flex; align-items: center; }
/* Dans la barre du haut, le menu s'aligne à droite pour ne pas déborder */
@media (max-width: 768px) {
    .lang-current { padding: .35rem .5rem; font-size: .8rem; }
    .lang-menu { right: 0; min-width: 170px; }
}

/* Bandeau d'information sur les cookies */
.cookie-banner {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10000;
    display: none; gap: 1rem; align-items: center; justify-content: center; flex-wrap: wrap;
    padding: 1rem 1.4rem; background: var(--card-bg); color: var(--text-color);
    border-top: 1px solid var(--border-color); box-shadow: 0 -6px 24px var(--shadow-medium);
}
.cookie-banner.show { display: flex; }
.cookie-text { max-width: 760px; font-size: .92rem; line-height: 1.5; margin: 0; }
.cookie-text a { color: var(--primary-blue); }
.cookie-actions { display: flex; gap: .6rem; flex-shrink: 0; }
@media (max-width: 768px) {
    .cookie-banner { flex-direction: column; align-items: stretch; padding: 1rem; }
    .cookie-actions { justify-content: stretch; }
    .cookie-actions .btn { flex: 1; }
    /* Ne pas masquer la barre d'onglets du bas sur mobile */
    .cookie-banner { bottom: 64px; }
}

/* Bouton flottant de réglage des cookies (visiteurs uniquement) */
.cookie-fab {
    position: fixed; left: 18px; bottom: 18px; z-index: 9998;
    width: 46px; height: 46px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--card-bg); color: var(--text-secondary);
    border: 1px solid var(--border-color); box-shadow: 0 4px 16px var(--shadow-medium);
    cursor: pointer; font-size: 1.1rem; transition: var(--transition);
}
.cookie-fab:hover { color: var(--primary-blue); border-color: var(--primary-blue); transform: translateY(-2px); }
@media (max-width: 768px) { .cookie-fab { left: 12px; bottom: 12px; width: 42px; height: 42px; } }

/* Variante discrète des boutons. Elle était employée un peu partout (panneau
   cookies, double authentification, export de données) sans jamais avoir été
   définie : ces boutons héritaient donc de .btn seul, sans fond ni contraste. */
.btn-secondary {
    background: var(--hover-bg, rgba(1, 56, 97, .1));
    color: var(--text-color);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--primary-blue); color: #fff; border-color: var(--primary-blue); }

/* Panneau de gestion des cookies.
   Il est ENTIÈREMENT autonome : les styles .modal / .modal-content vivent dans
   la feuille des membres connectés, or ce panneau s'adresse aux visiteurs — en
   s'appuyant dessus, il s'ouvrait sans mise en forme, invisible en bas de page. */
.cookie-modal {
    display: none; visibility: hidden;
    position: fixed; inset: 0; z-index: 10001;
    align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .55);
    padding: 1rem;
}
.cookie-modal.open { display: flex; visibility: visible; }
.cookie-modal-content {
    background: var(--card-bg); color: var(--text-color);
    border: 1px solid var(--border-color); border-radius: 16px;
    padding: 1.6rem; text-align: left;
    width: min(560px, 94vw); max-width: none; max-height: 88vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.cookie-modal-content h2 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; font-size: 1.25rem; }
.ck-intro { color: var(--text-secondary); font-size: .93rem; line-height: 1.55; margin: 0 0 1.2rem; }
.ck-group { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); margin: 1.2rem 0 .5rem; }
.ck-list { list-style: none; margin: 0; padding: 0; }
.ck-list li { display: flex; gap: .8rem; justify-content: space-between; align-items: flex-start;
    padding: .7rem .9rem; border: 1px solid var(--border-color); border-radius: 10px;
    margin-bottom: .5rem; font-size: .9rem; line-height: 1.5; }
.ck-state { flex: 0 0 auto; font-size: .78rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px; white-space: nowrap; }
.ck-state.on { background: rgba(46,204,113,.16); color: #27ae60; }
.ck-state.off { background: rgba(149,165,166,.16); color: var(--text-secondary); }
.ck-note { display: flex; gap: .5rem; align-items: flex-start; background: var(--hover-bg);
    padding: .8rem .9rem; border-radius: 10px; font-size: .88rem; color: var(--text-secondary); margin: 1.2rem 0 0; }
.ck-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; margin-top: 1.2rem; }
.ck-feedback { min-height: 1.2em; margin: .7rem 0 0; font-size: .88rem; color: #27ae60; text-align: right; }

/* Acceptation des conditions à l'inscription */
.legal-consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; line-height: 1.45; margin: .2rem 0 1rem; }
.legal-consent input { margin-top: .25rem; flex: 0 0 auto; width: 18px; height: 18px; }
.legal-consent a { color: var(--primary-blue); }

/* Pages légales (confidentialité, conditions) */
.legal-page { max-width: 900px; margin: 0 auto; padding: 2rem 0 3rem; }
.legal-page h1 { margin-bottom: .3rem; }
.legal-updated { color: var(--text-secondary); font-size: .9rem; margin-bottom: 2rem; }
.legal-page h2 { margin: 2rem 0 .6rem; font-size: 1.25rem; }
.legal-page p, .legal-page li { line-height: 1.7; }
.legal-page ul { margin: .5rem 0 1rem 1.4rem; }
.legal-note { background: var(--hover-bg); border-left: 3px solid var(--primary-blue); padding: 1rem 1.2rem; border-radius: 0 10px 10px 0; margin: 1.5rem 0; }
/* Bloc d'identification de l'éditeur, en tête des pages légales : une
   adresse postale se lit en colonne, pas en paragraphe. */
.legal-identity { background: var(--hover-bg); border-left: 3px solid var(--primary-blue);
    padding: 1rem 1.2rem; border-radius: 0 10px 10px 0; margin: 1rem 0 1.5rem;
    line-height: 1.75; font-style: normal; }
.legal-identity a { color: var(--primary-blue); }

/* Crédits d'édition : deuxième paragraphe du bas de page. Il ne doit répéter
   ni le filet de séparation ni l'espacement du premier. */
.footer-bottom p.footer-credits { border-top: none; padding-top: .6rem; font-size: .88rem; }
.footer-bottom p.footer-credits a { color: #fff; text-decoration: underline; }
.footer-bottom p.footer-credits a:hover { color: rgba(255, 255, 255, .75); }

/* (L'ancien sélecteur du pied de page a été retiré : ses règles définissaient
   .lang-opt en blanc pour un fond sombre et, situées plus bas dans le fichier,
   rendaient le menu de langue illisible en thème clair.) */
/* Libellé réservé aux lecteurs d'écran */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Pleine largeur sur PC : seule une marge de respiration borde le contenu */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 32px;
}

@media (max-width: 768px) {
    .container { padding: 0 10px; }   /* respiration minimale sur mobile */
    .section-info { padding: 20px 10px; }
}

/* La hauteur réelle de la barre du haut est mesurée au chargement et écrite
   dans --dw-nav-h (voir dwSyncNavHeight) : une valeur en dur se désaccordait
   dès que la barre changeait de contenu, laissant un espace ou un recouvrement. */
#main-content {
    margin-top: var(--dw-nav-h, 85px);
}

/* ============================================================================================= */
/* BANDEAU D'INSTALLATION (PWA)                                                                   */
/* ============================================================================================= */
/* Au-dessus de l'entête (1100) et du tiroir (1102), mais SOUS les modales
   (9999) : une boîte de dialogue doit pouvoir recouvrir le bandeau, l'inverse
   serait une gêne. */
.pwa-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1300;
    background: #013861;
    color: #fff;
    padding: .6rem 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
    animation: pwaDescend .3s ease;
}
@keyframes pwaDescend {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}
.pwa-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.pwa-bar-txt { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.pwa-bar-txt img { flex: 0 0 auto; background: #fff; border-radius: 7px; padding: 3px; }
.pwa-bar-txt span { font-size: .87rem; line-height: 1.35; }
.pwa-bar-act { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }

.pwa-later {
    background: transparent; border: none; color: rgba(255, 255, 255, .72);
    font-family: inherit; font-size: .82rem; cursor: pointer; padding: .35rem .5rem;
}
.pwa-later:hover { color: #fff; }
.pwa-go {
    background: #fff; color: #013861; border: none; font-family: inherit;
    font-size: .82rem; font-weight: 700; padding: .5rem 1rem; border-radius: 8px;
    cursor: pointer; white-space: nowrap; transition: var(--transition);
}
.pwa-go:hover { background: rgba(255, 255, 255, .88); }

/* Marche à suivre iPhone, dépliée dans le bandeau */
.pwa-help {
    margin: .7rem 0 .2rem; padding-left: 1.3rem;
    font-size: .84rem; line-height: 1.65; color: rgba(255, 255, 255, .92);
}
.pwa-help li { margin: .15rem 0; }
.pwa-help strong { color: #fff; }

/* Le bandeau pousse tout ce qui est collé en haut. Le décalage vit dans une
   variable : la hauteur change entre téléphone et grand écran, et deux valeurs
   recopiées finiraient par diverger. */
body.pwa-visible { --dw-pwa-h: 52px; padding-top: var(--dw-pwa-h); }
/* « nav.nav-top » et pas « nav » : la barre d'onglets du bas et la colonne des
   dossiers de la messagerie sont AUSSI des <nav>. Un sélecteur générique
   l'emporterait sur leurs propres règles de position — la colonne sticky
   décalerait de 52 px sans raison. */
body.pwa-visible nav.nav-top { top: var(--dw-pwa-h); }
/* Ces deux panneaux se calent sous l'entête : leur repère descend d'autant. */
body.pwa-visible .notifications-panel { top: calc(80px + var(--dw-pwa-h)); }
body.pwa-visible .mobile-drawer { padding-top: calc(80px + .6rem + var(--dw-pwa-h)); }

@media (max-width: 560px) {
    .pwa-bar-row { flex-wrap: wrap; }
    .pwa-bar-txt span { font-size: .82rem; white-space: normal; }
    .pwa-bar-act { width: 100%; justify-content: flex-end; }
    /* Deux lignes au lieu d'une : le décalage suit. */
    body.pwa-visible { --dw-pwa-h: 96px; }
}

/* Un champ de fichier en « hidden » vaut display:none, et plusieurs navigateurs
   refusent alors de l'ouvrir par un clic programmé — le bouton « Prendre une
   photo » ne faisait rien du tout. On le sort de l'écran plutôt que de le
   supprimer de la mise en page : il reste techniquement présent et cliquable,
   sans rien occuper ni recevoir le focus au clavier. */
input[type="file"][hidden] {
    display: block !important;
    position: fixed;
    left: -9999px;
    top: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    min-height: 86px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 0px;
    box-shadow: 0 3px 15px var(--shadow-strong);
}

.nav-content {
    display: flex;
    align-items: center;
    height: 85px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-blue);
    margin-left: 20px;
}

.logo a {
    text-decoration: none;
    color: var(--primary-blue);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: auto;
    color: var(--primary-blue);
    
}


.nav-links li {
    margin-bottom: 0px;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.theme-selector{
    border-left: 1px solid var(--select-bg);
}
/* Ciblé sur la nav visiteur uniquement : le bouton rond connecté
   (.theme-toggle-btn) porte le même id et ne doit pas hériter du padding */
.theme-selector #theme-toggle{
    color: var(--select-bg);
    padding-left:20px;
}
.nav-links a:hover {
    color: var(--primary-blue);
}

.nav-buttons {
    display: flex;
    gap: 1rem;
}

/* Burger Menu */
.burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 0.5rem;
    z-index: 1001;
}

.burger span {
    display: block;
    height: 3px;
    background: var(--primary-blue);
    border-radius: 2px;
    transition: var(--transition);
}

.burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .burger {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 83px;
        left: 0;
        right: 0;
        background: var(--card-bg);
        padding: 1rem 2rem;
        box-shadow: 0 3px 15px var(--shadow-strong);
        clip-path: inset(0px -60px -60px -60px);
        z-index: 1000;
        width: 100%;
        border: 0px solid var(--border-color);
        gap: 0px;
        padding: 0px !important;
    }

    .nav-links.active {
        display: flex;
    }
    
    .nav-buttons {
        position: fixed;
        z-index: 1001;
        right: 20px;
    }

    .logo {
        margin-left: 25px;
    }

    .nav-links a {
        display: block;
        width: 100%;
        padding-top: 15px;
        height: 50px;
    }
    .nav-links li {
        margin-bottom: 0px;
        padding-left:20px;
    }
    .theme-selector{
        border-left: 0px;
        background-color: var(--select-bg)
    }
    .theme-selector #theme-toggle{
        color: var(--select-color);
        padding-left: 0px;
    }

    /* ---- Sélecteur de langue dans le menu burger ----
       Trois défauts venaient du même endroit : ce menu n'attendait que des
       liens simples, et on y a posé un composant déroulant.

       1. « .lang-current » gardait sa taille de barre du haut (.8rem, pastille
          arrondie) : minuscule et décalé au milieu de lignes de 50px.
       2. « .nav-links a » impose display:block et height:50px à TOUS les liens
          du menu — les options de langue y perdaient leur mise en ligne, d'où
          l'affichage cassé de la liste.
       3. « .lang-menu » s'ouvrait en position absolue, alors que .nav-links
          porte un clip-path ne tolérant que 60px de débord : le bas de la liste
          était rogné. Elle se déplie donc maintenant dans le flux. */
    .nav-links .lang-selector { display: block; padding-left: 0; }
    .lang-selector .lang-switch-nav { display: block; width: 100%; }

    .nav-links .lang-current {
        width: 100%;
        justify-content: flex-start;
        gap: .7rem;
        height: 50px;
        padding: 0 20px;
        border: 0;
        border-radius: 0;
        font-size: 1rem;
        font-weight: 500;
    }
    .nav-links .lang-current .lang-caret { margin-left: auto; }

    .nav-links .lang-menu {
        position: static;
        display: none;
        width: 100%;
        min-width: 0;
        max-height: none;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: var(--hover-bg);
    }

    /* Plus spécifique que « .nav-links a » : la ligne redevient une ligne. */
    .nav-links .lang-opt {
        display: flex;
        align-items: center;
        gap: .7rem;
        width: 100%;
        height: 50px;
        padding: 0 20px 0 34px;   /* décalé : on voit que c'est un sous-niveau */
        font-size: .95rem;
    }
}

/* ============================================================================================= */
/* BOUTONS */
.btn {
    display: inline-flex;          /* centre le texte quel que soit l'étirement du bouton */
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    text-align: center;
}

.btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: #ffffff;
}

.btn-primary {
    background: var(--primary-blue);
    color: #ffffff;
    box-shadow: 0 8px 32px var(--shadow-light);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px var(--shadow-medium);
    background: #012a4a;
    color: #c9c9c9ff;
}

/* ============================================================================================= */
/* HERO SECTION */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background: var(--bg-gradient);
    overflow: hidden;
}

/* Photo de fond (gens souriants) + filigrane dégradé pour la lisibilité du texte */
.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(100deg,
        rgba(1, 56, 97, 0.93) 0%,
        rgba(1, 56, 97, 0.80) 45%,
        rgba(21, 101, 192, 0.55) 100%);
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-top: 2rem;
}

.hero-text h1 {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.hero-text .highlight {
    color: rgba(255, 255, 255, 0.72);
    font-weight: 900;
    text-decoration: line-through;
    text-decoration-color: #4FC3F7;
    text-decoration-thickness: 3px;
}

.hero-text p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 2.5rem;
    line-height: 1.6;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

/* Boutons du hero sur photo : contour blanc lisible */
.hero .btn-outline {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.85);
}

.hero .btn-outline:hover {
    background: #ffffff;
    color: var(--primary-blue);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-visual {
    position: relative;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone-mockup {
    width: 400px;
    height: 700px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--card-bg));
    border-radius: 30px;
    padding: 20px;
    box-shadow: 0 30px 60px var(--shadow-medium);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.screen {
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    box-shadow: inset 0 2px 10px var(--shadow-light);
    overflow: hidden;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.8rem;
    color: var(--text-color);
}

.notification-bar {
    background: var(--primary-blue);
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-bottom: 15px;
    text-align: center;
    animation: pulse 2s infinite;
}

.friend-card {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    position: relative;
}

.friend-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--primary-blue);
    position: relative;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;     /* pour que l’image remplisse la zone sans déformation */
  border-radius: 50%;    /* pour rendre l’image ronde */
  display: block;        /* évite les petits espaces en bas de l’image */
}

.warning-indicator {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 12px;
    height: 12px;
    background: var(--accent-orange);
    border-radius: 50%;
    border: 2px solid var(--card-bg);
    animation: blink 1.5s infinite;
}

.danger-indicator {
    background: var(--primary-blue);
}

.friend-info {
    flex: 1;
}

.friend-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.interaction-status {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.status-warning {
    color: var(--accent-orange);
}

.status-danger {
    color: var(--primary-blue);
}

.friend-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.action-btn {
    background: var(--card-bg);
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--primary-blue);
    color: #ffffff;
}

/* ============================================================================================= */
/* MAQUETTE TÉLÉPHONE — reproduction du fil réel sur mobile                                       */
/* ============================================================================================= */
/* Préfixe « pm- » sur tout : cette page charge main.css.inc et NON la feuille
   des pages connectées. Réutiliser .post ou .action-btn donnerait une maquette
   qui ne ressemble à rien ici, et un vrai fil abîmé le jour où l'une des deux
   feuilles bougerait. Les deux mondes restent séparés.
   L'écran passe en colonne pour que la barre d'onglets se colle en bas, comme
   sur un téléphone, sans position absolue à recaler à chaque changement. */
.screen { display: flex; flex-direction: column; }

/* ----- Barre du haut ----- */
.pm-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.pm-burger { color: var(--text-secondary); font-size: .95rem; }
.pm-logo {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--primary-blue);
    margin-right: auto;
}
.pm-bell { position: relative; color: var(--text-secondary); font-size: .95rem; }
.pm-badge {
    position: absolute;
    top: -7px;
    right: -8px;
    background: var(--accent-red, #ff4757);
    color: #fff;
    font-size: .58rem;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 999px;
}
.pm-me img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; display: block; }

/* ----- Sélecteur de vue ----- */
.pm-views {
    display: flex;
    margin: 0 -20px 12px;                 /* pleine largeur de l'écran, comme sur mobile */
    border-bottom: 1px solid var(--border-color);
}
.pm-view {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-size: .7rem;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
}
.pm-view.is-on {
    color: var(--primary-blue);
    font-weight: 700;
    border-bottom-color: var(--primary-blue);
}

/* ----- Une publication ----- */
.pm-post {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 12px;
}
.pm-post-head {
    display: grid;
    grid-template-columns: 34px 1fr auto;   /* avatar | identité | menu */
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
}
.pm-avatar { grid-row: 1; }
.pm-avatar img {
    width: 34px; height: 34px; border-radius: 50%;
    object-fit: cover; display: block;
    border: 2px solid var(--border-color);
}
/* Anneau coloré selon le palier d'XP, comme dans l'application */
.pm-rank-1 img { border-color: #2ed573; }
.pm-rank-3 img { border-color: #4b7bec; }
/* La pastille d'XP se glisse sous l'avatar : c'est sa place dans le vrai fil */
.pm-xp {
    grid-column: 1; grid-row: 2;
    font-size: .52rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    margin-top: 2px;
}
.pm-ident { grid-column: 2; grid-row: 1 / span 2; display: block; min-width: 0; }
.pm-name { display: block; font-weight: 600; font-size: .85rem; color: var(--text-color); }
.pm-handle { font-size: .68rem; color: var(--text-secondary); }
.pm-time { font-size: .68rem; color: var(--text-secondary); }
.pm-time::before { content: '· '; }
.pm-more { grid-column: 3; grid-row: 1 / span 2; color: var(--text-secondary); font-size: .85rem; }

.pm-text {
    margin: 9px 0 0;
    font-size: .78rem;
    line-height: 1.5;
    color: var(--text-color);
}
.pm-photo {
    width: 100%;
    height: 118px;
    object-fit: cover;
    border-radius: 10px;
    margin-top: 9px;
    display: block;
}

.pm-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid var(--border-color);
    font-size: .7rem;
    color: var(--text-secondary);
}
.pm-act i { margin-right: 3px; }
.pm-act.is-liked { color: #ff4757; }
/* L'icône de visibilité est calée à droite, comme dans le fil */
.pm-vis { margin-left: auto; opacity: .65; }

/* ----- Barre d'onglets du bas ----- */
/* « margin-top:auto » la plaque en bas de l'écran quelle que soit la hauteur du
   contenu, et les marges négatives lui rendent la pleine largeur. */
/* Couleurs écrites en dur, et non via --sidebar-bg : cette variable n'existe
   que dans la feuille des pages connectées. Ce sont les deux valeurs réelles de
   la barre du bas, reprises telles quelles pour que la maquette ne mente pas. */
.pm-tabbar {
    margin: auto -20px -20px;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    background: #013861;
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-radius: 0 0 20px 20px;
}
.pm-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: rgba(255, 255, 255, .6);
    font-size: .78rem;
}
.pm-tab small { font-size: .52rem; }
.pm-tab.is-on { color: #fff; }
/* Le bouton d'écriture, rond et surélevé : le geste central de l'application */
.pm-compose {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .3);
}
.theme-dark .pm-tabbar { background: #172027; }
@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .pm-tabbar { background: #172027; }
}

/* ============================================================================================= */
/* FEATURES SECTION */
.features {
    padding: 30rem 0;
    background: var(--bg-color);
}

.features h2 {
    text-align: center;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--primary-blue);
}

.features-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 4rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow-light);
    max-width: 350px;
    margin: auto;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-blue);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow-medium);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--primary-blue);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #ffffff;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-blue);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Version mobile */
@media (max-width: 768px) {
    .features {
        padding: 15rem 0;
    }
}
/* ============================================================================================= */
/* HOW IT WORKS */
.how-it-works {
    padding: 8rem 0;
    background: var(--bg-secondary);
}

.how-it-works h2 {
    text-align: center;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 4rem;
    color: var(--primary-blue);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0 50px 1.5rem;
}
.step-number-main {
    width: 60px;
    height: 60px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0 auto 1.5rem;
}
.step h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--primary-blue);
}

.step p {
    color: var(--text-secondary);
    line-height: 1.6;
}
/* Version mobile */
@media (max-width: 768px) {
    .step-number {
        margin: 0 auto 1.5rem;
    }
}

/* ============================================================================================= */
/* STATS SECTION */
.stats {
    padding: 6rem 0;
    background: var(--primary-blue);
    text-align: center;
}

.stats h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    color: #ffffff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.stat-item {
    padding: 2rem;
    background: var(--stats-item-bg);
    border-radius: 15px;
    border: 1px solid var(--stats-border);
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    color: #ffffff;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* ============================================================================================= */
/* CTA SECTION */
.cta {
    padding: 8rem 0;
    text-align: center;
    background: var(--bg-gradient);
}

.cta h2 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    color: var(--primary-blue);
}

.cta p {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================================================= */
/* FOOTER */
footer {
    background: var(--footer-bg);
    color: #ffffff;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
    padding: 20px;
}

.footer-section h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    display: block;
    padding: 0.3rem 0;
}

.footer-section a:hover {
    color: #ffffff;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    color: rgba(255, 255, 255, 0.8);
    padding: 20px;
}

.footer-bottom p {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8) !important;
}

.swiss-software {
    display: inline-flex;
    align-items: center;
    background: #ff0000;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    margin-bottom: 20px !important;
}

.cross-symbol {
    margin-right: 5px;
    font-weight: bold;
}

/* ============================================================================================= */
/* FORMS - LOGIN */
.login-main {
    background: linear-gradient(180deg, var(--bg-color) 0%, var(--footer-bg) 100%);
    margin: 0;
    padding: 40px 20px 70px 20px;
    color: var(--primary-blue);
}

.login-container {
    max-width: 420px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 5px 10px var(--shadow-strong);
    border: 1px solid var(--border-color);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    color: var(--primary-blue);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 1rem;
}

label {
    font-weight: 600;
    color: var(--text-color);
}

input[type="email"],
input[type="password"] {
    padding: 0.7rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    width: 100%;
    transition: var(--transition);
    background: var(--input-bg);
    color: var(--text-color);
}

/* Sauf le champ de la page Recherche : son cadre .search-field porte déjà
   le focus (focus-within), un second anneau sur le champ faisait double. */
input:not(#postSearch):focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(1, 56, 97, 0.1);
}

.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.remember {
    display: flex;
    flex-direction: row !important;
    font-size: 0.95rem;
    color: var(--text-color);
}

.remember label {
    margin: 5px 5px;
}

.remember input {
    margin-right: 0.5rem;
}

.bottom-links {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.95rem;
}

.bottom-links a {
    color: var(--primary-blue);
    text-decoration: none;
    margin: 0 0.5rem;
}

.bottom-links a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-row label {
        margin-bottom: 0.3rem;
    }
}

/* ============================================================================================= */
/* FORMS - REGISTER */
.register-main {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--footer-bg) 100%);
    margin: 0;
    padding: 40px 20px 70px 20px;
    color: var(--primary-blue);
}

.register-container {
    max-width: 420px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 5px 10px var(--shadow-strong);
    border: 1px solid var(--border-color);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.4rem;
    min-height: 1.4rem;
    color: var(--text-color);
}

.form-group input {
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--input-bg);
    /* color: var(--text-color) !important; */
    transition: var(--transition);
    background-color: var(--input-bg) !important;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.link {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.link a {
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: none;
}

.link a:hover {
    text-decoration: underline;
}

.input-section {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            padding: 20px;
        }

        .code-input {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin: 20px 0;
            flex-wrap: wrap;
        }

        .char-input {
            width: 50px;
            height: 50px;
            border: 2px solid #66c0f4;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.1);
            color: white;
            font-size: 20px;
            font-weight: bold;
            text-align: center;
            text-transform: uppercase;
            transition: all 0.3s ease;
            outline: none;
        }

        .char-input:focus {
            border-color: #4CAF50;
            background: rgba(255, 255, 255, 0.2);
            box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
        }

        .char-input.filled {
            background: rgba(76, 175, 80, 0.3);
            border-color: #4CAF50;
        }

        .result-display {
            text-align: center;
            font-size: 18px;
            font-weight: bold;
            margin-top: 20px;
            padding: 15px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            min-height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .valid {
            color: #4CAF50;
        }

        .invalid {
            color: #f44336;
        }

        .section-title {
            font-size: 20px;
            margin-bottom: 15px;
            color: #66c0f4;
            text-align: center;
        }

        @media (max-width: 600px) {
            .char-input {
                width: 40px;
                height: 40px;
                font-size: 16px;
            }
            
            .code-input {
                gap: 5px;
            }
        }

/* ============================================================================================= */
/* FORMS - CONTACT */
.contact-main {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--footer-bg) 100%);
    margin: 0;
    padding: 40px 20px 70px 20px;
    color: var(--primary-blue);
}

.contact-form {
    max-width: 600px;
    margin: auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow-light);
    border: 1px solid var(--border-color);
}

.contact-form .form-group input,
.contact-form .form-group textarea {
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text-color);
    transition: var(--transition);
}

.contact-form .form-group textarea {
    resize: vertical;
}

.contact-form .form-group input:focus,
.contact-form .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.message {
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
}

.message.success {
    color: var(--accent-green);
}

.message.error {
    color: var(--accent-red);
}

/* ============================================================================================= */
/* ANIMATIONS */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.phone-mockup {
    animation: float 6s ease-in-out infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-text > * {
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero-text h1 { animation-delay: 0.2s; }
.hero-text p { animation-delay: 0.4s; }
.hero-buttons { animation-delay: 0.6s; }

/* ============================================================================================= */
/* RESPONSIVE MOBILE */
@media (max-width: 768px) {
    .logo {
        margin-left: 15px;
    }
    main {
        margin-top: 86px;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .phone-mockup {
        width: 95%;
        height: 530px;
    }

    /* L'écran raccourcit de 170 px : à contenu égal, la barre d'onglets sortirait
       du cadre et serait rognée par « overflow: hidden ». La seconde publication
       part — une seule suffit à montrer à quoi ressemble le fil, et la barre du
       bas, elle, fait partie de ce qu'on vient voir. */
    .pm-post + .pm-post { display: none; }
    .pm-photo { height: 96px; }

    .cta h2 {
        font-size: 2.5rem;
    }
    
    .features h2 {
        font-size: 2rem;
    }

    .hero-buttons a {
        margin: auto;
    }

    .features-grid {
        display: block;
        grid-template-columns: none;        
    }

    .feature-card {
        margin-bottom: 25px;
    }
}



/* ============================================================================================= */
/* TRANSITIONS GLOBALES POUR LE CHANGEMENT DE THÈME */
*, *::before, *::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ============================================================================================= */
/* PAGES CONCEPT — héros illustrés (Unsplash) + éléments éditoriaux                               */
/* ============================================================================================= */
.page-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 360px;
    overflow: hidden;
}

.page-hero .ph-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(1, 56, 97, 0.88) 0%, rgba(21, 101, 192, 0.72) 100%);
}

.ph-content {
    position: relative;
    z-index: 1;
    color: #fff;
    padding: 4.5rem 1.5rem;
    max-width: 820px;
    animation: fadeInUp 0.8s ease-out both;
}

.ph-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 0.4rem 1.1rem;
    border-radius: 30px;
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}

.ph-content h1 {
    font-size: 2.8rem;
    margin: 0 0 1rem;
    color: #fff;
}

.ph-content .ph-sub {
    color: #fff;   /* la règle globale p{color:var(--text-color)} rendait le texte sombre en mode clair */
    font-size: 1.25rem;
    opacity: 0.94;
    line-height: 1.5;
    margin: 0;
}

/* Accroche éditoriale sous le héros */
.concept-quote {
    max-width: 820px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 0;
    text-align: center;
    font-size: 1.25rem;
    line-height: 1.65;
    color: var(--text-color);
}

.concept-quote strong { color: var(--primary-blue); }

@media (max-width: 768px) {
    .page-hero { min-height: 280px; }
    .ph-content h1 { font-size: 2rem; }
    .ph-content { padding: 3rem 1.2rem; }
}


/* ============================================================================================= */
/* FAQ — accordéon (details/summary, sans JS)                                                     */
/* ============================================================================================= */
.faq-list {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.faq-list details {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow-light);
    transition: var(--transition);
}

.faq-list details[open] {
    box-shadow: 0 8px 25px var(--shadow-medium);
}

.faq-list summary {
    cursor: pointer;
    padding: 1.2rem 1.4rem;
    font-weight: 600;
    color: var(--text-color);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
}

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

.faq-list summary i.faq-icon { color: var(--primary-blue); width: 22px; text-align: center; }

.faq-list summary i.faq-caret {
    margin-left: auto;
    color: var(--primary-blue);
    transition: transform 0.25s ease;
}

.faq-list details[open] summary i.faq-caret { transform: rotate(180deg); }

.faq-list .faq-answer {
    padding: 0 1.4rem 1.3rem 3.1rem;
    color: var(--text-secondary);
    line-height: 1.65;
    animation: fadeInUp 0.3s ease-out;
}

@media (max-width: 600px) {
    .faq-list .faq-answer { padding-left: 1.4rem; }
}


/* ============================================================================================= */
/* HOME — mosaïque "moments réels" (images Unsplash, animées au scroll)                           */
/* ============================================================================================= */
.moments {
    padding: 5rem 0;
    background: var(--bg-secondary);
}

.moments h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.moments .features-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.moments-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
}

.moment {
    position: relative;
    margin: 0;
    border-radius: 18px;
    overflow: hidden;
    height: 320px;
    box-shadow: 0 8px 30px var(--shadow-light);
    transition: var(--transition);
}

.moment:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 40px var(--shadow-medium);
}

.moment img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.moment:hover img { transform: scale(1.07); }

.moment figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2.4rem 1.2rem 1.2rem;
    background: linear-gradient(transparent, rgba(1, 56, 97, 0.88));
    color: #fff;
    font-weight: 600;
    font-size: 0.98rem;
    line-height: 1.4;
}

@media (max-width: 900px) {
    .moments-grid { grid-template-columns: repeat(2, 1fr); }
    .moment { height: 230px; }
}

@media (max-width: 480px) {
    .moments-grid { grid-template-columns: 1fr; }
}


/* ============================================================================================= */
/* PERMALIEN PUBLIC D'UNE PUBLICATION (/@pseudo/<hash>) — visible sans compte                     */
/* ============================================================================================= */
.ppost-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.ppost {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 30px var(--shadow-light);
}

.ppost-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 1.2rem;
}

.ppost-av {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
}

.ppost-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.ppost-name { font-weight: bold; color: var(--text-color); font-size: 1.05rem; }
.ppost-handle { color: var(--text-secondary); font-size: 0.88rem; }

.ppost-content {
    font-size: 1.15rem;
    line-height: 1.65;
    color: var(--text-color);
    margin-bottom: 1rem;
    /* Voir .post-content : le texte s'affiche tel qu'il a été tapé. */
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ppost-content .hashtag { color: #1d9bf0; font-weight: 600; }

.ppost-media { border-radius: 14px; overflow: hidden; margin-bottom: 1rem; }
.ppost-media img, .ppost-media video { display: block; border-radius: 14px; }
/* Une seule image : proportions conservées, un portrait reste un portrait.
   width:100% + object-fit:cover le rognait en haut et en bas. */
.ppost-media:not(.multi) img { width: auto; max-width: 100%; height: auto;
    max-height: min(640px, 80vh); margin: 0 auto; }
/* Vidéo : largeur pleine, et rapport 16/9 pour réserver la place avant le
   chargement — le cadre ne dépend donc pas des dimensions du fichier. */
.ppost-media video { width: 100%; max-height: 520px; background: #000;
    object-fit: contain; aspect-ratio: 16 / 9; height: auto; }
.ppost-media.multi { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
/* En mosaïque le cadrage uniforme est voulu : le clic ouvre l'image entière. */
.ppost-media.multi img, .ppost-media.multi video { width: 100%; height: 240px; object-fit: cover; border-radius: 10px; }

/* ===== Vidéo YouTube détectée dans une publication =====
   Une vignette (image statique) sous le texte, un bouton de lecture au
   centre ; le clic remplace le tout par le lecteur (dwYoutubeLire). Le cadre
   porte le rapport 16/9 : hqdefault.jpg est en 4/3 avec des bandes noires,
   que le recadrage (object-fit: cover) fait disparaître. */
.dw-yt {
    position: relative;
    margin: 0.8rem 0 0;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
    cursor: pointer;
}
.dw-yt img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    border-radius: 0;
}
.dw-yt iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.dw-yt-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 68px;
    height: 48px;
    margin: -24px 0 0 -34px;
    background: rgba(33, 33, 33, 0.8);
    border-radius: 14px;
    transition: background 0.15s ease;
}
.dw-yt-play::after {
    content: '';
    position: absolute;
    left: 27px;
    top: 14px;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #fff;
}
.dw-yt:hover .dw-yt-play, .dw-yt:focus-visible .dw-yt-play { background: #f00; }
.dw-yt.is-playing { cursor: default; }
/* Aperçu dans le composeur : une image, pas un lecteur */
.dw-yt.dw-yt-static { cursor: default; }
.dw-yt.dw-yt-static:hover .dw-yt-play { background: rgba(33, 33, 33, 0.8); }

/* Adresse dans le texte d'une publication ou d'un commentaire */
.post-link { color: #1d9bf0; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.post-link:hover { text-decoration: none; }

/* ===== Bloc « lien » sous le texte d'une publication =====
   Contient soit le lecteur YouTube (+ légende), soit la carte du site. */
.dw-link { margin: 0.8rem 0 0; }
.dw-link .dw-yt { margin: 0; }
.ppost-content + .dw-link { margin: -0.2rem 0 1rem; }
.post-quoted .dw-link { margin-top: 0.7rem; }

/* Carte d'un site : image OG, nom du site, titre, descriptif court */
.dw-linkcard {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    background: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    transition: border-color 0.15s ease;
}
a.dw-linkcard:hover, a.dw-linkcard:focus-visible { border-color: var(--primary-blue); text-decoration: none; }
.dw-lc-img {
    display: block;
    width: 100%;
    aspect-ratio: 1.91 / 1;
    object-fit: cover;
    background: var(--bg-secondary);
    margin: 0;
    border-radius: 0;
}
.dw-lc-body { padding: 0.7rem 0.9rem 0.8rem; min-width: 0; }
/* Pas d'image (ou image en 404) : carte en ligne, icône « lien » à gauche */
.dw-linkcard.dw-lc-sans-image { flex-direction: row; align-items: stretch; }
.dw-lc-img.dw-lc-noimg {
    flex: 0 0 76px;
    width: 76px;
    min-height: 76px;
    aspect-ratio: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-secondary);
}
.dw-lc-sans-image .dw-lc-body { flex: 1 1 auto; }
.dw-lc-site {
    font-size: 0.76rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dw-lc-title {
    font-weight: 700;
    margin-top: 0.15rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dw-lc-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dw-lc-load { padding: 0.7rem 0.9rem; color: var(--text-secondary); font-size: 0.9rem; }

/* Légende sous une vidéo : « YouTube · Titre · Chaîne » */
.dw-lc-caption {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.1rem 0.6rem;
    padding: 0.5rem 0.2rem 0;
    line-height: 1.35;
}
.dw-lc-caption .dw-lc-title { margin: 0; font-size: 0.95rem; }
.dw-lc-caption .dw-lc-desc { margin: 0; font-size: 0.85rem; }

/* Boîte d'aperçu dans les composeurs (fil et modale) */
.dw-linkcard-wrap { margin: 0.4rem 0 0.9rem; }

.ppost-stats {
    display: flex;
    gap: 1.6rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.ppost-stats i { color: var(--primary-blue); margin-right: 5px; }

.ppost-cta {
    text-align: center;
    margin-top: 1.6rem;
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Permalien public : actions et commentaires, alignés sur la vue interne */
.ppost-actions { display: flex; gap: .6rem; flex-wrap: wrap; padding-top: 1rem; border-top: 1px solid var(--border-color); }
.ppost-btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .5rem 1rem; border: none; border-radius: 25px;
    background: var(--hover-bg); color: var(--text-color);
    cursor: pointer; font-size: .92rem; transition: var(--transition);
}
.ppost-btn:hover { background: var(--primary-blue); color: #fff; }
.ppost-btn.reposted { background: rgba(46, 213, 115, .18); color: #2ed573; }

.ppost-comments { margin-top: 1.4rem; }
.ppost-ctitle { font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; margin: 0 0 1rem; }
.ppost-empty { color: var(--text-secondary); font-style: italic; }
.ppost-comment { display: flex; gap: .8rem; padding: .9rem 0; border-bottom: 1px solid var(--border-color); }
.ppost-comment:last-child { border-bottom: none; }
.ppost-cav {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
    background: var(--primary-blue); color: #fff; font-weight: 700; font-size: .82rem;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.ppost-cav img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ppost-cbody { min-width: 0; }
.ppost-cmeta { font-size: .85rem; margin-bottom: .2rem; }
.ppost-cmeta span { color: var(--text-secondary); }
.ppost-ctext { line-height: 1.55; word-wrap: break-word; }
