/* ============================================================
   CINÉLISTE — DESIGN SYSTEM
   Chargé APRÈS style.css : redéfinit l'ossature et les composants.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

/* ============================================================
   1. TOKENS
   ============================================================ */
:root {
    /* Accents par catégorie (identité fixe) */
    --c-movie: #ef4444;
    --c-tv: #3b82f6;
    --c-anime: #f59e0b;
    --c-music: #a855f7;

    /* Accent actif (piloté par [data-category]) */
    --accent: #3b82f6;
    --accent-soft: rgba(59, 130, 246, 0.15);
    --accent-glow: rgba(59, 130, 246, 0.35);

    /* Rayons */
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-pill: 999px;

    /* Typo */
    --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Transitions */
    --t: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- THÈME SOMBRE (défaut) --- */
:root,
[data-theme="dark"] {
    --bg: #070a18;
    --bg-2: #0b1024;
    --panel: rgba(255, 255, 255, 0.045);
    --panel-strong: rgba(255, 255, 255, 0.07);
    --card: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);
    --txt: #eef1fa;
    --txt-2: #a8b0cc;
    --txt-3: #6f7899;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);

    /* Halos d'ambiance */
    --glow-1: rgba(59, 130, 246, 0.32);
    --glow-2: rgba(168, 85, 247, 0.30);
    --glow-3: rgba(239, 68, 68, 0.20);
}

/* --- THÈME CLAIR --- */
[data-theme="light"] {
    --bg: #eef1f8;
    --bg-2: #ffffff;
    --panel: rgba(255, 255, 255, 0.75);
    --panel-strong: #ffffff;
    --card: #ffffff;
    --line: rgba(15, 23, 42, 0.09);
    --line-strong: rgba(15, 23, 42, 0.16);
    --txt: #0f172a;
    --txt-2: #4a5578;
    --txt-3: #8791ad;
    --shadow: 0 14px 40px rgba(15, 23, 42, 0.10);

    --glow-1: rgba(59, 130, 246, 0.16);
    --glow-2: rgba(168, 85, 247, 0.13);
    --glow-3: rgba(239, 68, 68, 0.09);
}

/* --- Accent piloté par la catégorie active --- */
[data-category="movie"]  { --accent: var(--c-movie);  --accent-soft: rgba(239,68,68,0.15);  --accent-glow: rgba(239,68,68,0.35); }
[data-category="tv"]     { --accent: var(--c-tv);     --accent-soft: rgba(59,130,246,0.15); --accent-glow: rgba(59,130,246,0.35); }
[data-category="anime"]  { --accent: var(--c-anime);  --accent-soft: rgba(245,158,11,0.15); --accent-glow: rgba(245,158,11,0.35); }
[data-category="music"]  { --accent: var(--c-music);  --accent-soft: rgba(168,85,247,0.15); --accent-glow: rgba(168,85,247,0.35); }

/* L'ambiance de fond suit aussi la catégorie */
[data-category="movie"]  { --glow-1: rgba(239,68,68,0.20);  }
[data-category="anime"]  { --glow-1: rgba(245,158,11,0.20); }
[data-category="music"]  { --glow-1: rgba(168,85,247,0.22); }

/* ============================================================
   2. BASE
   ============================================================ */
* { box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--txt);
    margin: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    position: relative;
    transition: background var(--t), color var(--t);
}

/* ------------------------------------------------------------
   Halos d'ambiance — déplacement aléatoire sur toute la page.
   Les destinations sont tirées au sort en JS (voir main.js) ;
   la transition CSS assure un déplacement fluide entre elles.
   ------------------------------------------------------------ */
.glow-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 62vmax;
    height: 62vmax;
    /* le centre du halo est placé sur le point ciblé */
    margin: -31vmax 0 0 -31vmax;
    border-radius: 50%;
    will-change: transform, opacity;
    transition: transform 14s cubic-bezier(0.45, 0, 0.55, 1),
                opacity 7s ease-in-out,
                background var(--t);
}

