@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=DM+Serif+Display:ital@0;1&display=swap');

/* =========================================================
   ONBOARDING CSS - Seguindo padrão visual do site
   ========================================================= */
:root {
    --bg:        #07090f;
    --surface:   rgba(10, 13, 22, 0.88);
    --surface2:  #111722;
    --border:    rgba(255,255,255,0.07);
    --border2:   rgba(255,255,255,0.13);
    --accent:    #c8a84b;
    --accent2:   #e8c96a;
    --violet:    #a78bfa;
    --cyan:      #38bdf8;
    --green:     #67e8b4;
    --text:      #e2e6f0;
    --muted:     #9aa7bd;
    --radius:    16px;
    --radius-sm: 8px;
}

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

.onboarding-body {
    font-family: 'Outfit', sans-serif;
    height: 100dvh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 2vh, 18px);
    position: relative;
    overflow: hidden;
}

/* Sutil brilho de fundo */
.onboarding-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(200,168,75,0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(56,189,248,0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ==========================================
   CONTAINER
   ========================================== */
.onboarding-container {
    position: relative;
    z-index: 1;
    background: var(--surface);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border-radius: var(--radius);
    padding: clamp(18px, 3vh, 32px) clamp(18px, 4vw, 36px);
    max-width: 820px;
    width: 100%;
    height: min(760px, calc(100dvh - clamp(16px, 4vh, 36px)));
    overflow: hidden;
    border: 1px solid var(--border2);
    box-shadow:
        0 32px 80px rgba(0,0,0,0.5),
        0 0 0 1px rgba(200,168,75,0.06) inset;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.5s cubic-bezier(0.34,1.2,0.64,1);
}

/* Linha decorativa dourada no topo */
.onboarding-container::before {
    content: '';
    position: absolute;
    top: 0; left: 40px; right: 40px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--accent), transparent);
    border-radius: 1px;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(32px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Container scrollbar */
.onboarding-container::-webkit-scrollbar { width: 6px; }
.onboarding-container::-webkit-scrollbar-track { background: transparent; }
.onboarding-container::-webkit-scrollbar-thumb {
    background: rgba(200,168,75,0.25);
    border-radius: 3px;
}
.onboarding-container::-webkit-scrollbar-thumb:hover {
    background: rgba(200,168,75,0.4);
}

/* ==========================================
   HEADER
   ========================================== */
.onboarding-header {
    text-align: center;
    margin-bottom: clamp(12px, 2vh, 24px);
    position: relative;
    flex-shrink: 0;
}

.onboarding-logo {
    width: clamp(66px, 9vh, 96px);
    margin-bottom: clamp(8px, 1.6vh, 16px);
    filter: drop-shadow(0 4px 20px rgba(200,168,75,0.2));
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.onboarding-logo:hover { transform: scale(1.06); }

.onboarding-header h1 {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    font-weight: 400;
    color: #fff;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.onboarding-header p {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 300;
    line-height: 1.35;
    margin: 0;
}

/* Botão Sair */
.btn-exit-onboarding {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: 1px solid var(--border2);
    color: var(--muted);
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}
.btn-exit-onboarding:hover {
    color: #fca5a5;
    border-color: rgba(248,113,113,0.35);
    background: rgba(248,113,113,0.08);
}

/* ==========================================
   PROGRESS BAR
   ========================================== */
.onboarding-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 18px;
    padding: 0 20px;
    flex-shrink: 0;
}

.progress-step {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 2px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    transition: all 0.3s;
    flex-shrink: 0;
}
.progress-step.active {
    background: rgba(200,168,75,0.15);
    border-color: var(--accent);
    color: var(--accent2);
}
.progress-step.done {
    background: var(--accent);
    border-color: var(--accent);
    color: #0a0c12;
}

.progress-line {
    height: 2px;
    width: min(54px, 8vw);
    background: var(--border2);
    transition: background 0.3s;
}
.progress-line.active,
.progress-line.done {
    background: var(--accent);
}
.progress-step.current {
    box-shadow: 0 0 0 4px rgba(200,168,75,0.15);
}

.progress-label {
    text-align: center;
    font-size: 0.78rem;
    color: var(--muted);
    margin: -10px 0 14px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

/* ==========================================
   STEP ICONS
   ========================================== */
.step-icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.step-icon {
    width: 42px; height: 42px;
    border-radius: 14px;
    background: rgba(200,168,75,0.1);
    border: 1px solid rgba(200,168,75,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent2);
    font-size: 1.1rem;
}
.step-icon-cyan {
    background: rgba(56,189,248,0.1);
    border-color: rgba(56,189,248,0.2);
    color: var(--cyan);
}
.step-icon-violet {
    background: rgba(167,139,250,0.1);
    border-color: rgba(167,139,250,0.2);
    color: var(--violet);
}
.step-icon-green {
    background: rgba(103,232,180,0.1);
    border-color: rgba(103,232,180,0.2);
    color: var(--green);
}
.step-icon-pink {
    background: rgba(244,114,182,0.1);
    border-color: rgba(244,114,182,0.2);
    color: #f472b6;
}

/* Success icon */
.success-icon-wrap {
    margin-bottom: 12px;
}
.success-icon-wrap i {
    font-size: 3.5rem;
    color: var(--accent2);
    filter: drop-shadow(0 4px 16px rgba(200,168,75,0.3));
}

/* ==========================================
   STEPS
   ========================================== */
.onboarding-step {
    animation: fadeIn 0.35s cubic-bezier(0.34,1.2,0.64,1);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.onboarding-step.hidden {
    display: none !important;
}

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

.onboarding-step h2 {
    font-family: 'DM Serif Display', serif;
    color: #fff;
    font-size: 1.22rem;
    font-weight: 400;
    margin: 0 0 14px;
    text-align: center;
    letter-spacing: -0.01em;
    flex-shrink: 0;
}

.step-hint {
    color: var(--muted);
    font-size: 0.88rem;
    text-align: center;
    margin: -8px 0 14px;
    font-weight: 300;
    flex-shrink: 0;
}

/* ==========================================
   GÊNEROS
   ========================================== */
.genres-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
    flex: 1;
    min-height: 0;
    align-content: start;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(200,168,75,0.2) transparent;
}

.genre-chip {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border2);
    border-radius: 50px;
    padding: 9px 14px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.genre-chip:hover {
    background: rgba(200,168,75,0.08);
    border-color: rgba(200,168,75,0.25);
    transform: translateY(-1px);
}

.genre-chip.selected {
    background: rgba(200,168,75,0.15);
    border-color: var(--accent);
    color: var(--accent2);
    box-shadow: 0 4px 18px rgba(200,168,75,0.2);
}

.genre-chip i {
    margin-right: 6px;
    opacity: 0.6;
}

.genre-chip.selected i {
    opacity: 1;
}

/* ==========================================
   BUSCA DE FILMES
   ========================================== */
.movies-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.movies-search:focus-within {
    background: rgba(255,255,255,0.07);
    border-color: rgba(200,168,75,0.35);
    box-shadow: 0 0 0 3px rgba(200,168,75,0.08);
}

.movies-search i {
    color: var(--muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.movies-search input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-size: 0.92rem;
    outline: none;
}

.movies-search input::placeholder {
    color: rgba(90,100,128,0.7);
}

/* ==========================================
   GRID DE FILMES
   ========================================== */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    align-items: start;
    gap: 12px;
    margin-bottom: 12px;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 2px 6px 10px 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(200,168,75,0.2) transparent;
}

.movie-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    align-self: start;
}

.movie-card:hover {
    transform: scale(1.04) translateY(-2px);
    border-color: var(--border2);
    box-shadow: 0 8px 28px rgba(0,0,0,0.4);
}

.movie-card:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

.movie-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 6px 24px rgba(200,168,75,0.25);
}

.movie-card.selected::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: var(--accent);
    color: #0a0c12;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(200,168,75,0.4);
}

