/* ==========================================================================
   SoftEdu — Candidate access screen.

   A dedicated stylesheet for this one page, deliberately NOT auth.css.
   auth.css/app.css's token names (--paper, --card-white, --font-display,
   etc.) are load-bearing for the rest of the app — staff login, the
   dashboard shell, the admin console — so this file never touches them;
   it defines its own tokens and its own markup contract, entirely
   sandboxed to candidate-login.blade.php.

   Design idea: an examination admission card, not a SaaS login card.
   A hard-edged two-panel masthead (ink panel + paper panel) rather than a
   rounded card floating on a grey field — the split IS the layout, not a
   card centered on a background. Fraunces/Work Sans/IBM Plex Mono are
   already this product's type system (see app.css) — the candidate portal
   is the one place that system never actually reached; this is that
   catch-up, not a new identity.

   One committed visual world, not a light/dark pair — an admission card
   reads the same regardless of the device it's shown on, the same way a
   printed one would. Every color below is set explicitly rather than
   inherited, so that holds on any screen.
   ========================================================================== */

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

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

  --paper: #FBF9F3;
  --paper-line: #E1DECF;

  --text: #1B1C2B;
  --text-soft: #6B6D80;
  --input-border: #C9CBDA;

  --on-ink: #F4F3ED;
  --on-ink-soft: rgba(244, 243, 237, 0.62);
  --on-ink-line: rgba(244, 243, 237, 0.16);

  --error: #B3261E;
  --error-bg: #FCEDEC;

  --font-display: 'Fraunces', Georgia, 'Iowan Old Style', serif;
  --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --radius: 8px;
}

* { box-sizing: border-box; }

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

a { color: inherit; }

.stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}

/* ---------------------------------------------------------------------- *
 * Masthead panel — the thesis. Deep ink ground, a restrained wordmark,
 * and a slow analog clock: the one honest decorative idea a TIMED exam
 * platform earns for free, instead of a stock gradient or blob.
 * ---------------------------------------------------------------------- */
.masthead {
  position: relative;
  background:
    radial-gradient(120% 90% at 15% 0%, var(--ink) 0%, var(--ink-deep) 62%),
    var(--ink-deep);
  color: var(--on-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 48px;
  overflow: hidden;
}

/* A faint engraved guilloche-like line texture — the kind of fine
   repeating linework printed on a security document or exam admission
   card, at ~2% opacity so it reads as paper grain, not decoration. */
.masthead::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    115deg, rgba(244,243,237,0.05) 0px, rgba(244,243,237,0.05) 1px,
    transparent 1px, transparent 26px
  );
  pointer-events: none;
}

.masthead-inner {
  position: relative;
  width: 100%;
  max-width: 420px;
  animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* A typographic re-statement of the print logo's own idea (navy wordmark,
   "Edu" struck through on a gold badge) rather than the raster mark
   itself — the PNG's navy strokes and reversed-out white "Edu." depend on
   sitting over WHITE, and would either vanish (navy-on-navy) or lose
   their own internal contrast (white-on-gold-turned-white by an invert
   filter) on this dark ground. Rebuilding it in type keeps the same
   brand idea correct on any background, on this panel's own terms. */
.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 23px;
  letter-spacing: 0.005em;
  color: var(--on-ink);
  margin-bottom: 4px;
}
.wordmark .edu {
  display: inline-block;
  background: var(--gold);
  color: var(--ink-deep);
  padding: 1px 9px 3px;
  border-radius: 5px;
  margin-left: 1px;
}

.tagline {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 44px;
}

.headline {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(34px, 4vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--on-ink);
  margin: 0 0 40px;
  text-wrap: balance;
}
.headline em {
  font-style: italic;
  font-weight: 460;
  color: var(--gold);
}

/* ---- Clock motif ---- */
.clock-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 32px;
  border-top: 1px solid var(--on-ink-line);
}
.clock {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
}
.clock svg { width: 100%; height: 100%; display: block; }
.clock-tick { stroke: var(--on-ink-soft); stroke-width: 1.5; }
.clock-tick.major { stroke: var(--on-ink); stroke-width: 2; }
.clock-hand { stroke-linecap: round; transform-box: view-box; transform-origin: 100px 100px; }
.clock-hand.hour { stroke: var(--on-ink); stroke-width: 6; }
.clock-hand.minute { stroke: var(--on-ink); stroke-width: 4; }
.clock-hand.second {
  stroke: var(--gold);
  stroke-width: 2.5;
  animation: tick 60s steps(60) infinite;
}
@keyframes tick { to { transform: rotate(360deg); } }

.clock-caption { font-size: 13.5px; color: var(--on-ink-soft); line-height: 1.5; max-width: 22ch; }
.clock-caption strong { color: var(--on-ink); font-weight: 600; }

/* ---------------------------------------------------------------------- *
 * Access panel — the form. Paper ground, minimal copy, mono ID field.
 * ---------------------------------------------------------------------- */
.access {
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 40px;
}

.access-inner {
  width: 100%;
  max-width: 360px;
  animation: rise 0.7s 0.08s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 14px;
}

.access h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.01em;
  color: var(--ink-deep);
  margin: 0 0 30px;
  text-wrap: balance;
}

.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);
  margin-bottom: 20px;
}
.alert.visible { display: flex; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}
.field input {
  width: 100%;
  padding: 12px 13px;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input.id-field {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  font-weight: 500;
}
.field input::placeholder { color: #B3B5C4; }
.field input:hover { border-color: #ADAFC2; }
.field input:focus {
  outline: none;
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 4px rgba(226, 175, 29, 0.16);
}

.btn-submit {
  width: 100%;
  margin-top: 8px;
  padding: 13px 20px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-deep);
  background: var(--gold);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn-submit:hover { background: var(--gold-deep); color: #fff; }
.btn-submit:active { transform: translateY(1px); }
.btn-submit:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.btn-submit[disabled] { opacity: 0.6; cursor: not-allowed; }

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

.helper {
  font-size: 13px;
  color: var(--text-soft);
  margin: 20px 0 0;
  line-height: 1.55;
}
.helper strong { color: var(--text); font-weight: 600; }

.access-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--paper-line);
  font-size: 12.5px;
  color: var(--text-soft);
}
.access-footer a { font-weight: 600; text-decoration: none; color: var(--text-soft); }
.access-footer a:hover { color: var(--ink); }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .masthead-inner, .access-inner { animation: none; }
  .clock-hand.second { animation: none; }
}

/* ---------------------------------------------------------------------- *
 * Responsive — stack to a compact top masthead band under ~900px.
 * ---------------------------------------------------------------------- */
@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .masthead { padding: 36px 28px; }
  .masthead-inner { max-width: none; }
  .tagline { margin-bottom: 28px; }
  .headline { font-size: 26px; margin-bottom: 26px; }
  .clock-row { padding-top: 22px; gap: 16px; }
  .clock { width: 56px; height: 56px; }
  .access { padding: 36px 28px 44px; }
}

@media (max-width: 480px) {
  .access-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
}
