/* ============================================================
   AISMARTVIDEO APP — Mobile-first, Clean, Light
   ============================================================ */

/* ============================================
   RESET & VARIABLES — TEMA LIGHT (default)
   ============================================ */
:root {
    --bg:           #F0F1F5;
    --bg-card:      #FFFFFF;
    --card-border:  1px solid rgba(0,0,0,0.06);
    --primary:      #6C5CE7;
    --primary-light:#A29BFE;
    --primary-dark: #5A4BD1;
    --success:      #00D2A0;
    --success-light:#E8FBF5;
    --warning:      #FDCB6E;
    --warning-light:#FFF9E6;
    --danger:       #FF6B6B;
    --danger-light: #FFE8E8;
    --text:         #2D3436;
    --text-light:   #A0A4B8;
    --text-medium:  #636E72;
    --border:       #E8ECF1;
    --sidebar-bg:   #FFFFFF;
    --sidebar-text: #636E72;
    --sidebar-active:#6C5CE7;
    --shadow-sm:    0 1px 3px rgba(0,0,0,0.06);
    --shadow-md:    0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg:    0 8px 24px rgba(0,0,0,0.12);
    --radius-sm:    8px;
    --radius-md:    12px;
    --radius-lg:    16px;
    --radius-xl:    20px;
    --font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --bottom-nav-h: 64px;
    --sidebar-w:    60px;
    --sidebar-w-open: 250px;
    --transition:   0.2s ease;
}

/* ============================================
   TEMA DARK
   ============================================ */
[data-theme="dark"] {
    --bg:            #0F1117;
    --bg-card:       #1A1D26;
    --card-border:   1px solid rgba(255,255,255,0.06);
    --primary:       #7C6CF0;
    --primary-light: #A29BFE;
    --primary-dark:  #5A4BD1;
    --success:       #00D2A0;
    --success-light: rgba(0,210,160,0.12);
    --warning:       #FDCB6E;
    --warning-light: rgba(253,203,110,0.12);
    --danger:        #FF6B6B;
    --danger-light:  rgba(255,107,107,0.12);
    --text:          #E8EAED;
    --text-light:    #A0A4B8;
    --text-medium:   #A0A4B8;
    --border:        #2A2E3A;
    --sidebar-bg:    #1A1D26;
    --sidebar-text:  #A0A4B8;
    --sidebar-active:#7C6CF0;
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.4);
    --shadow-md:     0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg:     0 8px 24px rgba(0,0,0,0.6);
}

/* Transição suave ao trocar tema */
body, .card, .sidebar, .bottom-nav, .form-input, .form-textarea, .form-select, .btn {
    transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

/* Botão toggle de tema na sidebar */
.sidebar-theme-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: 4px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sidebar-text);
    transition: background var(--transition), color var(--transition);
}
.sidebar-theme-btn:hover {
    background: rgba(108,92,231,0.10);
    color: var(--primary);
}
.sidebar-theme-btn svg {
    opacity: 0.8;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14.5px; /* base reduzida (~90% de 16px) */
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100dvh;
    overflow-x: hidden;
    font-size: 1rem;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }

.text-light { color: var(--text-light); }
.text-medium { color: var(--text-medium); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }

/* ============================================
   SIDEBAR (desktop only)
   ============================================ */
.sidebar {
    display: none; /* hidden on mobile */
    position: fixed;
    left: 12px;
    top: 12px;
    bottom: 12px;
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    z-index: 100;
    flex-direction: column;
    transition: width var(--transition);
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.sidebar.expanded {
    width: var(--sidebar-w-open);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    white-space: nowrap;
}

.sidebar-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-width: 28px;
    color: var(--primary);
}

.sidebar-logo-text {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar.expanded .sidebar-logo-text {
    opacity: 1;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    font-size: 13px;
}

.sidebar-link:hover {
    color: var(--text);
    background: rgba(0,0,0,0.04);
}

.sidebar-link.active {
    color: var(--primary);
    background: rgba(108, 92, 231, 0.08);
    border-left-color: var(--primary);
}

.sidebar-link i,
.sidebar-link svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
}

.sidebar-link span {
    opacity: 0;
    transition: opacity var(--transition);
    font-size: 0.9rem;
}
.sidebar-link .model-icon-emoji {
    opacity: 1;
    font-size: 16px;
}

.sidebar.expanded .sidebar-link span {
    opacity: 1;
}

