/* ============================================================
   Guide Jellyfin — feuille de style
   Thème bleu/violet, clair + sombre (auto + manuel)
   ============================================================ */

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

/* ---------- Tokens (clair par défaut) ---------- */
:root {
    --font-display: 'Sora', system-ui, sans-serif;
    --font-body: 'Manrope', system-ui, sans-serif;

    --accent-1: #0a82c8;
    --accent-2: #7b3fb5;
    --accent-grad: linear-gradient(120deg, var(--accent-1), var(--accent-2));

    --bg: #eef1f7;
    --bg-soft: #e4e8f2;
    --surface: #ffffff;
    --surface-2: #f6f8fc;
    --text: #1a1f2e;
    --text-soft: #5a6378;
    --border: rgba(20, 30, 60, 0.10);
    --shadow: 0 6px 24px rgba(30, 40, 80, 0.10);
    --shadow-hover: 0 14px 40px rgba(40, 50, 110, 0.18);
    --step-color: #1f9d6b;
    --link: #0a82c8;
    --radius: 16px;
}

/* Palette sombre — réutilisée par auto (média) ET par choix manuel */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0d1018;
        --bg-soft: #11151f;
        --surface: #171c28;
        --surface-2: #1d2433;
        --text: #e8ecf5;
        --text-soft: #9aa3b8;
        --border: rgba(255, 255, 255, 0.09);
        --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
        --shadow-hover: 0 14px 44px rgba(0, 0, 0, 0.55);
        --step-color: #4ad29a;
        --link: #4fb3e8;
    }
}

/* Forçage manuel sombre (quelle que soit la préférence système) */
:root[data-theme="dark"] {
    --bg: #0d1018;
    --bg-soft: #11151f;
    --surface: #171c28;
    --surface-2: #1d2433;
    --text: #e8ecf5;
    --text-soft: #9aa3b8;
    --border: rgba(255, 255, 255, 0.09);
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 14px 44px rgba(0, 0, 0, 0.55);
    --step-color: #4ad29a;
    --link: #4fb3e8;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    line-height: 1.65;
    color: var(--text);
    max-width: 920px;
    margin: auto;
    padding: 24px 20px 80px;
    background:
        radial-gradient(900px 500px at 100% -10%, rgba(123, 63, 181, 0.14), transparent 60%),
        radial-gradient(800px 500px at -10% 10%, rgba(10, 130, 200, 0.12), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Bouton thème ---------- */
#theme-toggle {
    position: fixed;
    top: 18px; right: 18px;
    width: 44px; height: 44px;
    display: grid;
    place-items: center;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    z-index: 60;
    font-size: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#theme-toggle:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
#theme-toggle:active { transform: translateY(0) scale(0.96); }

/* ---------- En-tête ---------- */
header {
    text-align: center;
    padding: 56px 24px 48px;
    margin-bottom: 36px;
    border-radius: 22px;
    position: relative;
    overflow: hidden;
    background: var(--accent-grad);
    box-shadow: var(--shadow);
}

header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(600px 200px at 50% 0%, rgba(255,255,255,0.25), transparent 70%);
    pointer-events: none;
}

header h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.9rem, 5vw, 2.8rem);
    color: #fff;
    margin: 0;
    letter-spacing: -0.02em;
    position: relative;
}

header p.subtitle {
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.05rem;
    margin: 12px 0 0;
    position: relative;
}

/* ---------- Cartes ---------- */
.card {
    background: var(--surface);
    padding: 30px 32px;
    margin: 24px 0;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
    transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s ease, opacity 0.5s ease;
    opacity: 0;
    transform: translateY(24px);
}

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

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card::before {
    content: "";
    position: absolute;
    left: 0; top: 18px; bottom: 18px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--accent-grad);
    opacity: 0.9;
}

/* ---------- Titres ---------- */
h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--text);
    margin: 0 0 14px;
    scroll-margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    letter-spacing: -0.01em;
}

.card.step-card h2::before {
    counter-increment: steps;
    content: counter(steps);
    flex: 0 0 auto;
    width: 38px; height: 38px;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent-grad);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(10, 130, 200, 0.35);
}

body { counter-reset: steps; }

/* ---------- Texte & listes ---------- */
.card p { color: var(--text); margin: 0 0 12px; }

.step {
    font-weight: 600;
    color: var(--step-color);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
}

ol, ul { padding-left: 1.3em; }
li { margin: 6px 0; }

/* Liste FAQ : items espacés avec séparateur léger */
.faq-list { list-style: none; padding-left: 0; }
.faq-list > li {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    line-height: 1.7;
}
.faq-list > li:last-child { border-bottom: none; }
.faq-list > li strong { color: var(--text); }

code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.9em;
    word-break: break-all;
}

/* ---------- Liens ---------- */
a {
    color: var(--link);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1.5px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}
a:hover { border-bottom-color: var(--link); }

/* Lien-bouton mis en avant */
.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-grad);
    color: #fff;
    padding: 11px 20px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(10, 130, 200, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(10, 130, 200, 0.4);
    border-bottom-color: transparent;
}

/* ---------- Mise en page flex (texte / image) ---------- */
.card-content {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    margin-top: 16px;
}

.card-content > div,
.card-content > ul,
.card-content > ol { flex: 1; }

.side-img {
    max-width: 36%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}
.side-img:hover { transform: scale(1.03); }

/* ---------- Bouton retour haut ---------- */
#back-to-top {
    position: fixed;
    bottom: 26px; right: 26px;
    width: 48px; height: 48px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--accent-grad);
    color: #fff;
    font-size: 1.4rem;
    border-radius: 14px;
    box-shadow: var(--shadow-hover);
    z-index: 50;
    transition: transform 0.2s ease;
    border-bottom: none;
}
#back-to-top:hover { transform: translateY(-3px); }

/* ---------- Pied de page ---------- */
footer {
    text-align: center;
    color: var(--text-soft);
    font-size: 0.85rem;
    margin-top: 40px;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    body { padding: 16px 14px 70px; }
    .card { padding: 24px 20px; }
    .card-content { flex-direction: column; }
    .side-img { max-width: 100%; margin: 0 auto; }
    header { padding: 44px 18px 38px; }
    #theme-toggle { top: 14px; right: 14px; }
}

/* ---------- Accessibilité : réduction des mouvements ---------- */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
    .card { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}