@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:wght@300;400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:       #0B1F3A;
    --navy-mid:   #1A3354;
    --navy-light: #2A4A6B;
    --slate:      #4A6580;
    --mist:       #E8EFF7;
    --white:      #FFFFFF;
    --gold:       #C9A84C;
    --gold-light: #E8C97A;
    --success:    #2D7D5A;
    --success-bg: #EAF5EF;
    --warn:       #B06A00;
    --warn-bg:    #FFF4E0;
    --danger:     #B03030;
    --danger-bg:  #FAEAEA;
    --info:       #1A5FA0;
    --info-bg:    #EAF1FB;
    --text:       #0B1F3A;
    --text-muted: #5A7A96;
    --border:     #D4DDE8;
    --surface:    #F5F8FC;
    --radius-sm:  6px;
    --radius-md:  12px;
    --radius-lg:  20px;
    --radius-xl:  32px;
    --shadow-sm:  0 1px 3px rgba(11,31,58,.06), 0 1px 2px rgba(11,31,58,.04);
    --shadow-md:  0 4px 16px rgba(11,31,58,.08), 0 1px 4px rgba(11,31,58,.04);
    --shadow-lg:  0 12px 40px rgba(11,31,58,.12), 0 4px 12px rgba(11,31,58,.06);
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body:    'DM Sans', system-ui, sans-serif;
    --transition:   all .2s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,h2,h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.1rem; font-weight: 600; }
p  { color: var(--text-muted); line-height: 1.75; }

a { color: var(--navy); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold); }

/* Layout */
.container { max-width: 1160px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }

/* Nav */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    height: 68px;
    display: flex; align-items: center;
}
.nav-inner {
    max-width: 1160px; margin: 0 auto; width: 100%;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--navy);
    display: flex; align-items: center; gap: .5rem;
}
.nav-logo span { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { font-size: .9rem; font-weight: 500; color: var(--text-muted); }
.nav-links a:hover { color: var(--navy); }
.nav-cta { display: flex; gap: .75rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .65rem 1.4rem;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: .9rem; font-weight: 500;
    cursor: pointer; border: none;
    transition: var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: var(--navy);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--navy-mid);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-gold {
    background: var(--gold);
    color: var(--navy);
}
.btn-gold:hover {
    background: var(--gold-light);
    color: var(--navy);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}
.btn-outline:hover {
    border-color: var(--navy);
    color: var(--navy);
    background: var(--mist);
}
.btn-lg { padding: .85rem 2rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: .45rem 1rem; font-size: .82rem; }
.btn-block { width: 100%; justify-content: center; }

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}
.card-elevated {
    box-shadow: var(--shadow-md);
}

/* Form elements */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .85rem; font-weight: 500; color: var(--navy); margin-bottom: .4rem; }
.form-input {
    width: 100%; padding: .7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-body); font-size: .95rem;
    color: var(--text); background: var(--white);
    transition: var(--transition);
    outline: none;
}
.form-input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11,31,58,.08); }
.form-input::placeholder { color: var(--text-muted); opacity: .7; }
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: .3rem; }
.form-error { font-size: .82rem; color: var(--danger); margin-top: .3rem; }

/* Pills & badges */
.pill {
    display: inline-flex; align-items: center;
    padding: .25rem .75rem;
    border-radius: 99px;
    font-size: .78rem; font-weight: 500;
}
.pill-success { background: var(--success-bg); color: var(--success); }
.pill-warn    { background: var(--warn-bg);    color: var(--warn);    }
.pill-danger  { background: var(--danger-bg);  color: var(--danger);  }
.pill-info    { background: var(--info-bg);    color: var(--info);    }
.pill-muted   { background: var(--mist);       color: var(--slate);   }

/* Divider */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* Alert */
.alert { padding: 1rem 1.25rem; border-radius: var(--radius-md); font-size: .9rem; margin-bottom: 1rem; }
.alert-danger  { background: var(--danger-bg);  color: var(--danger); border: 1px solid rgba(176,48,48,.15); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(45,125,90,.15); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border: 1px solid rgba(26,95,160,.15); }
.alert-warn    { background: var(--warn-bg);    color: var(--warn);    border: 1px solid rgba(176,106,0,.15); }

/* Score ring */
.score-display {
    display: flex; flex-direction: column; align-items: center;
    gap: .25rem;
}
.score-number { font-family: var(--font-display); font-size: 3rem; color: var(--navy); line-height: 1; }
.score-label  { font-size: .8rem; color: var(--text-muted); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; }

/* Progress bar */
.progress-wrap { background: var(--mist); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--gold); transition: width .6s ease; }
.progress-fill-navy { background: var(--navy); }
.progress-fill-success { background: var(--success); }

/* Utility */
.text-muted   { color: var(--text-muted); }
.text-navy    { color: var(--navy); }
.text-gold    { color: var(--gold); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-sm      { font-size: .875rem; }
.text-xs      { font-size: .78rem; }
.font-display { font-family: var(--font-display); }
.fw-500       { font-weight: 500; }
.fw-600       { font-weight: 600; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.25rem; }
@media(max-width:640px) { .grid-2,.grid-3 { grid-template-columns: 1fr; } }

/* Page wrapper with top padding for fixed nav */
.page { padding-top: 68px; }

/* Section spacing */
.section { padding: 6rem 0; }
.section-sm { padding: 3.5rem 0; }

/* Footer */
.footer {
    background: var(--navy);
    color: rgba(255,255,255,.6);
    padding: 3rem 0;
    font-size: .875rem;
}
.footer a { color: rgba(255,255,255,.7); }
.footer a:hover { color: var(--gold); }

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .6s ease forwards; }
.fade-up-2 { animation: fadeUp .6s .15s ease both; }
.fade-up-3 { animation: fadeUp .6s .3s ease both; }
.fade-up-4 { animation: fadeUp .6s .45s ease both; }

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface);
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--navy);
    background: var(--mist);
}
.upload-zone input[type=file] { display: none; }

/* Dashboard sidebar layout */
.dash-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 68px);
}
.dash-sidebar {
    background: var(--navy);
    padding: 2rem 0;
    position: sticky; top: 68px;
    height: calc(100vh - 68px);
    overflow-y: auto;
}
.dash-sidebar .nav-item {
    display: flex; align-items: center; gap: .75rem;
    padding: .75rem 1.5rem;
    color: rgba(255,255,255,.6);
    font-size: .9rem; font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}
.dash-sidebar .nav-item:hover,
.dash-sidebar .nav-item.active {
    color: var(--white);
    background: rgba(255,255,255,.08);
}
.dash-sidebar .nav-item.active { border-left: 3px solid var(--gold); }
.dash-main { padding: 2rem; background: var(--surface); }
@media(max-width:768px) {
    .dash-layout { grid-template-columns: 1fr; }
    .dash-sidebar { position: static; height: auto; }
}

/* Metric card */
.metric-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
}
.metric-label { font-size: .78rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .4rem; }
.metric-value { font-family: var(--font-display); font-size: 2rem; color: var(--navy); line-height: 1; }
.metric-delta { font-size: .82rem; margin-top: .3rem; }
.metric-delta.up   { color: var(--success); }
.metric-delta.down { color: var(--danger); }

/* Queue position badge */
.queue-badge {
    display: inline-flex; flex-direction: column; align-items: center;
    background: var(--navy);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    min-width: 120px;
}
.queue-number { font-family: var(--font-display); font-size: 3.5rem; line-height: 1; color: var(--gold); }
.queue-label  { font-size: .75rem; opacity: .7; margin-top: .25rem; letter-spacing: .08em; text-transform: uppercase; }