.sidebar-dashboard {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.sidebar-footer {
    padding: 12px 0;
    border-top: 1px solid rgba(0,0,0,0.06);
}

/* ============================================
   BOTTOM NAV (mobile)
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-h);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.65rem;
    font-weight: 500;
    padding: 8px 12px;
    transition: color var(--transition);
}

.bottom-nav-item svg,
.bottom-nav-item i {
    width: 22px;
    height: 22px;
}

.bottom-nav-item.active {
    color: var(--primary);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    padding-bottom: calc(var(--bottom-nav-h) + 16px);
}

.page-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 14px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.card + .card {
    margin-top: 12px;
}

.card-highlight {
    border-left: 4px solid var(--primary);
}

.card-success {
    background: var(--success-light);
    border-color: var(--success);
}

.card-warning {
    background: var(--warning-light);
    border-color: var(--warning);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #FFF;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

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

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

.btn-success {
    background: var(--success);
    color: #FFF;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* ============================================
   ALTURA ÚNICA DOS BOTÕES DE AÇÃO  (referência: Voltar/Continuar do wizard)
   Fonte única — muda só --btn-h e TODOS acompanham. Padroniza apenas a ALTURA;
   cor, largura e corpo de cada botão permanecem. CTAs especiais (.btn-lg) ficam de fora.
   ============================================ */
:root { --btn-h: 40px; }
.btn:not(.btn-lg),
.ec-btn-primary,
.ef-btn-primary {
    height: var(--btn-h);
    min-height: var(--btn-h);
    padding-block: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Cabeçalho de produção (Custos / Investimento / Recomeçar): altura fininha
   que acompanha o texto — NÃO entra no --btn-h. Só a cor muda por modificador. */
.btn-prod-head {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    padding: .4rem .9rem;
    font-size: .78rem;
    font-weight: 600;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.btn-prod-head.is-laranja { color: #f59e0b; }
.btn-prod-head.is-verde   { color: #22c55e; }
.btn-prod-head.is-laranja:hover { background: rgba(245,158,11,.12); }
.btn-prod-head.is-verde:hover   { background: rgba(34,197,94,.12); }

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 5px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.92rem;
    color: var(--text);
    background: var(--bg-card);
    transition: border-color var(--transition);
    outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--primary);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ============================================
   SELECT CARDS (opcoes clicaveis)
   ============================================ */
.select-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.select-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    background: var(--bg-card);
}

.select-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.select-card.selected {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.05);
}

.select-card-icon {
    font-size: 1.5rem;
}

.select-card-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.select-card-sub {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ============================================
   PROGRESS BAR (wizard steps)
   ============================================ */
.wizard-progress {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 24px;
}

.wizard-step {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    transition: background var(--transition);
}

.wizard-step.done {
    background: var(--primary);
}

.wizard-step.current {
    background: var(--primary-light);
}

.wizard-info {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success { background: var(--success-light); color: #00A67E; }
.badge-warning { background: var(--warning-light); color: #E17D00; }
.badge-danger  { background: var(--danger-light);  color: #E04040; }
.badge-primary { background: rgba(108,92,231,0.1); color: var(--primary); }

/* ============================================
   TIMELINE
   ============================================ */
.timeline {
    padding-left: 20px;
    border-left: 2px solid var(--border);
}

.timeline-item {
    position: relative;
    padding: 0 0 20px 16px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--bg);
}

.timeline-item.done::before {
    background: var(--success);
}

.timeline-item.current::before {
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(108,92,231,0.2);
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--text-light);
}

.timeline-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================
   CREDIT DISPLAY
   ============================================ */
.credit-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    color: #FFF;
}

.credit-amount {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.credit-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ============================================
   DRAWER (lateral/overlay)
   ============================================ */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.drawer-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.drawer {
    position: fixed;
    right: -100%;
    top: 0;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    background: var(--bg);
    z-index: 201;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.drawer.open {
    right: 0;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 1;
}

.drawer-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
}

.drawer-content {
    padding: 20px;
}

/* ============================================
   GREETING
   ============================================ */
.greeting {
    margin-bottom: 20px;
}

.greeting h1 {
    font-size: 1.4rem;
}

.greeting-wave {
    display: inline-block;
    animation: wave 1.5s ease-in-out;
}

@keyframes wave {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(20deg); }
    50% { transform: rotate(-10deg); }
    75% { transform: rotate(15deg); }
}

/* ============================================
   ORDER LIST ITEM
   ============================================ */
.order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
}

.order-item:hover {
    box-shadow: var(--shadow-sm);
}

.order-item + .order-item {
    margin-top: 8px;
}

.order-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.order-info {
    flex: 1;
    min-width: 0;
}

.order-title {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-meta {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state-text {
    font-size: 0.95rem;
    margin-bottom: 16px;
}

/* ============================================
   UTILITIES
   ============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 16px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.p-md { padding: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ============================================
   DESKTOP (768px+)
   ============================================ */
@media (min-width: 768px) {
    .sidebar {
        display: flex;
    }

    .bottom-nav {
        display: none;
    }

    .main-content {
        margin: 12px 12px 12px calc(var(--sidebar-w) + 24px);
        padding-bottom: 16px;
        background:
            radial-gradient(ellipse 800px 400px at 80% 0%, rgba(108,92,231,0.08) 0%, transparent 60%),
            radial-gradient(ellipse 600px 400px at 0% 100%, rgba(255,107,53,0.05) 0%, transparent 60%),
            var(--bg);
        border-radius: 24px;
        border: 1px solid var(--border);
        box-shadow: var(--shadow-sm);
        transition: margin-left var(--transition), background-color var(--transition), border-color var(--transition);
        min-height: calc(100vh - 24px);
        position: relative;
    }
    [data-theme="dark"] .main-content {
        background:
            radial-gradient(ellipse 800px 400px at 80% 0%, rgba(124,108,240,0.12) 0%, transparent 60%),
            radial-gradient(ellipse 600px 400px at 0% 100%, rgba(255,107,53,0.08) 0%, transparent 60%),
            var(--bg);
    }

    .sidebar.expanded ~ .main-content {
        margin-left: calc(var(--sidebar-w-open) + 24px);
    }

    .page-container {
        max-width: 100%;
        padding: 20px 26px;
    }
}

/* ============================================================
   SIDEBAR REFORMADO — Modelos IA + Toggle
   ============================================================ */
.sidebar-toggle-btn {
    background: none;
    border: none;
    color: var(--sidebar-text);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
    opacity: 1;
    transition: opacity 0.2s;
}

.sidebar-section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--sidebar-text);
    opacity: 0.5;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-section-label i,
.sidebar-section-label svg {
    width: 18px;
    height: 18px;
    min-width: 18px;
}
.sidebar-section-label span { opacity: 0; transition: opacity 0.2s; }
.sidebar.expanded .sidebar-section-label span { opacity: 1; }

.sidebar-model {
    position: relative;
}
.model-icon-emoji {
    font-size: 16px;
    width: 24px;
    min-width: 24px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}
.model-badge {
    font-size: 8px !important;
    font-weight: 700 !important;
    padding: 0 4px !important;
    border-radius: 3px !important;
    text-transform: uppercase;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
    line-height: 1 !important;
    letter-spacing: 0.4px;
    height: 13px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar.expanded .model-badge { opacity: 1; }

/* NEW — Gradient roxo→rosa com glow */
.badge-new {
    background: linear-gradient(135deg, #6C5CE7 0%, #FD79A8 100%);
    color: #fff;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.18) inset,
        0 0 8px rgba(253,121,168,0.55),
        0 1px 3px rgba(0,0,0,0.20);
}

/* HOT — Gradient vermelho→laranja com glow forte + pulse */
.badge-hot {
    background: linear-gradient(135deg, #FF4757 0%, #FF7F50 100%);
    color: #fff;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.20) inset,
        0 0 10px rgba(255,71,87,0.70),
        0 1px 3px rgba(0,0,0,0.20);
    animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
    0%, 100% {
        box-shadow:
            0 0 0 1px rgba(255,255,255,0.20) inset,
            0 0 10px rgba(255,71,87,0.70),
            0 1px 3px rgba(0,0,0,0.20);
    }
    50% {
        box-shadow:
            0 0 0 1px rgba(255,255,255,0.30) inset,
            0 0 18px rgba(255,71,87,1.00),
            0 1px 3px rgba(0,0,0,0.20);
    }
}

/* PRO — Gradient dourado com glow */
.badge-pro {
    background: linear-gradient(135deg, #F39C12 0%, #FFD700 100%);
    color: #5A3E00;
    text-shadow: 0 1px 0 rgba(255,255,255,0.40);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.30) inset,
        0 0 8px rgba(255,215,0,0.65),
        0 1px 3px rgba(0,0,0,0.18);
}

/* SOON — Cinza suave (placeholder) */
.badge-soon {
    background: linear-gradient(135deg, #95A5A6 0%, #BDC3C7 100%);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* Wild — extra (caso use) */
.badge-wild {
    background: linear-gradient(135deg, #00D2A0 0%, #1ABC9C 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,210,160,0.40);
}

/* ============================================================
   MICROANIMACOES — Fade-in, hover lift, smooth scroll, etc.
   ============================================================ */

/* Smooth scroll global */
html {
    scroll-behavior: smooth;
}

/* Reduzir motion pra quem prefere */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Fade + slide-up na entrada da página (aplicado pelo JS via .page-enter) */
.page-container > * {
    animation: fadeSlideUp 0.4s ease-out backwards;
}
.page-container > *:nth-child(1) { animation-delay: 0.00s; }
.page-container > *:nth-child(2) { animation-delay: 0.05s; }
.page-container > *:nth-child(3) { animation-delay: 0.10s; }
.page-container > *:nth-child(4) { animation-delay: 0.15s; }
.page-container > *:nth-child(5) { animation-delay: 0.20s; }

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

/* Hover lift nos cards clicáveis */
.order-item,
.home-quick-card,
.home-plan-card,
.home-duration-card,
.select-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.order-item:hover,
.select-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

/* Click feedback (active state) */
.btn:active,
.app-action-cta:active,
.app-action-credits:active,
.app-action-icon:active,
.promo-cta:active,
.home-duration-card:active,
.select-card:active {
    transform: scale(0.97);
    transition: transform 0.08s ease;
}

/* Slide sutil no hover do link da sidebar */
.sidebar-link {
    transition: padding-left 0.2s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sidebar.expanded .sidebar-link:hover {
    padding-left: 22px;
}

/* Pulse no ícone do hero (sutil) */
.home-hero-icon {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.home-hero-icon:hover {
    transform: scale(1.05) rotate(-3deg);
    box-shadow: 0 12px 32px rgba(108,92,231,0.45);
}

/* Brilho que passa no CTA principal */
.app-action-cta,
.promo-cta {
    position: relative;
    overflow: hidden;
}
.app-action-cta::before,
.promo-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.30) 50%,
        transparent 100%);
    transition: left 0.6s ease;
    pointer-events: none;
}
.app-action-cta:hover::before,
.promo-cta:hover::before {
    left: 130%;
}

/* Fade nas mudanças de tema */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Spinner de loading reutilizável */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Shimmer loading (placeholder) */
.shimmer {
    background: linear-gradient(90deg,
        var(--border) 0%,
        var(--bg-card) 50%,
        var(--border) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

.sidebar-models-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 8px;
}
.sidebar-models-nav::-webkit-scrollbar { width: 3px; }
.sidebar-models-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Inverter SVGs pretos no dark (icone do toggle sidebar) */
[data-theme="dark"] #sidebarToggleIcon {
    filter: invert(1) brightness(1.2);
}

/* ============================================================
   SIDEBAR SECTIONS — Categorias colapsaveis (VIDEO IA / IMAGEM / etc)
   ============================================================ */
.sidebar-section {
    border-bottom: 1px solid var(--border);
}
.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: transparent;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-medium);
    text-align: left;
    transition: color 0.15s, background 0.15s;
}
.sidebar-section-header:hover {
    color: var(--primary);
    background: rgba(108,92,231,0.04);
}
.sidebar-section-header > i:first-child,
.sidebar-section-header > svg:first-child {
    width: 18px;
    height: 18px;
    min-width: 18px;
    color: var(--primary);
    opacity: 0.85;
}
.sidebar-section-header > span {
    flex: 1;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar.expanded .sidebar-section-header > span {
    opacity: 1;
}

.sidebar-section-arrow {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    transition: transform 0.25s ease;
    opacity: 0;
}
.sidebar.expanded .sidebar-section-arrow {
    opacity: 0.6;
}
.sidebar-section.open .sidebar-section-arrow {
    transform: rotate(180deg);
}

.sidebar-section-content {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
    padding-bottom: 6px;
}
.sidebar-section.open .sidebar-section-content {
    max-height: 800px;
}

/* No sidebar colapsado, esconde headers e mostra só os ícones dos models */
.sidebar:not(.expanded) .sidebar-section-header {
    padding: 6px 0;
    justify-content: center;
}
.sidebar:not(.expanded) .sidebar-section-header > span,
.sidebar:not(.expanded) .sidebar-section-arrow {
    display: none;
}
.sidebar:not(.expanded) .sidebar-section-content {
    max-height: none !important;
    overflow: visible;
}

/* Estado disabled (em breve) */
.sidebar-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.badge-soon {
    background: var(--text-light);
    color: #fff;
}

/* ============================================================
   APP HEADER — Nav horizontal + Acoes (premium)
   ============================================================ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 22px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    border-radius: 24px 24px 0 0;
    backdrop-filter: blur(8px);
}

[data-theme="dark"] .app-header {
    background: rgba(26,29,38,0.92);
}

/* Nav esquerda */
.app-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.app-nav-link {
    color: var(--text-medium);
    font-size: 13px;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 7px;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.app-nav-link:hover {
    color: var(--text);
    background: rgba(108,92,231,0.06);
}
.app-nav-link.active {
    color: var(--primary);
    font-weight: 600;
    background: rgba(108,92,231,0.10);
}

/* Chip de modelo — atalho destacado pro passo-a-passo */
.app-nav-model {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 8px !important;
    background: linear-gradient(135deg, rgba(108,92,231,0.12) 0%, rgba(253,121,168,0.10) 100%) !important;
    border: 1px solid rgba(108,92,231,0.25);
    color: var(--primary) !important;
    font-weight: 600 !important;
    border-radius: 999px !important;
    transition: all 0.18s ease;
}
.app-nav-model:hover {
    background: linear-gradient(135deg, rgba(108,92,231,0.20) 0%, rgba(253,121,168,0.16) 100%) !important;
    border-color: rgba(108,92,231,0.45);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108,92,231,0.20);
}
.app-nav-model-icon {
    font-size: 14px;
    line-height: 1;
}
.app-nav-model-text {
    line-height: 1;
}
.app-nav-model-arrow {
    width: 13px !important;
    height: 13px !important;
    margin-left: 2px;
    opacity: 0.7;
    transition: transform 0.18s ease, opacity 0.18s ease;
}
.app-nav-model:hover .app-nav-model-arrow {
    opacity: 1;
    transform: translateX(2px);
}

/* Acoes direita */
.app-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-action-credits {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    background: rgba(108,92,231,0.08);
    color: var(--primary);
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 7px;
    text-decoration: none;
    transition: all 0.15s;
}
.app-action-credits:hover {
    background: rgba(108,92,231,0.16);
}
.app-action-credits svg {
    width: 15px;
    height: 15px;
}

.app-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-medium);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.app-action-icon:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(108,92,231,0.06);
}
.app-action-icon svg {
    width: 16px;
    height: 16px;
}

/* CTA — gradient laranja chamativo */
.app-action-cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 7px;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(255,107,53,0.30);
    transition: all 0.15s;
    white-space: nowrap;
}
.app-action-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255,107,53,0.45);
}
.app-action-cta svg {
    width: 16px;
    height: 16px;
}

/* Mobile: esconde nav e textos longos */
@media (max-width: 900px) {
    .app-header { padding: 10px 14px; gap: 8px; }
    .app-nav { display: none; }
    .app-action-credits span { display: none; }
    .app-action-credits { padding: 8px 10px; }
    .app-action-cta { padding: 8px 12px; font-size: 12px; }
}

/* ============================================================
   PROMO TOPBAR — Countdown + Oferta + CTA
   ============================================================ */
.promo-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 44px;
    background: linear-gradient(90deg, #1A1D26 0%, #2D1B4E 50%, #1A1D26 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 0 56px 0 16px;
    font-size: 13.5px;
    font-weight: 500;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

[data-theme="light"] .promo-topbar {
    background: linear-gradient(90deg, #14161E 0%, #2D1B4E 50%, #14161E 100%);
}

.promo-topbar.hidden { display: none; }

/* Countdown */
.promo-countdown {
    display: flex;
    align-items: center;
    gap: 4px;
    font-variant-numeric: tabular-nums;
}
.promo-num {
    background: #000;
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    min-width: 32px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.promo-sep {
    color: #fff;
    font-weight: 700;
    opacity: 0.6;
}

/* Texto da oferta */
.promo-text {
    color: #fff;
}
.promo-text strong {
    color: #FDCB6E;
    font-weight: 800;
}
.promo-emoji {
    display: inline-block;
    margin: 0 4px;
}

/* CTA — botão laranja gradiente */
.promo-cta {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    color: #fff;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(255,107,53,0.35);
    transition: transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.promo-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255,107,53,0.5);
}

/* Botão fechar */
.promo-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.5;
    padding: 4px 8px;
    border-radius: 6px;
    transition: opacity 0.15s, background 0.15s;
}
.promo-close:hover {
    opacity: 1;
    background: rgba(255,255,255,0.08);
}

/* Empurra todo o resto pra baixo quando topbar visível */
body:not(.promo-hidden):not(.promo-dismissed-session) .sidebar { top: 56px; }
body:not(.promo-hidden):not(.promo-dismissed-session) .main-content { margin-top: 56px; }

@media (max-width: 768px) {
    .promo-topbar {
        font-size: 11.5px;
        gap: 8px;
        padding: 0 40px 0 8px;
        height: 64px;
        flex-wrap: wrap;
    }
    .promo-text { display: none; }
    .promo-num { min-width: 28px; padding: 3px 6px; font-size: 12px; }
    body:not(.promo-hidden):not(.promo-dismissed-session) .sidebar { top: 76px; }
    body:not(.promo-hidden):not(.promo-dismissed-session) .main-content { margin-top: 76px; }
}

/* Sidebar expandido via toggle (fixo, nao hover) */
.sidebar:not(.expanded) {
    width: 60px;
}
.sidebar:not(.expanded) .sidebar-link span { opacity: 0; width: 0; }
.sidebar:not(.expanded) .sidebar-logo-text { opacity: 0; width: 0; }
.sidebar:not(.expanded) .sidebar-section-label span { opacity: 0; width: 0; }
.sidebar:not(.expanded) .model-badge { opacity: 0; width: 0; }
.sidebar:not(.expanded) .sidebar-logo { justify-content: center; padding: 14px 2px; gap: 2px; }
.sidebar:not(.expanded) .sidebar-logo-icon { width: 24px !important; min-width: 24px !important; height: 24px !important; background: #fff; border-radius: 5px; padding: 2px; }
.sidebar:not(.expanded) .sidebar-logo-icon img { width: 100% !important; height: 100% !important; object-fit: contain; }
.sidebar:not(.expanded) .sidebar-toggle-btn { width: 22px !important; min-width: 22px !important; height: 22px !important; }
.sidebar:not(.expanded) .sidebar-toggle-btn img { width: 16px !important; height: 16px !important; }
.sidebar:not(.expanded) .sidebar-logo-text { display: none; }
.sidebar.expanded .sidebar-logo-icon { display: none; }
.sidebar:not(.expanded) .sidebar-toggle-btn { margin-left: 0; }
.sidebar:not(.expanded) .sidebar-link .model-icon-emoji { opacity: 1; width: auto; }

.sidebar.expanded {
    width: var(--sidebar-w-open);
}
.sidebar.expanded .sidebar-link span { opacity: 1; width: auto; }

/* ===== MOBILE: Hamburger + Sidebar Drawer ===== */
.mobile-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin-right: 8px;
}
.mobile-hamburger svg { width: 24px; height: 24px; }

.sidebar-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.25s;
}
body.sidebar-mobile-open .sidebar-mobile-overlay {
    display: block;
    opacity: 1;
}
body.sidebar-mobile-open .promo-topbar,
body.promo-dismissed-session .promo-topbar { display: none !important; }

@media (max-width: 767px) {
    .mobile-hamburger { display: inline-flex; }

    .sidebar {
        display: flex !important;
        position: fixed !important;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100vh;
        width: var(--sidebar-w-open) !important;
        transform: translateX(-105%);
        transition: transform 0.3s ease;
        z-index: 999;
        box-shadow: 8px 0 32px rgba(0,0,0,0.4);
    }
    body.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }
    /* No mobile a sidebar abre sempre expandida (mostra logo + texto) */
    body.sidebar-mobile-open .sidebar .sidebar-logo-text { display: flex; opacity: 1; width: auto; }
    body.sidebar-mobile-open .sidebar .sidebar-logo-icon { display: none; }
    body.sidebar-mobile-open .sidebar .sidebar-link span { opacity: 1; width: auto; }
    body.sidebar-mobile-open .sidebar .sidebar-section-label span { opacity: 1; width: auto; }
    body.sidebar-mobile-open .sidebar .sidebar-section-content { max-height: 800px; }
    body.sidebar-mobile-open .sidebar .sidebar-section-header > span { display: inline; }
    body.sidebar-mobile-open .sidebar .sidebar-section-arrow { display: inline; }
    body.sidebar-mobile-open .sidebar .sidebar-section-header { justify-content: flex-start; padding: 10px 16px; }

    /* Esconde botão de toggle desktop dentro da sidebar mobile */
    .sidebar-toggle-btn { display: none; }
}
.sidebar.expanded .sidebar-logo-text {
    opacity: 1;
    width: auto;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: #fff;
    border-radius: 10px;
    padding: 6px 10px;
}
.sidebar.expanded .sidebar-logo-text img {
    height: 24px;
    width: auto;
    display: block;
}

/* ============================================================
   HOME / DASHBOARD — Layout 2 colunas
   ============================================================ */
.home-banner {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    color: #fff;
    text-align: center;
    padding: 12px 20px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(108,92,231,0.25);
}
.home-banner a {
    color: #fff;
    text-decoration: underline;
    margin-left: 8px;
}

.home-layout {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}
.home-center,
.home-right {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
[data-theme="dark"] .home-center,
[data-theme="dark"] .home-right {
    box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}
.home-center {
    flex: 1.6;
    max-width: 760px;
    min-width: 0;
}
.home-right {
    flex: 1;
    min-width: 300px;
    position: sticky;
    top: 88px;
}

@media (max-width: 900px) {
    .home-layout { flex-direction: column; }
    .home-right { position: static; }
    .home-center, .home-right { padding: 20px; border-radius: 16px; }
}

.home-model-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.home-model-icon { font-size: 24px; }
.home-model-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}
.home-model-desc {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* ============================================================
   HERO — Crie seu vídeo (CTA central)
   ============================================================ */
.home-hero {
    text-align: center;
    padding: 18px 14px 22px;
    margin-bottom: 18px;
    background: linear-gradient(135deg,
        rgba(108,92,231,0.06) 0%,
        rgba(162,155,254,0.03) 50%,
        rgba(255,107,53,0.04) 100%);
    border-radius: 20px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.home-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(108,92,231,0.18) 0%, transparent 70%);
    pointer-events: none;
}
.home-hero::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -10%;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(255,107,53,0.10) 0%, transparent 70%);
    pointer-events: none;
}

