@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --gold: #EDC02C;
    --gold-hover: #d4a825;
    --gold-light: rgba(237, 192, 44, 0.12);
    --gold-glow: 0 4px 20px rgba(237, 192, 44, 0.35);

    --dark-900: #0b0f19;
    --dark-800: #111827;
    --dark-700: #1e293b;
    --dark-600: #334155;

    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;

    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.12);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.12);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.12);
    --warning: #f59e0b;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 40px -10px rgba(0,0,0,0.15);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.25);

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    margin: 0;
}

body.page-dark {
    background: linear-gradient(160deg, var(--dark-900) 0%, var(--dark-800) 40%, #0f1b2d 100%);
    min-height: 100vh;
    color: var(--gray-100);
}

body.page-form {
    background: linear-gradient(160deg, var(--dark-900) 0%, var(--dark-800) 100%);
    min-height: 100vh;
    padding: 2rem 0;
    color: var(--gray-900);
}

body.page-login {
    background: linear-gradient(160deg, var(--dark-900) 0%, var(--dark-800) 50%, #0f1b2d 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.025em;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: var(--radius-full); }

/* ===== BUTTONS ===== */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: all 0.25s var(--ease);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-hover) 100%);
    color: var(--dark-900);
    padding: 14px 32px;
    border-radius: var(--radius-full);
    font-weight: 700;
    box-shadow: var(--gold-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(237, 192, 44, 0.5);
    background: linear-gradient(135deg, var(--gold-hover) 0%, var(--gold) 100%);
    color: var(--dark-900);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline-light {
    border: 2px solid rgba(255,255,255,0.25);
    color: white;
    padding: 14px 32px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(10px);
    font-weight: 600;
}
.btn-outline-light:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.5);
    color: white;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-full);
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4); }

.btn-outline-primary {
    border: 2px solid var(--gold);
    color: var(--gold);
    padding: 14px 32px;
    border-radius: var(--radius-full);
    font-weight: 600;
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--gold);
    color: var(--dark-900);
    transform: translateY(-2px);
    box-shadow: var(--gold-glow);
}

.btn-outline-secondary {
    border: 2px solid var(--gray-400);
    color: var(--gray-500);
    padding: 14px 32px;
    border-radius: var(--radius-full);
    font-weight: 600;
    background: transparent;
}
.btn-outline-secondary:hover {
    background: var(--gray-600);
    color: white;
    border-color: var(--gray-600);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--gray-600), var(--gray-700));
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-full);
    font-weight: 600;
    color: white;
}

/* ===== FORMS ===== */
.form-control, .form-select {
    font-family: 'Inter', sans-serif;
    border-radius: var(--radius);
    border: 2px solid var(--gray-200);
    padding: 13px 16px;
    font-size: 0.925rem;
    font-weight: 500;
    transition: all 0.2s var(--ease);
    background: white;
    color: var(--gray-900);
}
.form-control:focus, .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px var(--gold-light);
    background: white;
    outline: none;
}

.form-label {
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.4rem;
}