.movie-card img {
    width: 100%;
    aspect-ratio: 2/3;
    height: auto;
    object-fit: contain;
    background: #05070c;
    display: block;
    flex-shrink: 0;
}

.movie-card-info {
    padding: 7px 9px;
    min-height: 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.movie-card-title {
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.onboarding-container.is-title-step .onboarding-header {
    margin-bottom: 8px;
}

.onboarding-container.is-title-step .onboarding-logo {
    width: 52px;
    margin-bottom: 4px;
}

.onboarding-container.is-title-step .onboarding-header h1 {
    font-size: 1.22rem;
    margin-bottom: 0;
}

.onboarding-container.is-title-step .onboarding-header p,
.onboarding-container.is-title-step #step2 .step-icon-wrap,
.onboarding-container.is-title-step #step2 .step-hint {
    display: none;
}

.onboarding-container.is-title-step .onboarding-progress {
    margin-bottom: 10px;
}

.onboarding-container.is-title-step .progress-label {
    margin: -6px 0 10px;
}

.onboarding-container.is-title-step #step2 h2 {
    font-size: 1.12rem;
    margin-bottom: 9px;
}

.onboarding-container.is-title-step #step2 .movies-search {
    margin-bottom: 10px;
}

.movies-empty {
    grid-column: 1 / -1;
    min-height: 180px;
    border: 1px dashed rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    padding: 24px;
}