/* Position de départ (avant le premier tirage, et si JS indisponible) */
.glow-1 { background: radial-gradient(circle, var(--glow-1), transparent 66%); transform: translate3d(22vw, 20vh, 0); }
.glow-2 { background: radial-gradient(circle, var(--glow-2), transparent 66%); transform: translate3d(78vw, 34vh, 0); }
.glow-3 { background: radial-gradient(circle, var(--glow-3), transparent 66%); transform: translate3d(52vw, 82vh, 0); }

/* Respect du réglage système « animations réduites » */
@media (prefers-reduced-motion: reduce) {
    .glow { transition: none; }
}

h1, h2, h3, h4 {
    font-family: var(--font);
    color: var(--txt);
    letter-spacing: -0.02em;
    font-weight: 700;
}

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

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.page-title {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 1.6rem;
    color: var(--txt);
}
.page-sub { color: var(--txt-2); font-size: 0.95rem; margin: -1rem 0 1.8rem; }

/* ============================================================
   3. NAVBAR
   ============================================================ */
.navbar {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 0.85rem 1.5rem;
    background: var(--panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 900;
}

.navbar-brand a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}
.navbar-brand img {
    width: 30px; height: 30px;
    border-radius: 9px;
    object-fit: contain;
}

/* Pastilles de catégorie */
.nav-pills { display: flex; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.nav-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.1rem;
    border-radius: var(--r-pill);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--txt-2);
    background: var(--panel);
    border: 1px solid var(--line);
    transition: all var(--t);
    white-space: nowrap;
}
.nav-pill:hover { color: var(--txt); border-color: var(--line-strong); }
.nav-pill.active {
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 20px -4px var(--pill-glow, var(--accent-glow));
    background: var(--pill-bg, var(--accent));
}
.nav-pill[data-cat="movie"].active { --pill-bg: var(--c-movie); --pill-glow: rgba(239,68,68,0.5); }
.nav-pill[data-cat="tv"].active    { --pill-bg: var(--c-tv);    --pill-glow: rgba(59,130,246,0.5); }
.nav-pill[data-cat="anime"].active { --pill-bg: var(--c-anime); --pill-glow: rgba(245,158,11,0.5); }
.nav-pill[data-cat="music"].active { --pill-bg: var(--c-music); --pill-glow: rgba(168,85,247,0.5); }

.navbar-right { margin-left: auto; display: flex; align-items: center; gap: 0.7rem; }

/* Bouton icône (recherche) */
.icon-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--txt-2);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--t);
}
.icon-btn:hover { color: var(--txt); border-color: var(--line-strong); }

/* Sélecteur de thème segmenté */
.theme-switch {
    display: flex;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    padding: 3px;
    gap: 2px;
}
.theme-switch button {
    padding: 0.4rem 1rem;
    border: none;
    background: none;
    border-radius: var(--r-pill);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--txt-2);
    cursor: pointer;
    transition: all var(--t);
}
.theme-switch button.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 14px -3px var(--accent-glow);
}

/* Menu déroulant */
.nav-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--r-pill);
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--txt);
    font-family: var(--font);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t);
}
.nav-menu-btn:hover { border-color: var(--line-strong); }

.nav-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    color: #fff;
    background: linear-gradient(135deg, var(--c-tv), var(--c-music));
    border: 2px solid var(--line-strong);
    cursor: pointer;
    flex-shrink: 0;
}

/* Menu déroulant */
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 210px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow);
    padding: 0.4rem;
    list-style: none;
    margin: 0;
    z-index: 1000;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu li { width: 100%; }
.nav-dropdown-menu a {
    display: block;
    padding: 0.6rem 0.85rem;
    border-radius: var(--r-sm);
    font-size: 0.87rem;
    font-weight: 500;
    color: var(--txt-2);
    transition: all var(--t);
}
.nav-dropdown-menu a:hover { background: var(--panel-strong); color: var(--txt); }

/* ============================================================
   4. SURFACES
   ============================================================ */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1.6rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
}

