/* ============================================================
   EXAMIO — Global Design System
   ============================================================ */

/* ── Design Tokens ────────────────────────────────────────── */
:root {
    --color-bg:            #080b14;
    --color-bg-card:       #0e1320;
    --color-bg-card-hover: #141a2e;
    --color-border:        rgba(255, 255, 255, 0.07);
    --color-primary:       #6c63ff;
    --color-primary-light: #8b85ff;
    --color-primary-glow:  rgba(108, 99, 255, 0.35);
    --color-accent:        #00d2ff;
    --color-text:          #e8eaf0;
    --color-text-muted:    #8892a4;
    --color-text-subtle:   #4e5a70;
    --gradient-hero:       linear-gradient(135deg, #0d0f1e 0%, #0a1628 50%, #0d0f1e 100%);
    --gradient-primary:    linear-gradient(135deg, #6c63ff 0%, #00d2ff 100%);
    --gradient-card:       linear-gradient(145deg, #0e1320 0%, #111827 100%);
    --font-body:           'Inter', system-ui, sans-serif;
    --font-display:        'Poppins', system-ui, sans-serif;
    --radius-sm:           8px;
    --radius-md:           14px;
    --radius-lg:           20px;
    --radius-xl:           28px;
    --shadow-card:         0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255,255,255,0.04) inset;
    --shadow-glow:         0 0 60px rgba(108, 99, 255, 0.18), 0 0 120px rgba(0, 210, 255, 0.08);
    --transition-fast:     0.18s ease;
    --transition-base:     0.3s ease;
    --transition-slow:     0.6s ease;
}

/* ── Reset / Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

html, body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ── Blazor Error UI ──────────────────────────────────────── */
#blazor-error-ui {
    color-scheme: light only;
    background: #1a1a2e;
    border-top: 2px solid var(--color-primary);
    color: #e8eaf0;
    bottom: 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.75rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
    font-size: 0.875rem;
}

#blazor-error-ui a.reload {
    color: var(--color-primary-light);
    font-weight: 600;
    margin-left: 0.5rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

#blazor-error-ui .dismiss:hover { opacity: 1; }

/* ── Branded Splash Screen ────────────────────────────────── */
.examio-splash {
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    animation: splashFadeOut 0.5s ease 2.4s forwards;
}

.examio-splash__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    animation: splashContentIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.examio-splash__logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px var(--color-primary-glow);
    animation: splashLogoPulse 1.8s ease-in-out infinite;
}

.examio-splash__logo-e {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
}

.examio-splash__wordmark {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.examio-splash__bar {
    width: 160px;
    height: 3px;
    background: rgba(255,255,255,0.06);
    border-radius: 100px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.examio-splash__bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 100px;
    animation: splashBarLoad 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.examio-splash__label {
    font-size: 0.8rem;
    color: var(--color-text-subtle);
    letter-spacing: 0.05em;
    font-weight: 500;
}

@keyframes splashFadeOut {
    to { opacity: 0; pointer-events: none; visibility: hidden; }
}

@keyframes splashContentIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes splashLogoPulse {
    0%, 100% { box-shadow: 0 0 30px var(--color-primary-glow); }
    50%       { box-shadow: 0 0 60px rgba(108, 99, 255, 0.55); }
}

@keyframes splashBarLoad {
    from { width: 0%; }
    to   { width: 100%; }
}

/* ── Utility Animations ───────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(32px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes floatY {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-12px); }
}

@keyframes orb {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(40px, -30px) scale(1.08); }
    66%  { transform: translate(-20px, 20px) scale(0.95); }
    100% { transform: translate(0, 0) scale(1); }
}

.animate-fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.35s; }
.delay-4 { animation-delay: 0.5s; }
.delay-5 { animation-delay: 0.65s; }
.delay-6 { animation-delay: 0.8s; }

/* ── Validation helpers (kept for Blazor forms) ───────────── */
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid                              { outline: 1px solid #ff4d6d; }
.validation-message                   { color: #ff4d6d; font-size: 0.8rem; }