.movies-empty i {
    color: var(--accent2);
    font-size: 1.2rem;
}

/* ==========================================
   CONTADOR DE SELEÇÃO
   ========================================== */
.selected-count {
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 14px;
    font-weight: 400;
    flex-shrink: 0;
}

.selected-count span {
    color: var(--accent2);
    font-weight: 700;
    font-size: 1.15rem;
}

/* ==========================================
   BOTÕES
   ========================================== */
.buttons-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.btn-primary, .btn-secondary {
    padding: 11px 26px;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.onboarding-step > .btn-primary {
    align-self: center;
    flex-shrink: 0;
}

/* Shimmer no hover */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.btn-primary:hover:not(:disabled)::before { left: 100%; }

.btn-primary {
    background: var(--accent);
    color: #0a0c12;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent2);
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(200,168,75,0.4);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border2);
    text-transform: none;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.btn-secondary:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
}

/* ==========================================
   LOADING
   ========================================== */
.loading {
    text-align: center;
    padding: 48px 20px;
}
.loading.hidden { display: none; }

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.loading p {
    color: var(--muted);
    font-size: 0.92rem;
}

/* ==========================================
   SUCESSO
   ========================================== */
.success {
    text-align: center;
    padding: 48px 20px;
    flex: 1;
    min-height: 0;
    align-items: center;
    justify-content: center;
}

.success.hidden {
    display: none;
}

.success i {
    font-size: 3.5rem;
    color: var(--accent2);
    margin-bottom: 18px;
    filter: drop-shadow(0 4px 16px rgba(200,168,75,0.3));
}

.success h2 {
    font-family: 'DM Serif Display', serif;
    color: #fff;
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 10px;
}

.success p {
    color: var(--muted);
    margin-bottom: 32px;
    font-size: 0.95rem;
}

/* ==========================================
   TOAST
   ========================================== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface2);
    border: 1px solid var(--border2);
    color: var(--text);
    padding: 12px 24px;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.toast.show {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================
   SCROLLBAR (grid de filmes)
   ========================================== */
.movies-grid::-webkit-scrollbar { width: 5px; }
.movies-grid::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}
.movies-grid::-webkit-scrollbar-thumb {
    background: rgba(200,168,75,0.2);
    border-radius: 3px;
}
.movies-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(200,168,75,0.35);
}

/* ==========================================
   RESPONSIVO
   ========================================== */
@media (max-width: 600px) {
    .onboarding-body { padding: 8px; }

    .onboarding-container {
        padding: 18px 14px;
        height: calc(100dvh - 16px);
    }

    .onboarding-header h1 {
        font-size: 1.4rem;
    }

    .genres-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .buttons-row {
        flex-direction: column;
        align-items: stretch;
    }

    #step2 .buttons-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    #finishOnboarding {
        grid-column: 1 / -1;
    }

    .btn-primary, .btn-secondary {
        justify-content: center;
    }

    .btn-exit-onboarding {
        position: static;
        margin: 0 auto 16px;
        display: block;
    }

    .media-types-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── Media Type Cards (Step 0) ─────────────────────── */
.media-types-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 14px 0;
}
.media-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 12px;
    border-radius: 16px;
    border: 2px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    cursor: pointer;
    transition: all .25s;
    color: #94a3b8;
    font-size: 0.95rem;
    font-weight: 500;
}
.media-type-card i {
    font-size: 1.7rem;
    transition: all .25s;
}
.media-type-card:hover {
    border-color: rgba(200,168,75,.3);
    background: rgba(200,168,75,.05);
    color: #e2e8f0;
}
.media-type-card.selected {
    border-color: #c8a84b;
    background: rgba(200,168,75,.12);
    color: #c8a84b;
    box-shadow: 0 0 20px rgba(200,168,75,.15);
}
.media-type-card.selected i {
    color: #c8a84b;
    transform: scale(1.15);
}

@media (max-width: 600px) {
    .media-types-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .media-type-card {
        padding: 14px 10px;
        gap: 8px;
        font-size: 0.84rem;
    }

    .media-type-card i {
        font-size: 1.45rem;
    }
}