/* ============================================================
   5. BOUTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: var(--r-pill);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--t);
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 22px -6px var(--accent-glow);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-secondary {
    background: var(--panel-strong);
    color: var(--txt);
    border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--line-strong); }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.82rem; }

/* Pastilles de filtre */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1rem;
    border-radius: var(--r-pill);
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--txt-2);
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t);
}
.chip:hover { color: var(--txt); border-color: var(--line-strong); }
.chip.active { background: var(--accent); color: #fff; border-color: transparent; }

/* ============================================================
   6. CHAMPS
   ============================================================ */
.field {
    width: 100%;
    padding: 0.8rem 1.1rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    color: var(--txt);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: border-color var(--t);
}
.field::placeholder { color: var(--txt-3); }
.field:focus { outline: none; border-color: var(--accent); }

/* Grande barre de recherche */
.searchbar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 0.5rem 0.5rem 0.5rem 1.2rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.searchbar input {
    flex: 1;
    background: none;
    border: none;
    color: var(--txt);
    font-family: var(--font);
    font-size: 1rem;
    padding: 0.6rem 0;
}
.searchbar input:focus { outline: none; }
.searchbar input::placeholder { color: var(--txt-3); }

/* ============================================================
   7. GRILLE DE MÉDIAS
   ============================================================ */
.media-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1.2rem;
}

.poster {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: var(--r-md);
    overflow: hidden;
    background: linear-gradient(140deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
    border: 1px solid var(--line);
    display: block;
}
.poster.square { aspect-ratio: 1 / 1; }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }

.media-item .media-name {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--txt);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.media-item .media-meta { font-size: 0.78rem; color: var(--txt-3); margin-top: 0.15rem; }

/* Badge sur affiche */
.badge {
    position: absolute;
    top: 8px; left: 8px;
    padding: 0.22rem 0.6rem;
    border-radius: var(--r-pill);
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    backdrop-filter: blur(6px);
}
.badge-dark {
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.15);
}

/* Barre de progression sur affiche */
.poster-progress {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 4px;
    background: rgba(0,0,0,0.4);
}
.poster-progress span {
    display: block;
    height: 100%;
    background: var(--accent);
}

/* ============================================================
   8. SECTIONS
   ============================================================ */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 2.5rem 0 1.1rem;
}
.section-head h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}
.section-link { color: var(--accent); font-size: 0.86rem; font-weight: 600; }

/* ============================================================
   7bis. COMPOSANTS PARTAGÉS
   ============================================================ */

/* --- Carte statistique --- */
.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 1.5rem 1.6rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: -60%; right: -30%;
    width: 90%; height: 200%;
    background: radial-gradient(circle, var(--accent-glow), transparent 65%);
    opacity: 0.18;
    pointer-events: none;
}
.stat-value { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--txt); }
.stat-label { font-size: 0.85rem; color: var(--txt-2); margin-top: 0.5rem; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.2rem;
}

/* --- Barre de progression étiquetée --- */
.meter-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.85rem; }
.meter-name { width: 130px; font-size: 0.88rem; color: var(--txt-2); flex-shrink: 0; }
.meter { flex: 1; height: 9px; background: var(--line); border-radius: var(--r-pill); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--accent); }
.meter-val { width: 46px; text-align: right; font-size: 0.82rem; color: var(--txt-2); font-weight: 600; }

/* --- Interrupteur --- */
.toggle {
    position: relative;
    width: 46px; height: 26px;
    border-radius: var(--r-pill);
    background: var(--line-strong);
    border: none;
    cursor: pointer;
    transition: background var(--t);
    flex-shrink: 0;
}
.toggle::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform var(--t);
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(20px); }

/* --- Ligne de liste --- */
.list-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--r-md);
    background: var(--panel);
    border: 1px solid var(--line);
    margin-bottom: 0.5rem;
    transition: all var(--t);
}
.list-row:hover { border-color: var(--line-strong); }
.list-row.done { background: var(--accent-soft); border-color: transparent; }