.home-hero-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 14px;
    color: #fff;
    box-shadow: 0 6px 20px rgba(108,92,231,0.35);
}
.home-hero-icon.home-hero-icon-img {
    background: #fff;
    padding: 4px;
}
.home-hero-icon.home-hero-icon-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 10px;
}
.home-hero-icon svg {
    width: 26px;
    height: 26px;
}
.home-hero-spark {
    position: absolute;
    top: -15px;
    right: -16px;
    font-size: 22px;
    animation: sparkle 2.5s ease-in-out infinite;
}
@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0); opacity: 1; }
    50% { transform: scale(1.2) rotate(15deg); opacity: 0.85; }
}

.home-hero-title {
    font-size: 23px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.home-hero-subtitle {
    font-size: 13px;
    color: var(--text-medium);
    max-width: 460px;
    margin: 0 auto;
    line-height: 1.55;
}

/* ============================================================
   MODEL CARD — Card do modelo selecionado (coluna direita)
   ============================================================ */
.home-model-card {
    background: linear-gradient(135deg,
        rgba(108,92,231,0.10) 0%,
        rgba(162,155,254,0.05) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.home-model-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.home-model-card-icon {
    font-size: 26px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.home-model-card-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}
.home-model-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.home-model-card-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    letter-spacing: 1px;
}
.home-model-card-desc {
    font-size: 12.5px;
    color: var(--text-medium);
    line-height: 1.55;
    margin: 0;
}

.home-step-section { margin-bottom: 18px; }
.home-step-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

/* Duration grid */
.home-duration-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.home-duration-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 11px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-light);
}
.home-duration-card:hover { border-color: var(--primary); color: var(--text); }
.home-duration-card.active {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.08);
    color: var(--primary);
}
.home-custom-duration {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

/* Coluna direita */
.home-right-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.home-tip-card {
    background: linear-gradient(135deg,
        rgba(253,203,110,0.18) 0%,
        rgba(253,203,110,0.08) 100%);
    border: 1px solid rgba(253,203,110,0.35);
    border-left: 3px solid #FDCB6E;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    width: 100%;
    position: relative;
}
[data-theme="dark"] .home-tip-card {
    background: linear-gradient(135deg,
        rgba(253,203,110,0.10) 0%,
        rgba(253,203,110,0.04) 100%);
    border-color: rgba(253,203,110,0.25);
}

.home-tip-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #B8860B;
    margin-bottom: 6px;
}
.home-tip-title::before {
    content: '💡';
    font-size: 16px;
}
[data-theme="dark"] .home-tip-title {
    color: #FDCB6E;
}