@media (max-height: 700px) {
    .onboarding-header {
        margin-bottom: 10px;
    }

    .onboarding-logo {
        width: 58px;
        margin-bottom: 6px;
    }

    .onboarding-header p {
        display: none;
    }

    .onboarding-progress {
        margin-bottom: 12px;
    }

    .progress-label {
        margin-bottom: 10px;
    }

    .step-icon-wrap {
        margin-bottom: 7px;
    }

    .step-icon {
        width: 36px;
        height: 36px;
        border-radius: 11px;
    }

    .onboarding-step h2 {
        margin-bottom: 10px;
    }

    .step-hint {
        margin-bottom: 10px;
    }

    #step2 .step-icon-wrap,
    #step2 .step-hint {
        display: none;
    }

    #step2 h2 {
        font-size: 1.08rem;
        margin-bottom: 8px;
    }

    .genre-chip {
        padding: 8px 12px;
        font-size: 0.82rem;
    }
}

@media (max-height: 520px) {
    .onboarding-body {
        padding: 6px;
    }

    .onboarding-container {
        height: calc(100dvh - 20px);
        padding: 10px 14px;
        border-radius: 12px;
    }

    .onboarding-header {
        margin-bottom: 6px;
    }

    .onboarding-logo {
        display: none;
    }

    .onboarding-header h1 {
        font-size: 1.05rem;
        margin-bottom: 0;
    }

    .btn-exit-onboarding {
        position: absolute;
        top: 0;
        right: 0;
        margin: 0;
        padding: 4px 10px;
        font-size: 0.68rem;
    }

    .onboarding-progress {
        margin: 4px 0 8px;
        padding: 0 10px;
    }

    .progress-step {
        width: 24px;
        height: 24px;
        font-size: 0.66rem;
    }

    .progress-line {
        width: min(46px, 8vw);
    }

    .progress-label,
    .step-icon-wrap,
    .step-hint {
        display: none;
    }

    .onboarding-step h2 {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .genres-grid {
        grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
        gap: 7px;
        margin-bottom: 8px;
    }

    .genre-chip {
        padding: 7px 10px;
        font-size: 0.76rem;
    }

    .movies-search {
        padding: 8px 12px;
        margin-bottom: 8px;
    }

    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
        grid-auto-rows: max-content;
        gap: 8px;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .movie-card-info {
        display: none;
    }

    .selected-count {
        margin-bottom: 8px;
        font-size: 0.78rem;
    }

    .selected-count span {
        font-size: 0.98rem;
    }

    .buttons-row {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 9px 16px;
        font-size: 0.76rem;
        min-height: 38px;
        justify-content: center;
    }

    .media-types-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin: 8px 0;
    }

    .media-type-card {
        padding: 10px 8px;
        gap: 6px;
        border-radius: 12px;
        font-size: 0.72rem;
    }

    .media-type-card i {
        font-size: 1.18rem;
    }
}