/* Pastille cochée */
.check {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 2px solid var(--line-strong);
    background: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: transparent;
    transition: all var(--t);
}
.check.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* --- Barre de répartition segmentée (animée) --- */
.split-bar {
    display: flex;
    height: 11px;
    border-radius: var(--r-pill);
    overflow: hidden;
    background: var(--track, var(--line));
    margin-bottom: 1.3rem;
}
.split-bar span {
    height: 100%;
    animation: splitGrow 1.1s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.split-bar span:nth-child(1) { animation-delay: 0.10s; }
.split-bar span:nth-child(2) { animation-delay: 0.25s; }
.split-bar span:nth-child(3) { animation-delay: 0.40s; }
.split-bar span:nth-child(4) { animation-delay: 0.55s; }
.split-bar span:nth-child(5) { animation-delay: 0.70s; }

@keyframes splitGrow { from { width: 0; } }

.split-legend { display: flex; gap: 2rem; flex-wrap: wrap; }
.split-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    animation: splitFade 0.55s ease both;
}
.split-item:nth-child(1) { animation-delay: 0.30s; }
.split-item:nth-child(2) { animation-delay: 0.45s; }
.split-item:nth-child(3) { animation-delay: 0.60s; }
.split-item:nth-child(4) { animation-delay: 0.75s; }

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

.split-dot { width: 11px; height: 11px; border-radius: 4px; flex-shrink: 0; }
.split-info { display: flex; flex-direction: column; }
.split-count { font-size: 1.15rem; font-weight: 800; color: var(--txt); line-height: 1.2; }
.split-count small { font-size: 0.74rem; color: var(--txt-3); font-weight: 600; margin-left: 0.3rem; }
.split-name { font-size: 0.78rem; color: var(--txt-2); }

@media (max-width: 640px) { .split-legend { gap: 1.2rem; } }

/* --- Avatar large --- */
.avatar-lg {
    width: 96px; height: 96px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--c-tv), var(--c-music));
    border: 3px solid var(--line-strong);
    flex-shrink: 0;
    overflow: hidden;
}
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

/* --- Fil d'ariane / méta en chips --- */
.meta-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.meta-chip {
    padding: 0.35rem 0.85rem;
    border-radius: var(--r-pill);
    background: var(--panel);
    border: 1px solid var(--line);
    font-size: 0.82rem;
    color: var(--txt-2);
}

/* ============================================================
   8bis. FOOTER
   ============================================================ */
.site-footer {
    margin-top: 4rem;
    border-top: 1px solid var(--line);
    padding: 2rem 1.5rem 1.5rem;
    font-size: 0.8rem;
}
.site-footer-inner {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
}
.site-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.5rem;
}
.site-footer-brand img { height: 18px; width: 18px; border-radius: 5px; object-fit: contain; }
.site-footer-brand span { font-weight: 700; color: var(--txt); font-size: 0.86rem; }
.site-footer a { color: var(--txt-3); transition: color var(--t); }
.site-footer a:hover { color: var(--accent); }
.site-footer-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }

/* ============================================================
   8ter. ANIMATIONS
   Entrées de page, apparition en cascade, micro-interactions.
   Uniquement transform/opacity → composité GPU, aucun reflow.
   ============================================================ */

@keyframes fadeUp   { from { opacity: 0; transform: translateY(14px); } }
@keyframes fadeIn   { from { opacity: 0; } }
@keyframes scaleIn  { from { opacity: 0; transform: scale(0.96); } }
@keyframes slideIn  { from { opacity: 0; transform: translateX(-12px); } }

/* --- Entrée des blocs principaux --- */
.page-title      { animation: fadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards; }
.page-sub        { animation: fadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.06s backwards; }
.searchbar       { animation: fadeUp 0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.10s backwards; }
.sec-title       { animation: slideIn 0.45s ease backwards; }
.panel           { animation: fadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards; }
.stat-card       { animation: scaleIn 0.45s cubic-bezier(0.4, 0, 0.2, 1) backwards; }
.hero-resume     { animation: scaleIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards; }
.profile-hero    { animation: scaleIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards; }

