/* ============================================
   WiFi Connect Portal - Estilos Principales
   ============================================ */

:root {
    /* Colores principales */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --accent: #10b981;
    --success: #22c55e;
    
    /* Neutrales */
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-elevated: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #22c55e 100%);
    --gradient-dark: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    --gradient-glow: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
    
    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    
    /* Espaciado */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Bordes */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transiciones */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient-dark);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Screens */
.screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
}

.screen.active {
    display: flex;
}

/* ============================================
   Loading Screen
   ============================================ */
#loading-screen {
    justify-content: center;
    align-items: center;
    background: var(--bg-dark);
}

.loader-container {
    text-align: center;
}

.wifi-loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
}

.wifi-loader .dot {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

.wifi-loader .wave {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    border: 3px solid transparent;
    border-top-color: var(--primary);
    border-radius: 50%;
    opacity: 0;
}

.wifi-loader .wave-1 {
    width: 30px;
    height: 30px;
    animation: wave 1.5s ease-out infinite;
    animation-delay: 0s;
}

.wifi-loader .wave-2 {
    width: 50px;
    height: 50px;
    animation: wave 1.5s ease-out infinite;
    animation-delay: 0.2s;
}

.wifi-loader .wave-3 {
    width: 70px;
    height: 70px;
    animation: wave 1.5s ease-out infinite;
    animation-delay: 0.4s;
}

@keyframes wave {
    0% { opacity: 0; transform: translateX(-50%) scale(0.5); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
    50% { transform: translateX(-50%) scale(1.2); opacity: 0.7; }
}

.loader-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    animation: fadeInOut 1.5s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ============================================
   Portal Screen
   ============================================ */
#portal-screen {
    background: var(--bg-dark);
    background-image: var(--gradient-glow);
}

/* Header */
.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.network-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.wifi-icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.wifi-icon svg {
    width: 100%;
    height: 100%;
}

.network-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.session-badge {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--accent);
}

.badge-icon {
    font-size: 0.7rem;
}

/* Ad Container */
.ad-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
}

/* Progress Bar */
.progress-bar {
    height: 3px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.1s linear;
}

/* Ad Frame */
.ad-frame {
    position: relative;
    flex: 1;
    min-height: 300px;
    max-height: 450px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
}

.ad-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-media.hidden {
    display: none;
}

/* Ad Overlay */
.ad-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.ad-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.countdown-container {
    text-align: center;
}

.countdown-circle {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto var(--spacing-md);
}

.countdown-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.countdown-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 6;
}

.countdown-progress {
    fill: none;
    stroke: url(#gradient);
    stroke: var(--primary);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.countdown-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.countdown-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Sponsor Badge */
.sponsor-badge {
    position: absolute;
    bottom: var(--spacing-md);
    right: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.sponsor-label {
    font-size: 0.65rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sponsor-badge img {
    height: 24px;
    width: auto;
}

/* Campaign Info */
.campaign-info {
    padding: var(--spacing-lg) 0;
    text-align: center;
}

.campaign-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
}

.campaign-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Footer */
.portal-footer {
    padding: var(--spacing-lg);
    padding-top: var(--spacing-md);
    background: linear-gradient(to top, rgba(15, 23, 42, 1) 0%, transparent 100%);
}

/* Connect Button */
.connect-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    border: none;
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.connect-btn.disabled {
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: not-allowed;
}

.connect-btn.ready {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
    animation: btnReady 0.5s ease;
}

@keyframes btnReady {
    0% { transform: scale(0.95); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.connect-btn.ready:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.4);
}

.connect-btn.ready:active {
    transform: translateY(0);
}

.connect-btn .btn-icon {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-base);
}

.connect-btn.ready:hover .btn-icon {
    transform: translateX(4px);
}

.connect-btn .btn-icon svg {
    width: 100%;
    height: 100%;
}

/* Loading state */
.connect-btn.loading {
    background: var(--gradient-primary);
    color: white;
    pointer-events: none;
}

.connect-btn.loading .btn-text {
    opacity: 0;
}

.connect-btn.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.footer-terms {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--spacing-md);
}

.footer-terms a {
    color: var(--primary-light);
    text-decoration: none;
}

/* ============================================
   Success Screen
   ============================================ */
#success-screen {
    background: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 50% 30%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        var(--gradient-dark);
    justify-content: center;
    align-items: center;
    padding: var(--spacing-xl);
}

.success-container {
    text-align: center;
    max-width: 400px;
    width: 100%;
}

/* Success Animation */
.success-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-xl);
}

.checkmark-circle {
    position: relative;
    z-index: 1;
}

.checkmark {
    width: 120px;
    height: 120px;
}

.checkmark-bg {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    animation: checkCircle 0.6s ease forwards;
}

.checkmark-check {
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: checkMark 0.4s ease forwards 0.4s;
}

@keyframes checkCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes checkMark {
    to { stroke-dashoffset: 0; }
}

.success-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    border: 2px solid var(--accent);
    border-radius: 50%;
    animation: ripple 1s ease-out forwards;
}

@keyframes ripple {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

.success-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    animation: slideUp 0.5s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

.success-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    animation: slideUp 0.5s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

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

/* Session Info Card */
.session-info {
    margin-bottom: var(--spacing-xl);
    animation: slideUp 0.5s ease forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

.session-card {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xl);
    padding: var(--spacing-lg) var(--spacing-xl);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(10px);
}

.session-timer, .session-speed {
    text-align: center;
}

.timer-value, .speed-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.timer-label, .speed-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.session-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
}