.home-tip-text {
    font-size: 12.5px;
    color: var(--text-medium);
    line-height: 1.55;
}

/* ============================================================
   DEMO PLAYER — Facade YouTube (player principal + thumbs)
   ============================================================ */
.demo-player {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    margin: 0 auto 10px;
    position: relative;
}
.demo-player iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Facade: thumb estática + botão play (antes de carregar iframe) */
.demo-facade {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    cursor: pointer;
    position: relative;
    transition: filter 0.2s;
}
.demo-facade:hover {
    filter: brightness(1.05);
}
.demo-facade::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.45) 100%);
}
.demo-facade-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    transition: transform 0.2s, background 0.2s;
}
.demo-facade:hover .demo-facade-play {
    transform: translate(-50%, -50%) scale(1.08);
    background: #fff;
}
.demo-facade-play svg {
    width: 24px;
    height: 24px;
    margin-left: 3px;
    fill: currentColor;
}

/* Estado vazio — "Em breve" */
.demo-empty {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg,
        rgba(108,92,231,0.06) 0%,
        rgba(255,107,53,0.04) 100%);
    color: var(--text-light);
    text-align: center;
    padding: 16px;
}
.demo-empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    opacity: 0.7;
}
.demo-empty-icon svg { width: 20px; height: 20px; }
.demo-empty-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-medium);
}
.demo-empty-sub {
    font-size: 11px;
    opacity: 0.8;
}

