/* ==========================================================================
   Premium Smart TV Redesign - testarapp
   Theme: Luxury, Minimal, Cyberpunk-inspired Apple TV & Netflix aesthetics
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700;900&family=Rajdhani:wght@600;700&family=Inter:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: #05070D;
    --bg-surface: #0B1220;
    --neon-cyan: #18B8FF;
    --neon-purple: #6A3CFF;
    --neon-emerald: #2ED573;
    --text-primary: #FFFFFF;
    --text-muted: #A6B1C2;
    --border-color: rgba(24, 184, 255, 0.15);
    --border-color-active: rgba(24, 184, 255, 0.8);
}

/* Base Normalization & Scrollbars */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.2s ease,
                border-color 0.2s ease,
                background-color 0.2s ease,
                opacity 0.2s ease;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #05070D !important;
    background-color: var(--bg-dark) !important;
    color: #FFFFFF !important;
    color: var(--text-primary) !important;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden !important;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px; /* Safe Area for TV Overscan */
}

/* Ambient glow blobs in the background */
body::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -30%;
    width: 160%;
    height: 160%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(24, 184, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(106, 60, 255, 0.08) 0%, transparent 40%);
    z-index: -1;
    pointer-events: none;
}

/* Typography Classes */
.font-rajdhani {
    font-family: 'Rajdhani', sans-serif;
}

.font-orbitron {
    font-family: 'Orbitron', sans-serif;
}

/* Centralized Layout Container */
.main-wrapper {
    width: 100%;
    max-width: 900px; /* 70% width approximate for content elements on 1920x1080 */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
}

/* 100% centered single axis structure */
.centered-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Header & Progress Indicator */
.logo-container {
    margin-bottom: 12px;
}

/* Unified Progress Stepper (TV) */
.progress-indicator {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 28px auto;
}

.stepper-track-bg {
    position: absolute;
    top: 22px; /* Center of the 44px TV circle */
    left: 12%;
    right: 12%;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    z-index: 1;
}

