/* Estilos Generales y Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #090d16;
    --card-bg: rgba(15, 23, 42, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(59, 130, 246, 0.3);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;
    --accent-indigo: #6366f1;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-amber: #f59e0b;
    --glow-color: rgba(59, 130, 246, 0.15);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    padding: 24px 16px;
}

/* Luces de fondo ambientales */
.background-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
}

.glow-1 {
    top: -150px;
    left: 20%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.18) 0%, transparent 70%);
}

.glow-2 {
    bottom: -150px;
    right: 20%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
}

/* Contenedor Principal */
.portal-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 580px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

/* Encabezado */
.portal-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.badge-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
}

.brand-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Stepper Bar (Barra de Pasos Secuencial) */
.stepper-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.step-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.45;
    transition: all 0.3s ease;
}

.step-badge.active {
    opacity: 1;
}

.step-badge.completed {
    opacity: 1;
}

.step-badge .step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.step-badge.active .step-num {
    background: #2563eb;
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

.step-badge.completed .step-num {
    background: #059669;
    color: #ffffff;
    border-color: #10b981;
}

.step-badge .step-text {
    font-size: 12px;
    font-weight: 700;
    color: #e2e8f0;
}

.step-line {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0 10px;
    transition: background 0.3s ease;
}

.step-line.completed {
    background: #10b981;
}

/* Badge de Paso Obligatorio */
.mandatory-step-badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    padding: 5px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.mandatory-step-badge.step-2-badge {
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.35);
}

/* Caja de Accion Paso 1 */
.action-box {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.btn-mandatory-sponsor {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulseButton 2.5s infinite ease-in-out;
}

@keyframes pulseButton {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 6px 28px rgba(37, 99, 235, 0.65);
        transform: scale(1.015);
    }
}

.btn-mandatory-sponsor:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.6);
}

.action-hint {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    max-width: 400px;
    line-height: 1.4;
}

/* Tarjeta Principal */
.portal-card {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 36px 32px;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 380px;
    justify-content: center;
    position: relative;
}

/* Vistas de Estado */
.state-view {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.state-view.hidden {
    display: none;
}

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

.view-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.view-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 420px;
    margin-bottom: 24px;
}

/* Iconos de Estado */
.status-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 16px;
}

.icon-error {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.icon-success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Spinner */
.spinner-ring {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 18px;
}

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

/* Badge de Sesion */
.session-info-badge {
    font-size: 11px;
    font-weight: 600;
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 14px;
    letter-spacing: 0.5px;
}

/* Requisito 1: Tarjeta de Patrocinador Obligatorio */
.sponsor-gate-card {
    width: 100%;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.25) 0%, rgba(15, 23, 42, 0.7) 100%);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.sponsor-gate-card.completed {
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.25) 0%, rgba(15, 23, 42, 0.7) 100%);
    border-color: rgba(16, 185, 129, 0.4);
}

.gate-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.gate-step-badge {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.15);
    padding: 3px 8px;
    border-radius: 4px;
}

.sponsor-gate-card.completed .gate-step-badge {
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
}

.gate-status {
    font-size: 11px;
    font-weight: 700;
    color: #f59e0b;
}

.sponsor-gate-card.completed .gate-status {
    color: #10b981;
}

.gate-instruction {
    font-size: 12px;
    color: #cbd5e1;
    margin-bottom: 4px;
}

.btn-sponsor-primary {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-sponsor-primary:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-sponsor-primary.completed {
    background: #059669;
    border-color: rgba(52, 211, 153, 0.3);
    color: #ffffff;
    cursor: default;
    transform: none;
    box-shadow: none;
}

/* Requisito 2: Seccion del Temporizador Bloqueable */
.timer-section-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}

.timer-section-wrapper.locked {
    filter: grayscale(0.8) opacity(0.4);
    pointer-events: none;
}

.timer-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 16px;
    backdrop-filter: blur(4px);
}

.timer-section-wrapper:not(.locked) .timer-lock-overlay {
    display: none;
}

.lock-icon {
    font-size: 24px;
}

/* Temporizador Circular */
.timer-display {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.progress-ring {
    transform: rotate(-90deg);
    position: absolute;
    top: 0;
    left: 0;
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.3s ease;
}

.timer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.timer-number {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.timer-unit {
    font-size: 9px;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Aviso de Pausa */
.pause-notice {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    animation: pulseNotice 2s infinite ease-in-out;
}

.pause-notice.hidden {
    display: none;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #fbbf24;
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

@keyframes pulseNotice {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

/* Pasos de Seguridad */
.security-steps {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: space-between;
}

.step-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 10px 8px;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.step-item.active {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--text-primary);
}

.step-num {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.step-item.active .step-num {
    background: var(--accent-blue);
    color: #fff;
}

/* Caja de Codigo OTP */
.otp-box-wrapper {
    width: 100%;
    max-width: 400px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.08);
}

.otp-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--accent-green);
}

.otp-code-container {
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 24px;
    width: 100%;
}

.otp-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #ffffff;
}

.btn-copy-otp {
    width: 100%;
    padding: 12px;
    background: var(--accent-green);
    color: #022c22;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy-otp:hover {
    background: #34d399;
    transform: translateY(-1px);
}

.btn-copy-otp.copied {
    background: #059669;
    color: #ffffff;
}

/* Siguientes Pasos */
.next-steps-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px 20px;
    text-align: left;
}

.steps-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.steps-list {
    padding-left: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Info Box / Error */
.info-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Footer */
.portal-footer {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

.footer-note {
    font-size: 10px;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 480px) {
    .portal-card {
        padding: 24px 16px;
    }
    .brand-title {
        font-size: 26px;
    }
    .security-steps {
        flex-direction: column;
    }
    .step-item {
        flex-direction: row;
        text-align: left;
        justify-content: flex-start;
    }
}