/* Grid de thumbs — sempre 4 colunas (slots vazios ficam, não esticam o que existe) */
.demo-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 14px;
}
.demo-thumbs:empty { display: none; }

.demo-thumb {
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    border: 2px solid var(--border);
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.18s;
    position: relative;
    overflow: hidden;
}
.demo-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.20);
    transition: background 0.18s;
}
.demo-thumb:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}
.demo-thumb:hover::after {
    background: rgba(0,0,0,0.05);
}
.demo-thumb.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(108,92,231,0.20);
}
.demo-thumb.active::after {
    background: transparent;
}

.home-stepbystep-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    margin-top: 12px;
    width: 100%;
}
.home-stepbystep-card p {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}
.home-stepbystep-card a {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

/* Secoes abaixo */
.home-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.home-section-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
}
.home-section-sub {
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 28px;
}

/* Quick access */
.home-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.home-quick-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: block;
    color: inherit;
    text-decoration: none;
}
.home-quick-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.home-quick-card svg { width: 24px; height: 24px; color: var(--primary); margin-bottom: 8px; }
.home-quick-title { font-size: 13px; font-weight: 600; }
.home-quick-desc { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* Plans */
.home-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.home-plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    transition: all 0.2s;
}
.home-plan-card:hover { border-color: var(--primary); }
.home-plan-popular {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.12);
}
.home-plan-tag {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 3px 14px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}
.home-plan-name { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.home-plan-freq { font-size: 13px; color: var(--text-light); margin-bottom: 12px; }
.home-plan-price-old { font-size: 13px; color: var(--text-light); text-decoration: line-through; }
.home-plan-price { font-size: 32px; font-weight: 800; color: var(--primary); margin: 2px 0; }
.home-plan-price span { font-size: 14px; font-weight: 500; color: var(--text-light); }
.home-plan-credits { font-size: 12px; color: var(--text-light); margin-bottom: 16px; }
.home-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}
.home-plan-features li {
    font-size: 13px;
    color: var(--text-light);
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.home-plan-features li svg { width: 14px; height: 14px; color: var(--primary); flex-shrink: 0; }

.home-plans-extra {
    text-align: center;
    margin-top: 24px;
}
.home-plans-extra p { color: var(--text-light); font-size: 13px; margin-bottom: 4px; }
.home-plans-extra a { color: var(--primary); font-weight: 600; font-size: 14px; }

/* ============================================================
   HOME RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .home-right { display: block; margin-top: 16px; }
    .home-center { max-width: 100%; }
    .home-duration-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Botão "Ver exemplos" — só mobile */
.btn-see-examples {
    display: none;
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    background: transparent;
    color: var(--primary);
    border: 1px dashed var(--primary);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}
@media (max-width: 768px) {
    .btn-see-examples { display: block; }
}

/* Botão flutuante voltar ao topo */
.back-to-top {
    position: fixed;
    right: 16px;
    bottom: 80px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(108,92,231,0.4);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 997;
    transition: opacity 0.2s, transform 0.2s;
    opacity: 0;
}
.back-to-top.visible {
    display: flex;
    opacity: 1;
}
.back-to-top:hover { transform: translateY(-2px); }
.back-to-top svg { width: 22px; height: 22px; }
@media (min-width: 768px) {
    .back-to-top { display: none !important; }
}

/* ============================================
   APP INFO MODAL — popup central reutilizavel
   Uso via JS: App.openInfo(titulo, html)
   ============================================ */
.app-modal-bg { position:fixed; inset:0; background:transparent; display:flex; align-items:center; justify-content:center; z-index:9999; }
.app-modal-box { background:var(--card,#1a1a2e); border:1px solid var(--accent,#6366f1); border-radius:10px; padding:1.2rem 1.4rem; max-width:600px; width:90%; max-height:85vh; display:flex; flex-direction:column; box-shadow:0 12px 32px rgba(0,0,0,.5); position:relative; }
.app-modal-box h3 { margin:0 0 .6rem; padding-right:1.8rem; flex:0 0 auto; font-size:.95rem; color:var(--text,#fff); }
.app-modal-body { font-size:.88rem; line-height:1.55; color:var(--text,#fff); margin-top:15px; flex:1 1 auto; min-height:0; overflow-y:auto; }
.app-modal-body p { margin:0 0 .6rem; }
.app-modal-body p:last-child { margin-bottom:0; }
.app-modal-close { position:absolute; top:.5rem; right:.5rem; width:28px; height:28px; padding:0; display:flex; align-items:center; justify-content:center; font-size:1.05rem; line-height:1; border-radius:6px; background:rgba(255,255,255,.08); color:var(--text,#fff); border:1px solid var(--border,#2d2d44); cursor:pointer; font-family:inherit; font-weight:600; transition:all .15s; }
.app-modal-close:hover { background:#ef4444; color:#fff; border-color:#ef4444; }
[data-theme="light"] .app-modal-close { background:rgba(0,0,0,.06); color:#111; border-color:rgba(0,0,0,.15); }
[data-theme="light"] .app-modal-close:hover { background:#ef4444; color:#fff; border-color:#ef4444; }
.app-modal-actions { display:flex; flex:0 0 auto; gap:.6rem; justify-content:flex-end; margin-top:1rem; padding-top:.8rem; border-top:1px solid var(--border,#2d2d44); }
/* Texto de "lembrete" dentro de popups: lilás no light, amarelo no dark */
.dash-lembrete { color: #6C5CE7; }
[data-theme="dark"] .dash-lembrete { color: #fbbf24; }
.app-modal-actions .btn { padding:.45rem 1rem; font-size:.85rem; }
@media (max-width:520px) { .app-modal-actions { flex-direction:column-reverse; } .app-modal-actions .btn { width:100%; } }

/* Botao de info (i) generico do app */
.app-info-btn { display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; border-radius:50%; border:1px solid #888; background:transparent; font-size:.65rem; font-style:italic; font-weight:700; color:#888; margin-left:.3rem; padding:0; cursor:pointer; font-family:inherit; transition:all .15s; }
.app-info-btn:hover { background:var(--accent,#6366f1); border-color:var(--accent,#6366f1); color:#fff; transform:scale(1.1); }

/* ============================================
   APP ACTION BAR — par de botoes Voltar / Continuar (ou similar)
   Padrao reutilizavel: altura uniforme, gradiente verde no primary, responsivo mobile.
   Uso: <div class="app-action-bar"><button class="btn btn-outline">Voltar</button><button class="btn btn-primary">Continuar</button></div>
   ============================================ */
.app-action-bar { display:flex; gap:1rem; margin-top:1.5rem; flex-wrap:wrap; align-items:stretch; }
.app-action-bar .btn { padding:9px 18px; font-size:.9rem; font-weight:700; min-height:42px; }
.app-action-bar .btn-outline { flex:0 1 auto; min-width:160px; }
.app-action-bar .btn-primary { flex:1 1 auto; min-width:200px; background:linear-gradient(135deg,#22c55e,#16a34a); border:none; color:#fff; }
.app-action-bar .btn-primary:hover:not(:disabled) { background:linear-gradient(135deg,#16a34a,#15803d); }
.app-action-bar .btn-primary:disabled { opacity:.5; cursor:not-allowed; }
.app-action-bar .cc-upgrade-inline { display:inline-flex; align-items:center; gap:.5rem; padding:6px 12px; border:1px dashed #fbbf24; border-radius:8px; background:rgba(251,191,36,.06); flex:0 1 auto; min-height:42px; }
.app-action-bar .cc-upgrade-inline select { padding:.35rem .5rem; font-size:.85rem; width:auto; min-width:160px; }
/* Botão quadrado ▾ do menu de navegação rápida (colado no "← Voltar"). Triângulo grande no centro, não estica. */
.nav-quick-btn { flex:0 0 auto; width:var(--btn-h); min-width:var(--btn-h); height:var(--btn-h); padding:0; display:inline-flex; align-items:center; justify-content:center; font-size:1.5rem; line-height:1; background:transparent; color:var(--accent,#a78bfa); border:1px solid var(--accent,#6366f1); border-radius:8px; cursor:pointer; font-family:inherit; }
.nav-quick-btn:hover { background:rgba(99,102,241,.12); }
/* Grupo Voltar + ▾ — mantém os dois SEMPRE na mesma linha (split-button). */
.nav-back-group { display:inline-flex; gap:.5rem; align-items:stretch; }
@media (max-width: 768px) {
    .app-action-bar .cc-upgrade-inline { flex:1 1 100%; width:100%; justify-content:center; }
    .app-action-bar .cc-upgrade-inline select { flex:1 1 auto; }
}
@media (max-width: 640px) {
    .app-action-bar { flex-direction:column; }
    .app-action-bar .btn-outline, .app-action-bar .btn-primary { flex:1 1 100%; min-width:0; width:100%; }
    /* Grupo Voltar+▾ vira uma linha cheia; Voltar cresce, ▾ fica quadrado ao lado. */
    .nav-back-group { display:flex; width:100%; }
    .app-action-bar .nav-back-group { flex:1 1 100%; }
    .app-action-bar .nav-back-group .btn-outline { flex:1 1 auto; width:auto; min-width:0; }
    .nav-back-group .nav-quick-btn { flex:0 0 auto; }
}

/* ========== Campo Contexto (.ctx-*) — usado no Passo 1 do wizard E no #dashboard ==========
   Movido do <style> inline do new-order.php pra cá (fonte única; o #dashboard nao carregava aquele
   inline, por isso o botao "i" aparecia com o estilo feio padrao do browser / fundo branco). */
.ctx-label { display: inline-flex; align-items: center; gap: .5rem; }
.ctx-info-btn {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--accent, #6366f1);
    background: transparent;
    color: var(--accent, #6366f1);
    font-style: italic; font-weight: 700; font-size: .72rem;
    font-family: serif;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    line-height: 1; padding: 0;
    transition: all .15s;
}
.ctx-info-btn:hover {
    background: var(--accent, #6366f1);
    color: #fff;
    transform: scale(1.1);
}
/* Popup Importar audio — dropzone + campos (usa o chassi .app-modal-*) */
.audio-drop {
    border: 2px dashed var(--border, #2d2d44);
    border-radius: 10px;
    padding: 1.6rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    margin-top: .4rem;
}
.audio-drop:hover, .audio-drop.dragging {
    border-color: var(--accent, #6366f1);
    background: rgba(99, 102, 241, .07);
}
.audio-drop-icon  { font-size: 1.7rem; line-height: 1; margin-bottom: .35rem; }
.audio-drop-title { font-size: .86rem; font-weight: 600; color: var(--text, #fff); }
.audio-drop-sub   { font-size: .76rem; color: var(--text-light, #9ba3b4); margin-top: .15rem; }
.audio-limites {
    background: rgba(99, 102, 241, .09);
    border-radius: 8px;
    padding: .55rem .7rem;
    font-size: .78rem;
    color: var(--text-light, #9ba3b4);
    line-height: 1.55;
    margin-bottom: .9rem;
}
.audio-campo-label { display: block; font-size: .78rem; font-weight: 600; color: var(--text, #fff); margin-bottom: .2rem; }
.audio-aviso       { font-size: .72rem; color: var(--text-light, #9ba3b4); line-height: 1.5; margin: .35rem 0 .9rem; }
.audio-status      { text-align: center; font-size: .82rem; color: var(--text-light, #9ba3b4); min-height: 1.2rem; margin-top: .7rem; }

/* Botao "🎧 Importar" (transcrever audio) — so Admin/GestorTecnico */
.ctx-audio-btn {
    border: 1.5px solid var(--accent, #6366f1);
    border-radius: 999px;
    background: transparent;
    color: var(--accent, #6366f1);
    font-weight: 600; font-size: .68rem;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: .2rem;
    line-height: 1; padding: .22rem .55rem;
    transition: all .15s;
}
.ctx-audio-btn:hover {
    background: var(--accent, #6366f1);
    color: #fff;
}
.ctx-chips {
    display: flex; gap: .4rem;
    flex-wrap: wrap;
    margin: .35rem 0 .55rem;
}
.ctx-chip {
    font-size: .68rem;
    font-weight: 600;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, .12);
    color: var(--text-light, #a7a7a7);
    letter-spacing: .03em;
    white-space: nowrap;
}