.input-group-text {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    color: var(--gold);
    font-weight: 600;
}

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    background: white;
    overflow: hidden;
    transition: all 0.3s var(--ease);
}
.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}
.card-header {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-hover) 100%);
    color: var(--dark-900);
    font-weight: 700;
    border: none;
    padding: 1.1rem 1.5rem;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: var(--radius);
    border: none;
    font-weight: 500;
    padding: 1rem 1.25rem;
    font-size: 0.925rem;
}
.alert-success { background: var(--success-light); color: #065f46; border-left: 4px solid var(--success); }
.alert-danger { background: var(--danger-light); color: #991b1b; border-left: 4px solid var(--danger); }
.alert-info { background: var(--info-light); color: #1e40af; border-left: 4px solid var(--info); }

/* ===== BADGES ===== */
.badge {
    font-family: 'Inter', sans-serif;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
}
.badge-success { background: linear-gradient(135deg, var(--success), #059669); color: white; }
.badge-danger { background: linear-gradient(135deg, var(--danger), #dc2626); color: white; }
.badge-warning { background: linear-gradient(135deg, var(--warning), #d97706); color: var(--dark-900); }
.badge-info { background: linear-gradient(135deg, var(--info), #6366f1); color: white; }

/* ===== PROGRESS ===== */
.progress { height: 6px; border-radius: var(--radius-full); background: var(--gray-200); }
.progress-bar { background: linear-gradient(90deg, var(--gold), var(--gold-hover)); border-radius: var(--radius-full); }

/* ===== TEXT ===== */
.text-muted { color: var(--gray-500) !important; }
.text-primary { color: var(--gold) !important; }
.form-text { color: var(--gray-500); font-size: 0.8rem; }

/* ============================================================
   HERO SECTION (index.php)
   ============================================================ */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 2rem 0;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: -50%;
    background:
        radial-gradient(ellipse at 25% 40%, rgba(237,192,44,0.07) 0%, transparent 60%),
        radial-gradient(ellipse at 75% 60%, rgba(59,130,246,0.04) 0%, transparent 60%);
    animation: heroGlow 20s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes heroGlow {
    0% { transform: translate(0,0) rotate(0deg); }
    100% { transform: translate(-3%,3%) rotate(2deg); }
}

.brand-title {
    color: var(--gold);
    font-weight: 800;
    letter-spacing: -0.04em;
    text-shadow: 0 0 60px rgba(237,192,44,0.2);
}

.hero-badge {
    background: var(--gold-light);
    color: var(--gold);
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid rgba(237,192,44,0.25);
    display: inline-block;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    letter-spacing: 0.02em;
}

.divider {
    width: 72px;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--gold-hover));
    margin: 24px auto;
    border-radius: var(--radius-full);
}

.lead {
    color: rgba(255,255,255,0.65);
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.8;
    max-width: 650px;
    margin: 0 auto;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section .card {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08);
    color: white;
    padding: 2rem 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.hero-section .card:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(237,192,44,0.25);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.hero-section .card h5 { color: white; font-weight: 700; font-size: 1.05rem; }
.hero-section .card .text-muted { color: rgba(255,255,255,0.55) !important; font-size: 0.875rem; }

/* ============================================================
   FORM CONTAINER (postulacion.php)
   ============================================================ */
.form-container {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    max-width: 900px;
    margin: 0 auto;
    border-top: 4px solid var(--gold);
}

.form-header { text-align: center; margin-bottom: 2.5rem; }
.form-header h2 { color: var(--gray-900); font-weight: 800; font-size: 1.65rem; }
.form-header .badge {
    background: var(--gold-light);
    color: var(--gold-hover);
    border: 1px solid rgba(237,192,44,0.25);
    padding: 8px 20px;
}

.progress-step { display: flex; justify-content: center; gap: 12px; margin-bottom: 2.5rem; }
.step {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--gray-400);
    font-size: 0.9rem;
    border: 2px solid var(--gray-200);
    transition: all 0.3s var(--ease);
}
.step.active {
    background: var(--gold);
    color: var(--dark-900);
    border-color: var(--gold);
    box-shadow: var(--gold-glow);
}

/* ============================================================
   TESTS CONTAINER (tests.php)
   ============================================================ */
.tests-container {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    max-width: 1100px;
    margin: 0 auto;
    border-top: 4px solid var(--gold);
}
.main-title { color: var(--gray-900); font-weight: 800; }

.test-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    margin-bottom: 2rem;
    transition: all 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}
.test-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--gray-200);
    transition: all 0.3s var(--ease);
}
.test-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.test-card.completed {
    border-color: rgba(16,185,129,0.3);
    background: linear-gradient(135deg, rgba(16,185,129,0.02), rgba(16,185,129,0.05));
}
.test-card.completed::before { background: linear-gradient(90deg, var(--success), #059669); }
.test-card.available {
    border-color: rgba(237,192,44,0.3);
    background: linear-gradient(135deg, rgba(237,192,44,0.02), rgba(237,192,44,0.05));
}
.test-card.available::before { background: linear-gradient(90deg, var(--gold), var(--gold-hover)); }
.test-card.locked { border-color: var(--gray-200); background: var(--gray-50); opacity: 0.7; }

.test-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.test-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; color: var(--gray-900); }
.test-description { color: var(--gray-500); margin-bottom: 2rem; font-size: 1rem; line-height: 1.7; }

.test-info { display: flex; justify-content: center; gap: 2rem; margin-bottom: 2rem; flex-wrap: wrap; }
.test-stat { display: flex; align-items: center; gap: 0.5rem; color: var(--gray-600); font-weight: 600; font-size: 0.9rem; }
.test-stat i { color: var(--gold); }

.status-badge {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.status-completed { background: var(--success); color: white; }
.status-available { background: var(--gold); color: var(--dark-900); }
.status-locked { background: var(--gray-500); color: white; }

.progress-bar-custom {
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    overflow: hidden;
    margin-bottom: 2rem;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-hover));
    border-radius: var(--radius-full);
    transition: width 0.8s var(--ease);
}

.tests-container .user-info, .user-info-box {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--gold);
}

/* ============================================================
   TEST PAGE (test_impulsos.php / test_barratt.php)
   ============================================================ */
.test-container {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    max-width: 900px;
    margin: 0 auto;
    border-top: 4px solid var(--gold);
}

.test-header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: sticky;
    top: 0;
    background: white;
    z-index: 100;
    padding: 1rem 0 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.test-header h2 { color: var(--gray-900); font-weight: 800; }

.timer {
    background: linear-gradient(135deg, var(--gold), var(--gold-hover));
    color: var(--dark-900);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1rem;
    animation: timerPulse 2.5s ease-in-out infinite;
    box-shadow: var(--gold-glow);
    display: inline-block;
    margin-bottom: 0.75rem;
}
.timer.warning { background: linear-gradient(135deg, var(--warning), #d97706); animation-duration: 1.5s; }
.timer.danger { background: linear-gradient(135deg, var(--danger), #dc2626); color: white; animation-duration: 0.8s; }
@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}
.timer-icon { font-size: 1.2rem; margin-right: 8px; vertical-align: middle; }

.progress-info {
    background: var(--gold-light);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gold-hover);
    border: 1px solid rgba(237,192,44,0.25);
    display: inline-block;
    margin-bottom: 0.75rem;
}

.question-card {
    background: var(--gray-50);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--gold);
    transition: all 0.25s var(--ease);
}
.question-card:hover {
    box-shadow: var(--shadow);
    border-left-color: var(--gold-hover);
}

.question-number {
    background: linear-gradient(135deg, var(--gold), var(--gold-hover));
    color: var(--dark-900);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    box-shadow: var(--gold-glow);
}
.question-card h5 { color: var(--gray-800); font-weight: 600; font-size: 1.05rem; line-height: 1.6; }

.options-group { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 1.5rem; }
.option-label { flex: 1; min-width: 110px; text-align: center; }
.option-input { display: none; }
.option-button {
    display: block;
    width: 100%;
    padding: 12px 8px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--gray-600);
    line-height: 1.3;
}
.option-input:checked + .option-button {
    background: linear-gradient(135deg, var(--gold), var(--gold-hover));
    color: var(--dark-900);
    border-color: var(--gold);
    box-shadow: var(--gold-glow);
    transform: translateY(-2px);
    font-weight: 700;
}
.option-button:hover {
    border-color: var(--gold);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(237,192,44,0.15);
}

/* ============================================================
   RESULTS (resultados.php)
   ============================================================ */
.result-container {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    max-width: 900px;
    margin: 0 auto;
    border-top: 4px solid var(--gold);
}
.result-header { text-align: center; margin-bottom: 2.5rem; }
.result-header h2 { color: var(--gray-900); font-weight: 800; }

.result-card {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--gray-200);
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    margin: 0 auto 1.5rem;
    color: white;
}
.score-excellent { background: linear-gradient(135deg, var(--success), #059669); box-shadow: 0 8px 30px rgba(16,185,129,0.35); }
.score-good { background: linear-gradient(135deg, var(--info), #6366f1); box-shadow: 0 8px 30px rgba(59,130,246,0.35); }
.score-fair { background: linear-gradient(135deg, var(--warning), #d97706); box-shadow: 0 8px 30px rgba(245,158,11,0.35); }
.score-poor { background: linear-gradient(135deg, var(--danger), #dc2626); box-shadow: 0 8px 30px rgba(239,68,68,0.35); }

.result-badge {
    font-size: 1rem;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-weight: 700;
    display: inline-block;
    letter-spacing: 0.01em;
}

.test-details {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--gold);
}

/* ============================================================
   LOGIN (admin/login.php)
   ============================================================ */
.login-container {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    max-width: 420px;
    width: 100%;
    border-top: 4px solid var(--gold);
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h3 { color: var(--gray-900); font-weight: 800; }
.logo-icon {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
}

/* ============================================================
   CONFETTI
   ============================================================ */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confettiFall 3s linear forwards;
    z-index: 9999;
}
@keyframes confettiFall {
    0% { opacity: 1; transform: translateY(0) rotate(0deg); }
    100% { opacity: 0; transform: translateY(100vh) rotate(720deg); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .form-container, .tests-container, .result-container, .test-container { margin: 1rem; padding: 1.75rem; }
    .login-container { margin: 1rem; }
    .hero-section .display-3 { font-size: 2rem; }
    .test-info { gap: 1rem; }
    .options-group { gap: 8px; }
    .option-button { padding: 10px 6px; font-size: 0.75rem; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.5s var(--ease) forwards; }