/* O onboarding pode abrir sem base.css; declara a sua paleta clara completa. */
:is(html.light-theme-early, body.light-theme) {
    color-scheme: light;
    --bg: #f4f1ea;
    --surface: #fff;
    --surface2: #f8f7f3;
    --border: rgba(30, 41, 59, 0.13);
    --border2: rgba(30, 41, 59, 0.2);
    --text: #1e293b;
    --muted: #586577;
    --violet: #7050b5;
    --cyan: #126b82;
    --green: #1b6e47;
}
:is(html.light-theme-early, body.light-theme) .onboarding-container {
    background: #fff;
    box-shadow: 0 24px 70px rgba(30, 41, 59, 0.12);
}
:is(html.light-theme-early, body.light-theme) :is(.onboarding-header h1, .onboarding-step h2, .success h2) { color: var(--text); }
:is(html.light-theme-early, body.light-theme) :is(.genre-chip, .movies-search, .movie-card, .media-type-card) {
    background: var(--surface2);
    border-color: var(--border2);
    color: var(--text);
}
:is(html.light-theme-early, body.light-theme) :is(.genre-chip.selected, .media-type-card.selected) {
    color: #806018;
    background: #f9f0d8;
    border-color: #9c7726;
}
:is(html.light-theme-early, body.light-theme) :is(.genre-chip.selected i, .media-type-card.selected i, .step-icon, .selected-count span, .success i, .success-icon-wrap i) { color: #806018; }
:is(html.light-theme-early, body.light-theme) .step-icon-cyan { color: var(--cyan); }
:is(html.light-theme-early, body.light-theme) .step-icon-violet { color: var(--violet); }
:is(html.light-theme-early, body.light-theme) .step-icon-green { color: var(--green); }
:is(html.light-theme-early, body.light-theme) .step-icon-pink { color: #b52f70; }
:is(html.light-theme-early, body.light-theme) .media-type-card:hover { background: #f7efdc; color: #806018; border-color: #9c7726; }
:is(html.light-theme-early, body.light-theme) .movies-search:focus-within { background: #fff; border-color: #8a681d; }
:is(html.light-theme-early, body.light-theme) .movies-search input::placeholder { color: var(--muted); }
:is(html.light-theme-early, body.light-theme) .movie-card:hover { box-shadow: 0 8px 24px rgba(30, 41, 59, 0.14); }
:is(html.light-theme-early, body.light-theme) .movie-card img { background: #e5e8ed; }
:is(html.light-theme-early, body.light-theme) .movies-empty { border-color: var(--border2); }
:is(html.light-theme-early, body.light-theme) .progress-step { background: #edf0f3; }
:is(html.light-theme-early, body.light-theme) .progress-step.active { color: #806018; background: #f9f0d8; }
:is(html.light-theme-early, body.light-theme) .progress-step.done { color: #0a0c12; background: #d6b75c; }
:is(html.light-theme-early, body.light-theme) .btn-secondary:hover { background: #edf0f3; border-color: #8993a1; }
:is(html.light-theme-early, body.light-theme) .btn-exit-onboarding:hover { color: #ad2938; }
:is(html.light-theme-early, body.light-theme) .toast { box-shadow: 0 8px 28px rgba(30, 41, 59, 0.14); }

/* O documento rola por inteiro, inclusive em telas baixas e com zoom. */
.onboarding-body { height: auto; overflow: auto; margin: 0; }
.onboarding-container { height: auto; min-height: min(680px, 90dvh); overflow: visible; }
.onboarding-step { flex: none; gap: 8px; }
.onboarding-container .step-hint,
.onboarding-container.is-title-step #step2 .step-hint { display: block; line-height: 1.45; }
.onboarding-container .progress-label { display: block; }
.onboarding-step h2:focus, .success h2:focus { outline: none; }
.media-types-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.media-type-card { font-family: inherit; min-height: 100px; }
.type-switcher { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.genres-grid { flex: none; overflow: visible; min-height: 120px; }
.movies-grid { flex: none; max-height: 340px; min-height: 120px; }
.movie-card { color: var(--text); font: inherit; padding: 0; text-align: left; text-decoration: none; }
.movie-card-info { display: flex; flex-direction: column; gap: 4px; }
.movie-card-info small { font-size: 0.75rem; line-height: 1.4; }
.movie-card-title { display: block; }
.selected-titles { display: flex; flex-wrap: wrap; gap: 6px; max-height: 120px; overflow-y: auto; }
.selected-titles .genre-chip { font-size: 0.8rem; padding: 6px 10px; }
.buttons-row { flex-wrap: wrap; margin-top: 12px; }
.btn-primary, .btn-secondary, .genre-chip, .btn-exit-onboarding { min-height: 44px; }
.btn-primary { text-decoration: none; }
.onboarding-body :is(button, a, input):focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.success { padding: 8px 0; }
.success p { line-height: 1.5; margin-bottom: 16px; }
.success .movies-grid { max-height: none; overflow: visible; }
.success > .btn-primary { margin-bottom: 20px; }
.resume-link { color: var(--text); text-underline-offset: 3px; }
.success .btn-secondary { margin: 8px; }
.catalog-status { color: var(--muted); margin: 0 0 8px; font-size: 0.85rem; }
.recovery-message { color: var(--text); padding: 12px; border: 1px solid var(--accent); border-radius: 8px; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
.toast { max-width: calc(100vw - 24px); border-radius: 12px; }
@media (max-width: 600px) {
    .onboarding-container { min-height: 0; height: auto; }
    .media-types-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .media-type-card { font-size: 0.9rem; padding: 14px 8px; min-height: 84px; }
    .media-type-card:last-child { grid-column: 1 / -1; }
    .buttons-row { flex-direction: column; align-items: stretch; flex-wrap: wrap; }
    #step2 .buttons-row { display: flex; }
    .movies-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .movie-card-info { display: flex; }
    .onboarding-container.is-title-step .onboarding-header p { display: block; }
    .success h2 { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
    .onboarding-body *, .onboarding-body *::before { animation: none !important; transition: none !important; }
}