.progress-line-fill {
    position: absolute;
    top: 22px;
    left: 12%;
    height: 3px;
    background: linear-gradient(90deg, #18B8FF, #6A3CFF);
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    border-radius: 4px;
    z-index: 2;
    width: 0%; /* JS controlled */
    max-width: 76%;
    transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 3;
    flex: 1;
}

.progress-step {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0D1424;
    border: 3px solid rgba(255, 255, 255, 0.1);
    color: #A6B1C2;
    color: var(--text-muted);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.progress-step.active {
    border-color: #18B8FF;
    border-color: var(--neon-cyan);
    color: #FFFFFF;
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(24, 184, 255, 0.4), inset 0 0 8px rgba(24, 184, 255, 0.2);
    background: #0B1220;
    background: var(--bg-surface);
}

.progress-step.completed {
    background: linear-gradient(135deg, #18B8FF, #6A3CFF);
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    border-color: transparent;
    color: #FFFFFF;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(24, 184, 255, 0.3);
}

.progress-label {
    margin-top: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #A6B1C2;
    color: var(--text-muted);
    letter-spacing: 1px;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.progress-label.active {
    color: #FFFFFF;
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

/* Wizard step layout wrapper */
.wizard-content {
    position: relative;
    width: 100%;
    overflow: visible;
    min-height: 420px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Individual Steps with tvOS style transitions */
.wizard-step {
    position: absolute;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.22s ease;
}

.wizard-step.active-step {
    position: relative !important;
    opacity: 1 !important;
    transform: scale(1) translateX(0) !important;
    pointer-events: auto;
}

.wizard-step.exit-left {
    opacity: 0 !important;
    transform: translateX(-100px) scale(0.98) !important;
}

.wizard-step.exit-right {
    opacity: 0 !important;
    transform: translateX(100px) scale(0.98) !important;
}

.wizard-step.enter-left {
    opacity: 0 !important;
    transform: translateX(-100px) scale(0.98) !important;
}

.wizard-step.enter-right {
    opacity: 0 !important;
    transform: translateX(100px) scale(0.98) !important;
}

/* Heading Typography */
.step-title {
    font-size: 38px; /* Otimizado para 16:9 */
    font-weight: 800;
    color: #FFFFFF;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.step-subtitle {
    font-size: 18px;
    color: #A6B1C2;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 400;
}

/* Ultra Large Input Box */
.tv-input-container {
    width: 70%;
    margin-bottom: 24px;
}

.tv-input {
    width: 100% !important;
    height: 115px !important;
    background-color: #0B1220 !important;
    background-color: var(--bg-surface) !important;
    border: 3px solid rgba(24, 184, 255, 0.15) !important;
    border: 3px solid var(--border-color) !important;
    color: #FFFFFF !important;
    color: var(--text-primary) !important;
    font-size: 34px !important;
    font-weight: 600 !important;
    text-align: center !important;
    border-radius: 24px !important;
    outline: none !important;
    padding: 0 32px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

/* Input Focus Glow */
.tv-input:focus {
    border-color: #18B8FF !important;
    border-color: var(--neon-cyan) !important;
    outline: none !important;
    box-shadow: 0 0 30px rgba(24, 184, 255, 0.5), 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    transform: scale(1.03) !important;
}

.tv-input::placeholder {
    color: rgba(255, 255, 255, 0.25) !important;
}

/* Custom phone prefix styling (intl-tel-input override) */
.iti__flag-container {
    display: none !important; /* Hide native dropdown trigger to prevent D-pad trap */
}

/* Primary D-pad Button CTA */
.tv-btn-primary {
    width: 70%;
    height: 96px;
    background: linear-gradient(90deg, #18B8FF 0%, #6A3CFF 100%) !important;
    background: linear-gradient(90deg, var(--neon-cyan) 0%, var(--neon-purple) 100%) !important;
    border-radius: 24px;
    color: #FFFFFF !important;
    font-size: 26px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: none !important;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(106, 60, 255, 0.2) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* D-pad Focus state with scale and shadow */
.tv-btn-primary:focus, .dpad-focusable:focus {
    outline: 3px solid #FFFFFF !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 40px rgba(106, 60, 255, 0.7), 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    transform: scale(1.05) !important;
}

.tv-btn-primary:disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Review Screen Labels & Container */
.review-container {
    width: 70%;
    background: #0B1220;
    background: var(--bg-surface);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.review-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.review-label {
    font-size: 16px;
    color: #A6B1C2;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.review-value {
    font-size: 22px;
    color: #FFFFFF;
    color: var(--text-primary);
    font-weight: 700;
}

/* Loading animations & progress text */
.loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.loading-bar-outer {
    width: 320px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.loading-bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #18B8FF, #6A3CFF);
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    border-radius: 10px;
    animation: loadingAnimate 4.5s linear forwards;
}

@keyframes loadingAnimate {
    0% { width: 0%; }
    30% { width: 40%; }
    70% { width: 85%; }
    100% { width: 100%; }
}

.loading-status-text {
    font-size: 22px;
    font-weight: 600;
    color: #18B8FF;
    color: var(--neon-cyan);
    letter-spacing: 0.5px;
    min-height: 32px;
}

/* Success Screen layouts */
.success-icon-container {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(46, 213, 115, 0.1);
    border: 3px solid #2ED573;
    border: 3px solid var(--neon-emerald);
    color: #2ED573;
    color: var(--neon-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 12px;
    box-shadow: 0 0 20px rgba(46, 213, 115, 0.3);
}

.activation-code-box {
    background: #040714;
    border: 3px solid rgba(24, 184, 255, 0.2);
    border-radius: 20px;
    padding: 12px 32px;
    font-size: 34px;
    font-weight: 900;
    color: #FFFFFF;
    color: var(--text-primary);
    font-family: 'Orbitron', monospace;
    letter-spacing: 4px;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.success-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 70%;
}

.success-btn-sec {
    height: 60px;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 18px;
    color: #FFFFFF !important;
    color: var(--text-primary) !important;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Rodapé Contextual / Bottom Navigation Help Bar */
.bottom-help-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 72px;
    background: rgba(5, 7, 13, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    z-index: 100;
    backdrop-filter: blur(15px);
}

.help-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #A6B1C2;
    color: var(--text-muted);
    font-weight: 600;
}

.help-key {
    background: #172033;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 3px 10px;
    font-family: monospace;
    color: #FFFFFF;
    color: var(--text-primary);
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Spinner custom styles */
.spinner-neon {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 3px solid #FFFFFF;
    border-top: 3px solid var(--text-primary);
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Support and QR Modal overrides */
#support-qr-modal {
    background: rgba(3, 4, 8, 0.9) !important;
}

/* Plan selector grids on TV Success View */
.tv-plans-container {
    width: 100%;
    margin-top: 16px;
}

.plan-card-cyber {
    background: #0B1220 !important;
    background: var(--bg-surface) !important;
    border: 2px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 20px;
    padding: 20px;
}

.plan-card-cyber:focus {
    border-color: #18B8FF !important;
    border-color: var(--neon-cyan) !important;
    box-shadow: 0 0 25px rgba(24, 184, 255, 0.4) !important;
}

/* Checkout View */
#checkout-payment-section {
    width: 100%;
}