/* Cascade sur les cartes de statistiques */
.stats-grid .stat-card:nth-child(1) { animation-delay: 0.04s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.10s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.16s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.22s; }
.stats-grid .stat-card:nth-child(5) { animation-delay: 0.28s; }

/* Cascade sur les panneaux de statut */
.status-grid .panel:nth-child(1) { animation-delay: 0.05s; }
.status-grid .panel:nth-child(2) { animation-delay: 0.12s; }
.status-grid .panel:nth-child(3) { animation-delay: 0.19s; }
.status-grid .panel:nth-child(4) { animation-delay: 0.26s; }

/* --- Apparition en cascade des grilles de médias --- */
.media-grid .media-item,
.rail .media-item,
.sg-grid .sg-card {
    animation: fadeUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.media-grid .media-item:nth-child(1),  .rail .media-item:nth-child(1),  .sg-grid .sg-card:nth-child(1)  { animation-delay: 0.03s; }
.media-grid .media-item:nth-child(2),  .rail .media-item:nth-child(2),  .sg-grid .sg-card:nth-child(2)  { animation-delay: 0.06s; }
.media-grid .media-item:nth-child(3),  .rail .media-item:nth-child(3),  .sg-grid .sg-card:nth-child(3)  { animation-delay: 0.09s; }
.media-grid .media-item:nth-child(4),  .rail .media-item:nth-child(4),  .sg-grid .sg-card:nth-child(4)  { animation-delay: 0.12s; }
.media-grid .media-item:nth-child(5),  .rail .media-item:nth-child(5),  .sg-grid .sg-card:nth-child(5)  { animation-delay: 0.15s; }
.media-grid .media-item:nth-child(6),  .rail .media-item:nth-child(6),  .sg-grid .sg-card:nth-child(6)  { animation-delay: 0.18s; }
.media-grid .media-item:nth-child(7),  .rail .media-item:nth-child(7),  .sg-grid .sg-card:nth-child(7)  { animation-delay: 0.21s; }
.media-grid .media-item:nth-child(n+8) { animation-delay: 0.24s; }

/* --- Affiches : zoom au survol --- */
.poster { position: relative; }
.poster img { transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1); }
.media-item:hover .poster img,
.sg-card:hover .sg-card-poster img { transform: scale(1.07); }

.media-item { transition: transform var(--t); }
.media-item:hover { transform: translateY(-5px); }
.media-item .media-name { transition: color var(--t); }
.media-item:hover .media-name { color: var(--accent); }

/* --- Micro-interactions --- */
.btn { transition: transform var(--t), filter var(--t), background var(--t), border-color var(--t), box-shadow var(--t); }
.btn:active { transform: translateY(1px) scale(0.985); }

.chip { transition: transform var(--t), background var(--t), border-color var(--t), color var(--t); }
.chip:hover { transform: translateY(-2px); }
.chip:active { transform: translateY(0) scale(0.97); }

.nav-pill { transition: transform var(--t), background var(--t), border-color var(--t), color var(--t), box-shadow var(--t); }
.nav-pill:hover { transform: translateY(-1px); }

.icon-btn { transition: transform var(--t), color var(--t), border-color var(--t); }
.icon-btn:hover { transform: scale(1.08); }

.nav-avatar { transition: transform var(--t), border-color var(--t); }
.nav-avatar:hover { transform: scale(1.06); }

/* Lignes de liste (épisodes, statuts) */
.list-row { transition: transform var(--t), background var(--t), border-color var(--t); }
.list-row:hover { transform: translateX(4px); }

.check { transition: transform var(--t), background var(--t), border-color var(--t), color var(--t); }
.check:active { transform: scale(0.88); }

/* Menu déroulant */
.nav-dropdown.open .nav-dropdown-menu { animation: scaleIn 0.18s ease backwards; transform-origin: top right; }

/* Jauges (genres, progression) */
.meter span { transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1); }
.poster-progress span,
.ep-bar span,
.hero-bar span { transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }

