/* ====================================================================
   HyreSpot Post-Training Assessment Portal
   Brand: Deep Navy #0D1B5E  |  Neutral surfaces, subtle depth
   ==================================================================== */

:root {
  --navy-950: #070E33;
  --navy-900: #0A1240;
  --navy-800: #0D1B5E;   /* primary */
  --navy-700: #15246F;
  --navy-600: #1D2F86;
  --navy-500: #2A3D9E;

  --ink:        #161F33;
  --ink-soft:   #4A5468;
  --ink-muted:  #6B7488;

  --surface:      #FFFFFF;
  --surface-alt:  #F5F7FB;
  --surface-tint: #EEF1F9;
  --border:       #E2E7F1;
  --border-strong:#CFD6E6;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(13, 27, 94, .06);
  --shadow:    0 6px 20px rgba(13, 27, 94, .08);
  --shadow-lg: 0 16px 40px rgba(13, 27, 94, .12);

  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface-alt);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--navy-700); }

/* ---------- layout ------------------------------------------------ */
.shell { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 20px; }
.shell-wide { max-width: 940px; }

.site-main { flex: 1 0 auto; padding: 40px 0 64px; }

/* ---------- header ------------------------------------------------ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  max-width: 940px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand { display: inline-flex; align-items: center; }
.brand-logo { height: 30px; width: auto; }
.header-meta { text-align: right; line-height: 1.3; }
.header-title {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--navy-800);
  letter-spacing: -.01em;
}
.header-sub { display: block; font-size: .75rem; color: var(--ink-muted); }

/* ---------- footer ------------------------------------------------ */
.site-footer { background: var(--navy-800); color: #C9D0EA; margin-top: auto; }
.footer-inner {
  max-width: 940px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 22px;
}
.footer-logo { height: 22px; width: auto; opacity: .95; }
.footer-text { margin: 0; font-size: .8125rem; }

/* ---------- cards ------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
}
.card + .card { margin-top: 20px; }
.card-landing { padding: 40px 36px; }

.card-title {
  margin: 12px 0 8px;
  font-size: 1.75rem;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: var(--navy-800);
  font-weight: 700;
}
.card-sub { margin: 0 0 24px; color: var(--ink-soft); }

.section-heading {
  margin: 0 0 20px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy-800);
  letter-spacing: -.01em;
}

/* ---------- pills & tags ------------------------------------------ */
.pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--navy-700);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.pill-muted { background: #F0F2F7; color: var(--ink-soft); }
.pill-success { background: var(--navy-800); color: #fff; }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--surface-tint);
  color: var(--navy-700);
}
.tag-pending { background: #F0F2F7; color: var(--ink-muted); }

/* ---------- facts row --------------------------------------------- */
.fact-row {
  list-style: none;
  display: flex;
  gap: 10px;
  margin: 0 0 24px;
  padding: 0;
  flex-wrap: wrap;
}
.fact-row li {
  flex: 1 1 100px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: .8125rem;
  color: var(--ink-soft);
}
.fact-row strong {
  display: block;
  font-size: 1.25rem;
  color: var(--navy-800);
  line-height: 1.2;
}

/* ---------- forms -------------------------------------------------- */
.form { margin-top: 4px; }
.field { margin-bottom: 20px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--ink);
}
.field input, .field select {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(29, 47, 134, .14);
}
.field input.has-error { border-color: #B42318; }
.field-error { display: block; margin-top: 6px; font-size: .8125rem; color: #B42318; }
.field-hint  { display: block; margin-top: 6px; font-size: .8125rem; color: var(--ink-muted); }

/* ---------- buttons ------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-ghost {
  background: var(--surface);
  color: var(--navy-800);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-alt); }
.btn-block { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* ---------- notices ------------------------------------------------ */
.notice {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}
.notice-info  { background: var(--surface-tint); border-color: #D3DAF0; color: var(--navy-700); }
.notice-error { background: #FEF3F2; border-color: #FDA29B; color: #B42318; }

.fine-print { margin: 20px 0 0; font-size: .8125rem; color: var(--ink-muted); }
.fine-print.center { text-align: center; }

/* ---------- summary grid (already completed) ----------------------- */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.summary-item { background: var(--surface); padding: 14px 16px; }
.summary-label {
  display: block;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-muted);
  font-weight: 600;
}
.summary-value { display: block; font-weight: 600; color: var(--ink); }

/* ---------- assessment: candidate bar ------------------------------ */
.candidate-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.candidate-identity { min-width: 0; }
.candidate-name { display: block; font-weight: 700; color: var(--navy-800); }
.candidate-email {
  display: block;
  font-size: .8125rem;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}
.progress-block { flex: 1 1 280px; min-width: 220px; }
.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.progress-track {
  height: 8px;
  background: var(--surface-tint);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--navy-800);
  border-radius: 999px;
  transition: width .25s ease;
}

/* ---------- assessment: question ----------------------------------- */
.card-question { padding: 28px 32px 24px; }
.question-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.section-tag {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--navy-600);
}
.type-tag {
  font-size: .75rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
}
.question-text {
  margin: 0 0 22px;
  font-size: 1.25rem;
  line-height: 1.45;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
}

.options { display: grid; gap: 10px; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.option:hover { border-color: var(--navy-500); background: #FAFBFF; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option-marker {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: .8125rem;
  font-weight: 700;
  transition: all .15s ease;
}
.option-marker.circle { border-radius: 50%; }
.option-marker.square { border-radius: 7px; }
.option-text { flex: 1 1 auto; color: var(--ink); }
.option.is-selected {
  border-color: var(--navy-800);
  background: var(--surface-tint);
  box-shadow: 0 0 0 1px var(--navy-800) inset;
}
.option.is-selected .option-marker {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}
.option:focus-within { box-shadow: 0 0 0 3px rgba(29, 47, 134, .16); }

.question-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.question-nav .btn-primary { margin-left: auto; }
.save-state {
  margin-left: auto;
  font-size: .8125rem;
  color: var(--ink-muted);
}
.save-state + .btn { margin-left: 0; }
.save-state.is-error { color: #B42318; }
.save-state.is-hint { color: var(--navy-700); font-weight: 600; }
.save-state a { margin-left: 2px; color: var(--navy-700); }

/* ---------- result -------------------------------------------------- */
.card-result { text-align: center; }
.card-result .card-title { margin-bottom: 4px; }
.result-identity { margin-bottom: 26px; }
.result-name { display: block; font-weight: 600; }
.result-email { display: block; font-size: .875rem; color: var(--ink-muted); }

.score-block {
  background: var(--navy-800);
  border-radius: var(--radius-lg);
  padding: 30px 24px 26px;
  color: #fff;
}
.score-block.tone-good { background: var(--navy-700); }
.score-block.tone-needs-improvement { background: var(--navy-900); }
.score-figure { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.score-value { font-size: 4rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.score-total { font-size: 1.5rem; font-weight: 600; opacity: .75; }
.score-percent { margin-top: 6px; font-size: 1.125rem; font-weight: 600; opacity: .9; }
.score-meter {
  margin: 20px auto 0;
  max-width: 420px;
  height: 8px;
  background: rgba(255, 255, 255, .22);
  border-radius: 999px;
  overflow: hidden;
}
.score-meter span { display: block; height: 100%; background: #fff; border-radius: 999px; }

.verdict-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 24px;
  text-align: left;
}
.verdict-item { background: var(--surface); padding: 16px 18px; }
.verdict-value { display: block; font-weight: 600; color: var(--navy-800); }

.section-list { display: grid; gap: 18px; }
.section-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .9375rem;
  margin-bottom: 8px;
}
.section-name { font-weight: 600; color: var(--ink); }
.section-score { font-weight: 700; color: var(--navy-800); white-space: nowrap; }
.section-meter { height: 8px; background: var(--surface-tint); border-radius: 999px; overflow: hidden; }
.section-meter span { display: block; height: 100%; background: var(--navy-600); border-radius: 999px; }

.card-thanks { text-align: center; }
.thanks-text { margin: 0; font-weight: 600; color: var(--navy-800); }
.card-thanks .actions { justify-content: center; }

/* ---------- admin --------------------------------------------------- */
.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.admin-head .card-title { margin-top: 0; }
.admin-head .card-sub { margin-bottom: 0; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}
.kpi-label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.kpi-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy-800);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.kpi-suffix { font-size: .9375rem; font-weight: 600; color: var(--ink-muted); }

.filter-bar {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 20px 24px;
}
.field-inline { margin-bottom: 0; flex: 1 1 180px; }
.filter-actions { display: flex; gap: 10px; }

.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 860px; }
.data-table th {
  text-align: left;
  padding: 14px 18px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}
.data-table td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #FAFBFF; }
.cell-muted { color: var(--ink-muted); }
.table-empty { text-align: center; color: var(--ink-muted); padding: 32px 18px; }
.link-action { font-weight: 600; text-decoration: none; white-space: nowrap; }
.link-action:hover { text-decoration: underline; }

/* ---------- responsive ---------------------------------------------- */
@media (max-width: 720px) {
  .site-main { padding: 24px 0 48px; }
  .card { padding: 24px 20px; border-radius: var(--radius); }
  .card-landing { padding: 28px 20px; }
  .card-question { padding: 22px 20px 20px; }
  .card-title { font-size: 1.4rem; }
  .question-text { font-size: 1.0625rem; }
  .header-sub { display: none; }
  .brand-logo { height: 26px; }
  .candidate-bar { padding: 16px; gap: 14px; }
  .verdict-grid, .summary-grid { grid-template-columns: 1fr; }
  .score-value { font-size: 3rem; }
  .footer-inner { flex-direction: column; text-align: center; gap: 10px; }
  .option { padding: 14px 16px; }
  .question-nav { flex-wrap: wrap; }
  .question-nav .btn { flex: 1 1 auto; }
  .save-state { order: 3; flex: 1 1 100%; text-align: center; margin-left: 0; }
  .filter-bar { padding: 16px; }
  .filter-actions { width: 100%; }
  .filter-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ====================================================================
   Authentication layer — candidate email verification + admin login
   Additive only; nothing above is modified.
   ==================================================================== */

/* ---------- candidate verification feedback ------------------------ */
.field-error:empty { display: none; }

.field-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  font-size: .8125rem;
  font-weight: 600;
  color: #067647;
  background: #ECFDF3;
  border: 1px solid #A9E5C3;
  border-radius: 999px;
}
.field-verified[hidden] { display: none; }

.notice-success {
  background: #ECFDF3;
  border-color: #A9E5C3;
  color: #067647;
}

/* ---------- admin header actions ----------------------------------- */
.admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-who {
  margin: 6px 0 0;
  font-size: .8125rem;
  color: var(--ink-muted);
}
.admin-head > div:first-child { flex: 1 1 320px; min-width: 0; }

/* ---------- approved candidate management -------------------------- */
.field textarea {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  resize: vertical;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(29, 47, 134, .14);
}

.filter-bar-plain {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0;
  margin: 0 0 4px;
  background: none;
  border: 0;
  box-shadow: none;
}
.filter-bar-plain .field-inline { flex: 1 1 220px; }

.tag-active   { background: #ECFDF3; color: #067647; }
.tag-inactive { background: #FEF3F2; color: #B42318; }

.row-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}
.inline-form { display: inline; margin: 0; }

button.link-action {
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--navy-700);
  background: none;
  border: 0;
  cursor: pointer;
}
button.link-action:hover { text-decoration: underline; }
.link-danger { color: #B42318; }

/* ---------- email verification code step --------------------------- */
.code-input {
  font-size: 1.5rem !important;
  letter-spacing: .5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.code-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.code-actions .link-action[disabled] {
  color: var(--ink-muted);
  cursor: default;
  text-decoration: none;
}
