/* ==========================================================================
   SoftEdu — Auth pages design system, v3
   Minimal centered card, one professional sans typeface throughout (Inter),
   quiet neutral background. Colors sampled from the SoftEdu logo
   (navy #000066, gold #E2AF1D), used sparingly as accents, not as blocks.
   Shared by candidate/staff login so both read as one product.
   ========================================================================== */

@import url('../fonts/fonts.css'); /* self-hosted — works with no internet */

:root {
  --ink-navy: #000066;
  --ink-navy-deep: #000047;
  --scholar-gold: #E2AF1D;
  --gold-deep: #B8890F;

  --bg: #F5F6F9;
  --card: #FFFFFF;
  --ink: #1B1C2B;
  --ink-soft: #6B6D80;
  --line: #E3E4EC;
  --line-strong: #CBCDDB;
  --error: #B3261E;
  --error-bg: #FCEDEC;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius: 16px;
  --radius-sm: 9px;

  /* ---- Legacy tokens kept for app.css (dashboard/exam-player/admin) ----
     app.css was built against the older auth.css and reads these names
     directly; it doesn't know about --bg/--card/--ink above. Login markup
     itself never references these — only var(--font) etc. — so the login
     redesign stays pure Inter while the rest of the app keeps its existing
     look untouched. */
  --paper: #FBF9F3;
  --card-white: #FFFFFF;
  --ink-gray: #33334D;
  --ink-gray-soft: #6C6C85;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Same faint dot texture as the dashboard shell (app.css body.app), plus a
   soft directional gradient so the login page isn't perfectly flat. */
body {
  border-top: 3px solid var(--ink-navy);
  background-image:
    radial-gradient(rgba(51,51,77,0.08) 1px, transparent 1px),
    linear-gradient(160deg, #FDFDFE 0%, var(--bg) 55%, #ECEDF3 100%);
  background-size: 22px 22px, 100% 100%;
  background-position: -11px -11px, 0 0;
  background-attachment: fixed, fixed;
}

a { color: inherit; }

.page {
  min-height: calc(100vh - 3px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

/* ---- Logo ---- */
.logo {
  display: block;
  height: 30px;
  width: auto;
  margin: 0 auto 28px;
}

/* ---- Card ---- */
.card {
  width: 100%;
  max-width: 404px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15,15,40,0.04), 0 16px 40px -18px rgba(15,15,40,0.16);
  padding: 36px 34px 32px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 18px;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-candidate { background: rgba(226,175,29,0.14); color: var(--gold-deep); }
.badge-staff { background: rgba(0,0,102,0.08); color: var(--ink-navy); }

.card-heading {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-navy-deep);
  margin: 0 0 6px;
}

.card-subtext {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 26px;
  line-height: 1.55;
}

/* ---- Alert ---- */
.alert {
  display: none;
  align-items: flex-start;
  gap: 8px;
  background: var(--error-bg);
  border: 1px solid #F1C4C1;
  color: var(--error);
  font-size: 13.5px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}
.alert.visible { display: flex; }

/* ---- Form ---- */
.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 11px 13px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Registration number: same typeface, just tabular figures and a touch
   of tracking so it reads cleanly as an ID rather than prose. */
.field input.id-field {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.field input::placeholder { color: #ADAFC2; }
.field input:hover { border-color: #B7B9CC; }

.field input:focus {
  outline: none;
  border-color: var(--ink-navy);
  box-shadow: 0 0 0 4px rgba(0,0,102,0.10);
}
[data-portal="candidate"] .field input:focus {
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 4px rgba(226,175,29,0.18);
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--ink-soft);
}
.field-row strong { color: var(--ink); font-weight: 600; }

/* ---- Buttons ---- */
.btn {
  width: 100%;
  padding: 12.5px 20px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--scholar-gold); outline-offset: 2px; }

.btn-navy { background: var(--ink-navy); color: #fff; }
.btn-navy:hover { background: var(--ink-navy-deep); }

.btn-gold { background: var(--scholar-gold); color: var(--ink-navy-deep); }
.btn-gold:hover { background: var(--gold-deep); color: #fff; }

.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn-gold .spinner { border-color: rgba(0,0,71,0.3); border-top-color: var(--ink-navy-deep); }
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-label { opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Card footer / page footer ---- */
.card-footer {
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 16px;
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: center;
}

.page-footer {
  margin-top: 24px;
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: center;
}

.portal-switch {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 12.5px;
}
.portal-switch a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
}
.portal-switch a:hover { color: var(--ink-navy); }
.portal-switch a.current { color: var(--ink-navy); border-bottom: 2px solid var(--scholar-gold); padding-bottom: 2px; }

@media (max-width: 480px) {
  .card { padding: 30px 22px 26px; }
}
