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

/* ========== CSS Custom Properties ========== */
:root {
    --bg-page: #f0f4f8;
    --bg-white: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);

    /* Blue palette — matches exam interface */
    --blue-primary: #017EB1;
    --blue-dark: #015f87;
    --blue-deeper: #0d3b66;
    --blue-light: #e0f2fe;
    --blue-pale: #f0f7ff;
    --blue-accent: #0ea5e9;
    --blue-vivid: #3b82f6;

    /* Supporting */
    --cyan-accent: #06b6d4;
    --indigo-accent: #6366f1;

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #017EB1 0%, #0ea5e9 40%, #06b6d4 100%);
    --gradient-btn: linear-gradient(135deg, #017EB1 0%, #0ea5e9 100%);
    --gradient-btn-hover: linear-gradient(135deg, #015f87 0%, #017EB1 100%);
    --gradient-warm: linear-gradient(135deg, #017EB1 0%, #6366f1 100%);
    --gradient-sky: linear-gradient(180deg, #e0f2fe 0%, #f0f4f8 40%, #ffffff 100%);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-on-blue: #ffffff;

    /* Glass */
    --glass-border: rgba(0, 126, 177, 0.10);
    --glass-border-hover: rgba(0, 126, 177, 0.22);
    --glass-shadow: 0 8px 32px rgba(0, 126, 177, 0.08);
    --glass-shadow-hover: 0 16px 48px rgba(0, 126, 177, 0.14);

    /* Radii */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --radius-pill: 999px;

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-fast: 0.2s;
    --t-smooth: 0.45s;
}

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

html {
    scroll-behavior: smooth;
}

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

.hidden {
    display: none !important;
}

/* ========== Particle Canvas ========== */
#particleCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ========== Landing Container ========== */
.landing-container {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Soft gradient blobs */
.landing-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.landing-overlay::before {
    content: '';
    position: absolute;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(1, 126, 177, 0.12) 0%, transparent 70%);
    top: -250px;
    right: -150px;
    animation: aurora1 16s ease-in-out infinite;
    filter: blur(80px);
}

.landing-overlay::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.10) 0%, transparent 70%);
    bottom: -200px;
    left: -120px;
    animation: aurora2 20s ease-in-out infinite;
    filter: blur(80px);
}

.landing-container::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: aurora3 14s ease-in-out infinite;
    filter: blur(100px);
    z-index: 0;
}

/* Subtle dot grid */
.landing-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(rgba(1, 126, 177, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    z-index: 1;
    pointer-events: none;
}

@keyframes aurora1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 1; }
    25% { transform: translate(-100px, 80px) scale(1.2); opacity: 0.8; }
    50% { transform: translate(-50px, 150px) scale(0.9); opacity: 1; }
    75% { transform: translate(80px, 50px) scale(1.1); opacity: 0.85; }
}

@keyframes aurora2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(120px, -100px) scale(1.2); }
    66% { transform: translate(60px, -50px) scale(0.85); }
}

@keyframes aurora3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    25% { transform: translate(-35%, -65%) scale(1.3); }
    50% { transform: translate(-65%, -35%) scale(0.8); }
    75% { transform: translate(-50%, -55%) scale(1.15); }
}

/* ========== Landing Content ========== */
.landing-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 480px;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-primary);
}

/* ========== Logo Section ========== */
.logo-section {
    margin-bottom: 40px;
    animation: enterUp 0.7s var(--ease-out-expo) both;
}

.logo-section .logo-emoji {
    font-size: 2.8em;
    display: block;
    margin-bottom: 8px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(1, 126, 177, 0.25));
}

.logo-section h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.6em;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 14px;
    background: var(--gradient-hero);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 5s ease-in-out infinite;
}

.logo-section .tagline {
    font-size: 0.95em;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ========== Entrance Animations ========== */
@keyframes enterUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== Glass Card ========== */
.exam-code-section,
.phone-otp-section {
    background: var(--bg-card);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-radius: var(--radius-xl);
    padding: 36px 30px;
    margin-bottom: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    animation: enterUp 0.7s var(--ease-out-expo) 0.15s both;
    position: relative;
    overflow: hidden;
    transition: border-color var(--t-fast), box-shadow var(--t-smooth);
}

.exam-code-section:hover,
.phone-otp-section:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--glass-shadow-hover);
}

/* Top edge accent line */
.exam-code-section::before,
.phone-otp-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 3px;
    background: var(--gradient-hero);
    border-radius: 0 0 3px 3px;
    opacity: 0.8;
}