/* Thanks Sponsor */
.thanks-sponsor {
    margin-bottom: var(--spacing-xl);
    animation: slideUp 0.5s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

.thanks-sponsor p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.thanks-sponsor img {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

/* Browse Button */
.browse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-lg);
    background: var(--gradient-success);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.3);
    transition: all var(--transition-base);
    animation: slideUp 0.5s ease forwards;
    animation-delay: 0.7s;
    opacity: 0;
}

.browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 60px rgba(16, 185, 129, 0.4);
}

.browse-btn svg {
    width: 20px;
    height: 20px;
}

/* Success Footer */
.success-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-lg);
    text-align: center;
}

.success-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 380px) {
    .portal-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .ad-container {
        padding: var(--spacing-md);
    }
    
    .campaign-title {
        font-size: 1.1rem;
    }
    
    .countdown-circle {
        width: 80px;
        height: 80px;
    }
    
    .countdown-number {
        font-size: 2rem;
    }
}

@media (min-width: 768px) {
    .ad-frame {
        max-height: 500px;
    }
    
    .campaign-title {
        font-size: 1.5rem;
    }
    
    .connect-btn {
        max-width: 400px;
        margin: 0 auto;
    }
}

/* ============================================
   Splash Screen
   ============================================ */
#step-splash {
    background: var(--bg-dark);
    justify-content: center;
    align-items: center;
}

.splash-container {
    text-align: center;
    padding: var(--spacing-xl);
}

.splash-logo {
    max-width: 180px;
    max-height: 80px;
    margin-bottom: var(--spacing-xl);
    object-fit: contain;
}

.splash-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    animation: slideUp 0.5s ease forwards;
}

.splash-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    animation: slideUp 0.5s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.splash-loader {
    margin: var(--spacing-xl) auto 0;
}

/* ============================================
   Form Screen
   ============================================ */
#step-form {
    background: var(--bg-dark);
    background-image: var(--gradient-glow);
}

.form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg);
    overflow-y: auto;
}

.form-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.form-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.portal-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#form-fields {
    flex: 1;
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.form-input {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
}

select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--spacing-md) center;
    padding-right: var(--spacing-2xl);
}

.field-error {
    display: block;
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: var(--spacing-xs);
}

.form-error {
    text-align: center;
    font-size: 0.85rem;
    color: #ef4444;
    padding: var(--spacing-md);
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.step-indicator {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
}

/* ============================================
   Terms Screen
   ============================================ */
#step-terms {
    background: var(--bg-dark);
    background-image: var(--gradient-glow);
}

.terms-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-xl) var(--spacing-lg);
    justify-content: center;
}

.terms-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.terms-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--spacing-lg);
    color: var(--primary);
}

.terms-icon svg {
    width: 100%;
    height: 100%;
}

.terms-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.terms-check-group {
    margin-bottom: var(--spacing-lg);
}

.terms-check-label {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    cursor: pointer;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
}

.terms-check-label:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.terms-checkbox {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.terms-check-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.terms-check-text a {
    color: var(--primary-light);
    text-decoration: underline;
}

.terms-required-badge {
    font-size: 0.65rem;
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.15);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    align-self: center;
}

#terms-accept-btn {
    margin-top: var(--spacing-xl);
}

/* ============================================
   Step: OTP Verify
   ============================================ */

.otp-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--spacing-md);
    color: var(--primary-light);
}

.otp-masked-phone {
    font-size: 0.85rem;
    color: var(--accent);
    margin-top: var(--spacing-sm);
    font-weight: 500;
}

.otp-inputs {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    margin: var(--spacing-xl) 0;
}

.otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition-fast);
    -webkit-appearance: none;
}

.otp-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.otp-timer {
    text-align: center;
    margin-bottom: var(--spacing-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.otp-resend-btn {
    display: block;
    width: 100%;
    padding: var(--spacing-md);
    margin-top: var(--spacing-sm);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.otp-resend-btn:not(:disabled):hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

.otp-resend-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Utilities
   ============================================ */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Safe area for notched devices */
@supports (padding-top: env(safe-area-inset-top)) {
    .portal-header {
        padding-top: calc(var(--spacing-md) + env(safe-area-inset-top));
    }
    
    .portal-footer {
        padding-bottom: calc(var(--spacing-lg) + env(safe-area-inset-bottom));
    }
    
    #success-screen {
        padding-bottom: calc(var(--spacing-xl) + env(safe-area-inset-bottom));
    }
}

/* ============================================
   Layout Templates: Splash
   ============================================ */

.splash-layout-branded {
    justify-content: flex-start;
    padding-top: 15vh;
}

.splash-layout-branded .splash-logo {
    max-width: 120px;
    max-height: 50px;
    margin-bottom: var(--spacing-2xl);
}

.splash-layout-branded .splash-title {
    font-size: 2.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.splash-layout-minimal .splash-logo,
.splash-layout-minimal .splash-loader {
    display: none !important;
}

.splash-layout-minimal .splash-title {
    font-size: 2.2rem;
}

/* ============================================
   Layout Templates: Content
   ============================================ */

.step-content-media_cta .ad-frame {
    max-height: 60vh;
    flex: none;
}

.step-content-media_cta .campaign-info {
    padding: var(--spacing-md) 0;
}

.step-content-card .ad-frame {
    max-height: 350px;
    margin: 0 var(--spacing-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(99, 102, 241, 0.1);
}

/* ============================================
   HTML Embed Styles
   ============================================ */

.embed-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
    gap: var(--spacing-sm);
}

.embed-title {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
}

.embed-frame {
    flex: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.embed-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.embed-timer {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    min-height: 1.2em;
}