/* --- Respect du réglage système « animations réduites » --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   8quater. AUTHENTIFICATION
   Carte partagée par login / register / forgot_password / reset_password
   ============================================================ */
.auth-wrap { display: flex; justify-content: center; padding: 1.5rem 0 1rem; }
.auth-card { width: 100%; max-width: 440px; padding: 2.2rem; }

/* Pastille d'icône en tête de carte */
.auth-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.1rem;
    border-radius: var(--r-md);
    background: var(--accent-soft);
    color: var(--accent);
}
.auth-icon.is-ok  { background: rgba(34, 197, 94, 0.14); color: #22c55e; }
.auth-icon.is-bad { background: rgba(239, 68, 68, 0.14); color: #ef4444; }

.auth-title { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 0.35rem; }
.auth-sub { color: var(--txt-2); font-size: 0.9rem; line-height: 1.55; margin: 0 0 1.6rem; }
.auth-card.is-centered .auth-title,
.auth-card.is-centered .auth-sub { text-align: center; }
/* Le sous-titre porte déjà l'espacement : pas de double marge après lui */
.auth-sub + .auth-note,
.auth-sub + .auth-actions { margin-top: 0; }

.auth-label { display: block; font-size: 0.78rem; color: var(--txt-3); margin: 1.1rem 0 0.4rem; }
.auth-card form > .auth-label:first-child { margin-top: 0; }
.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.auth-link-sm { font-size: 0.76rem; color: var(--txt-3); transition: color var(--t); }
.auth-link-sm:hover { color: var(--accent); }
.auth-hint { display: block; font-size: 0.75rem; color: var(--txt-3); margin-top: 0.45rem; }

.auth-submit { width: 100%; margin-top: 1.6rem; }
.auth-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-top: 1.6rem; }

.auth-foot { text-align: center; font-size: 0.86rem; color: var(--txt-2); margin: 1.5rem 0 0; }
.auth-foot a { color: var(--accent); font-weight: 600; }

.auth-alert {
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.08);
    border-radius: var(--r-md);
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.2rem;
    font-size: 0.86rem;
}
.auth-alert p { margin: 0.15rem 0; }

/* Encart d'information (rappels, prérequis) */
.auth-note {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 0.9rem 1.1rem;
    margin-top: 1.6rem;
    font-size: 0.82rem;
    color: var(--txt-2);
    line-height: 1.7;
}
.auth-note strong { color: var(--txt); font-weight: 600; }
.auth-note ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }

/* Jauge de robustesse du mot de passe */
.pw-meter {
    height: 4px;
    border-radius: var(--r-pill);
    background: var(--line);
    margin-top: 0.55rem;
    overflow: hidden;
}
.pw-meter span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: var(--r-pill);
    transition: width var(--t), background var(--t);
}
.pw-meter span.is-weak   { width: 33%;  background: #ef4444; }
.pw-meter span.is-medium { width: 66%;  background: #f59e0b; }
.pw-meter span.is-strong { width: 100%; background: #22c55e; }
.pw-note { font-size: 0.75rem; color: var(--txt-3); margin-top: 0.35rem; min-height: 1em; }

@media (max-width: 640px) {
    .auth-card { padding: 1.6rem; }
}

/* ============================================================
   9. UTILITAIRES
   ============================================================ */
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-sm { gap: 0.5rem; } .gap-md { gap: 1rem; } .gap-lg { gap: 1.5rem; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--txt-2); }
.faint { color: var(--txt-3); }

/* ============================================================
   10. RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) { .media-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 900px) {
    .media-grid { grid-template-columns: repeat(4, 1fr); }
    .nav-pills { display: none; }
}
@media (max-width: 640px) {
    .container { padding: 1.2rem 1rem 3rem; }
    .page-title { font-size: 1.8rem; }
    .media-grid { grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
    .navbar { gap: 0.6rem; padding: 0.7rem 1rem; }
    .theme-switch button { padding: 0.35rem 0.7rem; font-size: 0.76rem; }
}