/* Soft corner glow */
.exam-code-section::after,
.phone-otp-section::after {
    content: '';
    position: absolute;
    bottom: -60px;
    right: -60px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.exam-code-section h2,
.phone-otp-section h2 {
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 24px;
    font-size: 1.35em;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* ========== Input Fields ========== */
.input-group {
    margin-bottom: 18px;
}

.input-group input {
    width: 100%;
    padding: 16px 20px;
    border: 1.5px solid #dce5f0;
    border-radius: var(--radius-md);
    background: var(--bg-white);
    font-size: 1em;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: var(--text-primary);
    transition: all var(--t-fast);
    outline: none;
}

.input-group input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.input-group input:focus {
    border-color: var(--blue-primary);
    background: var(--blue-pale);
    box-shadow:
        0 0 0 3px rgba(1, 126, 177, 0.12),
        0 0 16px rgba(1, 126, 177, 0.06);
}

.input-group input:disabled {
    background: #f1f5f9;
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: #e2e8f0;
}

/* ========== Buttons ========== */
.btn-primary {
    width: 100%;
    padding: 16px 28px;
    background: var(--gradient-btn);
    background-size: 200% auto;
    color: var(--text-on-blue);
    border: none;
    border-radius: var(--radius-pill);
    font-size: 1em;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

/* Shimmer sweep */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.6s ease;
}

.btn-primary:hover {
    background-position: right center;
    transform: translateY(-3px);
    box-shadow:
        0 10px 30px rgba(1, 126, 177, 0.3),
        0 6px 16px rgba(6, 182, 212, 0.15);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(1, 126, 177, 0.2);
}

.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary:disabled::before {
    display: none;
}

.btn-secondary {
    width: 100%;
    padding: 14px 22px;
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid #dce5f0;
    border-radius: var(--radius-pill);
    font-size: 0.92em;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
}

.btn-secondary:hover {
    background: var(--blue-pale);
    border-color: var(--blue-primary);
    color: var(--blue-primary);
    box-shadow: 0 4px 16px rgba(1, 126, 177, 0.08);
}

/* ========== Error Message ========== */
.error-message {
    color: #dc2626;
    margin-top: 14px;
    font-size: 0.88em;
    font-weight: 500;
    display: none;
    padding: 12px 16px;
    background: #fef2f2;
    border-radius: var(--radius-sm);
    border: 1px solid #fecaca;
    animation: shake 0.4s ease-out;
}

.error-message.show {
    display: block;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* ========== Exam Preview Card ========== */
.exam-preview {
    margin-bottom: 24px;
    padding: 24px 26px;
    border-radius: var(--radius-lg);
    background: var(--blue-pale);
    border: 1px solid rgba(1, 126, 177, 0.12);
    text-align: left;
    animation: enterUp 0.5s var(--ease-out-expo) both;
}

.exam-preview h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--blue-primary);
}

.exam-preview p {
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: 0.92em;
}

.exam-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.exam-preview-metric {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 16px 14px;
    border: 1px solid #e2e8f0;
    transition: all var(--t-fast);
}

.exam-preview-metric:hover {
    border-color: rgba(1, 126, 177, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 126, 177, 0.06);
}

.exam-preview-metric span {
    display: block;
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.exam-preview-metric strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05em;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========== Divider ========== */
.divider {
    margin: 32px 0;
    position: relative;
    text-align: center;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(1, 126, 177, 0.12), transparent);
}

/* ========== Performance Link ========== */
.performance-link {
    margin-top: 10px;
    animation: enterUp 0.7s var(--ease-out-expo) 0.35s both;
}

.performance-link a {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.92em;
    font-weight: 500;
    padding: 14px 32px;
    border: 1.5px solid #dce5f0;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all var(--t-smooth) var(--ease-out-expo);
    background: var(--bg-white);
    position: relative;
    overflow: hidden;
}

.performance-link a::before {
    content: none;
}

.performance-link a:hover {
    color: var(--blue-primary);
    background: var(--blue-pale);
    border-color: var(--blue-primary);
    box-shadow: 0 6px 24px rgba(1, 126, 177, 0.1);
    transform: translateY(-3px);
}

/* ========== OTP Timer ========== */
#otpTimer {
    color: var(--text-secondary) !important;
    font-size: 0.88em !important;
    padding: 10px 16px;
    background: var(--blue-pale);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(1, 126, 177, 0.1);
}

#otpTimer #timerCountdown {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--blue-primary);
    font-variant-numeric: tabular-nums;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .landing-content {
        padding: 28px 18px;
        max-width: 100%;
    }

    .logo-section h1 {
        font-size: 2.6em;
    }

    .logo-section .logo-emoji {
        font-size: 2.2em;
    }

    .logo-section .tagline {
        font-size: 0.82em;
    }

    .exam-code-section,
    .phone-otp-section {
        padding: 28px 22px;
        border-radius: var(--radius-lg);
    }

    .exam-preview-grid {
        grid-template-columns: 1fr;
    }

    .landing-overlay::before {
        width: 400px;
        height: 400px;
    }

    .landing-overlay::after {
        width: 350px;
        height: 350px;
    }
}

@media (max-width: 380px) {
    .logo-section h1 {
        font-size: 2.1em;
    }

    .exam-code-section,
    .phone-otp-section {
        padding: 22px 18px;
    }
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-page);
}

::-webkit-scrollbar-thumb {
    background: rgba(1, 126, 177, 0.18);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(1, 126, 177, 0.3);
}

/* ========== Selection ========== */
::selection {
    background: rgba(1, 126, 177, 0.2);
    color: var(--text-primary);
}

/* ========== Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
