/* ============================================================
   School of Evangelism — Registration Form (Server A)
   BCU Theme — Navy & Gold (Bootstrap Christian University)

   ALL colours are declared once as custom properties on :root
   and referenced via var(...) everywhere else — no ad-hoc hex
   values appear outside the :root block.

   Contrast note: gold (#F5A800) fails contrast on white at body
   sizes, so it is used only for the large form title, thin
   dividers, focus rings and button hover accents.
   ============================================================ */

:root {
  /* ---- BCU brand tokens (official) ---- */
  --bcu-navy:    #1B3A6B; /* Primary */
  --bcu-gold:    #F5A800; /* Accent */
  --bcu-success: #EAF6EC; /* Success / confirmed background */
  --bcu-warning: #FEF5E0; /* Warning / notice background */
  --bcu-action:  #FDEDEC; /* Error / needs-action background */
  --bcu-text:    #000000; /* Body text */
  --bcu-bg:      #FFFFFF; /* Page background */

  /* ---- Supplementary BCU tokens ----
     Declared here (and only here) so no other rule needs a raw value:
     dark red for error text/borders readable on --bcu-action, muted
     body text, grey tokens for the FOR OFFICE USE ONLY block, a
     navy-tinted card shadow and the spinner track on the navy button. */
  --bcu-danger:        #8B1A1A;
  --bcu-muted:         #444444;
  --bcu-office-bg:     #F2F2F2;
  --bcu-office-line:   #A6A6A6;
  --bcu-shadow:        rgba(27, 58, 107, 0.16);
  --bcu-spinner-track: rgba(255, 255, 255, 0.45);

  /* Office dashboard (office.html) supplementary tokens */
  --bcu-line-soft:     rgba(27, 58, 107, 0.18); /* table row rules */
  --bcu-hover:         rgba(27, 58, 107, 0.06); /* row hover wash */
  --bcu-overlay:       rgba(27, 58, 107, 0.55); /* modal backdrop */
  --bcu-drop:          rgba(0, 0, 0, 0.25);     /* modal drop shadow */
  --bcu-chip-line:     rgba(255, 255, 255, 0.45); /* signed-in chip on navy */
}

* { box-sizing: border-box; }

/* The `hidden` attribute must always win — even over author display rules
   (e.g. .modal-overlay uses display:flex and would otherwise stay visible
   while hidden, blocking clicks on the whole dashboard). */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bcu-bg);
  color: var(--bcu-text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 16px 44px;
}

.paper {
  background: var(--bcu-bg);
  border: 1.5px solid var(--bcu-navy);
  box-shadow: 0 3px 14px var(--bcu-shadow);
  padding: 28px clamp(16px, 4vw, 36px) 32px;
}

/* ---------- header ---------- */

.form-header {
  text-align: center;
  border-bottom: 6px solid var(--bcu-navy); /* thick navy divider under the header */
  padding-bottom: 20px;
  margin-bottom: 8px;
}

.uni-name {
  color: var(--bcu-navy);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin: 0 0 8px;
}

.form-header h1 {
  color: var(--bcu-gold); /* main form title — gold (large text only) */
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.5rem, 4vw, 2.05rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.25;
  margin: 0 0 14px;
}

.notice {
  display: inline-block;
  margin: 0;
  padding: 8px 16px;
  border: 1px solid var(--bcu-gold);
  background: var(--bcu-warning); /* header note on the warning background */
  color: var(--bcu-navy);
  font-weight: 600;
}

/* ---------- sections ---------- */

.section {
  border: 1.5px solid var(--bcu-navy);
  border-radius: 4px;
  margin: 28px 0 0;
  padding: 6px 18px 18px;
  min-width: 0;
}

.section legend {
  color: var(--bcu-navy); /* section headings / legends — navy */
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.05em;
  padding: 4px 14px;
  border: 1.5px solid var(--bcu-navy);
  border-bottom: 3px solid var(--bcu-gold); /* thin gold divider under every section heading */
  border-radius: 3px;
  background: var(--bcu-bg);
}

/* ---------- 1. registration fee ---------- */

.fee-note {
  margin: 16px 0 12px;
  padding: 9px 14px;
  border: 1px solid var(--bcu-gold);
  background: var(--bcu-warning); /* fee-deadline notice on warning background */
  color: var(--bcu-navy);
  font-weight: 600;
}

.fee-table {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid var(--bcu-navy);
}

.fee-table th {
  background: var(--bcu-navy); /* table header rows: white text on navy */
  color: var(--bcu-bg);
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--bcu-navy);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fee-table td {
  border: 1px solid var(--bcu-navy);
  padding: 10px 12px;
  vertical-align: middle;
}

.fee-choice { width: 44px; text-align: center; }

.fee-choice input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--bcu-navy);
  cursor: pointer;
}

.fee-choice input[type="radio"]:focus-visible {
  outline: 3px solid var(--bcu-gold);
  outline-offset: 2px;
}

.fee-option-name { font-weight: 600; }

.fee-amount {
  color: var(--bcu-navy);
  font-weight: 800;
  white-space: nowrap;
}

/* Selected fee option row: warning background + navy left border */
.fee-row.is-selected,
.fee-row:has(input[type="radio"]:checked) {
  background: var(--bcu-warning);
  box-shadow: inset 4px 0 0 var(--bcu-navy);
}

/* ---------- field grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  margin-top: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.span-2 { grid-column: 1 / -1; }

.field label {
  color: var(--bcu-navy); /* label cells / labels — navy */
  font-weight: 600;
  font-size: 0.92rem;
}

.req { color: var(--bcu-danger); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--bcu-text);
  padding: 10px 12px;
  border: 1px solid var(--bcu-navy); /* input borders — navy */
  border-radius: 4px;
  background: var(--bcu-bg);
  width: 100%;
  min-height: 44px; /* touch-friendly targets */
}

.field textarea { resize: vertical; }

/* Focus state gets a gold outline */
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid var(--bcu-gold);
  outline-offset: 1px;
  border-color: var(--bcu-navy);
}

/* Inline validation: red border + needs-action background */
.is-invalid input,
.is-invalid select,
.is-invalid textarea {
  border-color: var(--bcu-danger);
  background: var(--bcu-action);
}

.field-error {
  color: var(--bcu-danger); /* dark red text on the action background */
  background: var(--bcu-action);
  border: 1px solid var(--bcu-danger);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 8px;
  margin: 0;
}

.field-hint {
  color: var(--bcu-muted);
  font-size: 0.8rem;
  margin: 0;
}

/* ---------- declaration / payment note ---------- */

.declaration {
  border: 1px solid var(--bcu-navy);
  border-left: 6px solid var(--bcu-gold); /* gold accent */
  background: var(--bcu-bg);
  padding: 12px 16px;
  margin: 18px 0 4px;
  font-style: italic;
}

.payment-note {
  margin: 20px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--bcu-navy);
  font-weight: 600;
}

.payment-note strong { color: var(--bcu-navy); }

/* ---------- banners ---------- */

.success-banner,
.error-banner {
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 6px;
  margin: 16px 0 0;
}

.error-banner {
  background: var(--bcu-action); /* failed-submission banner */
  border: 1.5px solid var(--bcu-danger);
  color: var(--bcu-danger);
}

.success-banner {
  background: var(--bcu-success);
  border: 1.5px solid var(--bcu-navy);
  color: var(--bcu-navy);
}

/* ---------- submit ---------- */

.submit-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.btn-submit {
  min-height: 46px;
  padding: 12px 24px;
  background: var(--bcu-navy); /* navy background, white text */
  color: var(--bcu-bg);
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid var(--bcu-navy);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* gold hover accent */
.btn-submit:hover:not(:disabled) {
  background: var(--bcu-gold);
  border-color: var(--bcu-navy);
  color: var(--bcu-navy);
}

.btn-submit:focus-visible {
  outline: 3px solid var(--bcu-gold); /* gold focus ring */
  outline-offset: 2px;
}

.btn-submit:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid var(--bcu-spinner-track);
  border-top-color: var(--bcu-gold);
  border-radius: 50%;
  display: none;
  animation: spin 0.8s linear infinite;
}

.is-loading .btn-spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

.hint {
  color: var(--bcu-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ---------- confirmation ---------- */

.confirmation {
  text-align: center;
  padding: 36px 20px;
  background: var(--bcu-success); /* success panel background */
  border: 2px solid var(--bcu-navy);
  border-radius: 4px;
  color: var(--bcu-navy); /* navy text on the success background */
}

.confirmation h2 {
  font-family: Georgia, "Times New Roman", serif;
  margin: 0 0 10px;
}

.confirmation p { margin: 6px 0; }

.receipt-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--bcu-navy);
  margin-top: 18px !important;
}

.receipt-number {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--bcu-navy);
  border: 2px solid var(--bcu-navy);
  display: inline-block;
  padding: 10px 28px;
  margin: 8px 0 20px !important;
  background: var(--bcu-bg);
}

.btn-print {
  min-height: 44px;
  padding: 10px 22px;
  border: 2px solid var(--bcu-navy);
  background: var(--bcu-bg);
  color: var(--bcu-navy);
  font-weight: 700;
  cursor: pointer;
  border-radius: 6px;
}

.btn-print:hover { background: var(--bcu-warning); }

.btn-print:focus-visible {
  outline: 3px solid var(--bcu-gold);
  outline-offset: 2px;
}

/* ---------- office use only ---------- */

.office-block {
  margin-top: 30px;
  border: 2px dashed var(--bcu-office-line);
  background: var(--bcu-office-bg); /* grey block */
  padding: 14px 20px 20px;
  border-radius: 4px;
}

.office-title {
  text-align: center;
  letter-spacing: 0.14em;
  font-size: 0.95rem;
  margin: 0 0 16px;
  font-weight: 800;
  color: var(--bcu-navy); /* navy labels in the office block */
}

.office-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 26px;
}

.office-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  font-size: 0.92rem;
}

.office-label { color: var(--bcu-navy); }

.office-line {
  display: block;
  border-bottom: 1.5px solid var(--bcu-office-line);
  min-height: 28px;
  padding: 2px 4px;
  font-family: Georgia, "Times New Roman", serif;
}

.office-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  min-height: 28px;
  color: var(--bcu-navy);
}

.office-checkbox input { accent-color: var(--bcu-navy); }

/* ---------- footer (sticky bottom of the viewport) ---------- */

.site-footer {
  flex-shrink: 0;
  margin-top: auto;
  text-align: center;
  color: var(--bcu-navy);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 14px;
  border-top: 3px solid var(--bcu-gold);
}

.footer-link {
  color: var(--bcu-navy);
  font-weight: 700;
  text-decoration: underline;
}

.footer-link:hover { color: var(--bcu-danger); }

.footer-link:focus-visible {
  outline: 3px solid var(--bcu-gold);
  outline-offset: 2px;
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .grid,
  .office-grid {
    grid-template-columns: 1fr;
  }

  .paper { padding: 20px 14px 26px; }

  .section { padding: 4px 12px 14px; }

  /* The fee table collapses to stacked label/field cards. */
  .fee-table,
  .fee-table tbody,
  .fee-table tr,
  .fee-table td {
    display: block;
    width: 100%;
  }

  .fee-table thead { display: none; }

  .fee-table { border: none; }

  .fee-table tr {
    border: 1.5px solid var(--bcu-navy);
    margin-bottom: 10px;
  }

  .fee-table td {
    border: none;
    border-top: 1px solid var(--bcu-office-line);
    padding: 8px 12px;
  }

  .fee-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--bcu-navy);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 2px;
  }

  .fee-row.is-selected { box-shadow: inset 4px 0 0 var(--bcu-navy); }
}

/* ---------- print ---------- */

@media print {
  /* Force colour printing so navy table headers and gold dividers survive. */
  *,
  *::before,
  *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body { background: var(--bcu-bg); }

  .page { max-width: none; padding: 0; }

  .paper {
    box-shadow: none;
    border: none;
    padding: 0;
  }

  .no-print,
  .success-banner,
  .error-banner { display: none !important; }

  .site-footer { display: none; }

  .section,
  .office-block { break-inside: avoid; }

  .fee-table th {
    background: var(--bcu-navy) !important;
    color: var(--bcu-bg) !important;
  }

  .field input,
  .field select,
  .field textarea {
    border-color: var(--bcu-navy);
    background: var(--bcu-bg);
    min-height: auto;
  }
}

/* ============================================================
   OFFICE DASHBOARD (office.html) — view & download registrations
   Reuses the BCU tokens above; no new raw colours.
   ============================================================ */

.office-page { background: var(--bcu-bg); }

/* ---------- header ---------- */

.office-header {
  background: var(--bcu-navy);
  color: var(--bcu-bg);
  border-bottom: 6px solid var(--bcu-gold); /* thick navy/gold header rule */
  padding: 20px clamp(16px, 4vw, 36px);
}

.office-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.office-eyebrow {
  color: var(--bcu-gold);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.72rem;
  margin: 0 0 4px;
}

.office-header h1 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--bcu-bg);
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  margin: 0;
}

.office-subtitle {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--bcu-bg);
  opacity: 0.85;
}

.office-nav { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- buttons ---------- */

.btn-primary {
  min-height: 44px;
  padding: 10px 18px;
  background: var(--bcu-navy);
  color: var(--bcu-bg);
  border: 2px solid var(--bcu-navy);
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary:hover:not(:disabled) {
  background: var(--bcu-gold);
  color: var(--bcu-navy);
}

.btn-outline {
  min-height: 44px;
  padding: 10px 16px;
  background: var(--bcu-bg);
  color: var(--bcu-navy);
  border: 2px solid var(--bcu-navy);
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-outline:hover { background: var(--bcu-warning); }

.btn-outline-light { background: transparent; color: var(--bcu-bg); border-color: var(--bcu-bg); }

.btn-outline-light:hover { background: var(--bcu-bg); color: var(--bcu-navy); }

.btn-primary:focus-visible,
.btn-outline:focus-visible,
.modal-close-x:focus-visible,
.row-actions button:focus-visible,
.table-scroll:focus-visible {
  outline: 3px solid var(--bcu-gold);
  outline-offset: 2px;
}

.btn-primary:disabled, .btn-outline:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-spinner-dark { border-color: var(--bcu-office-line); border-top-color: var(--bcu-navy); }

/* ---------- layout ---------- */

.office-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.office-status {
  margin: 0 0 14px;
  padding: 9px 14px;
  border: 1px solid var(--bcu-navy);
  border-left: 5px solid var(--bcu-gold);
  background: var(--bcu-warning);
  color: var(--bcu-navy);
  font-weight: 600;
  border-radius: 4px;
}

.office-status.is-error {
  background: var(--bcu-action);
  border-color: var(--bcu-danger);
  border-left-color: var(--bcu-danger);
  color: var(--bcu-danger);
}

/* ---------- auth panel ---------- */

.office-auth {
  max-width: 460px;
  margin: 40px auto;
  border: 1.5px solid var(--bcu-navy);
  border-top: 5px solid var(--bcu-gold);
  border-radius: 8px;
  background: var(--bcu-bg);
  box-shadow: 0 3px 14px var(--bcu-shadow);
  padding: 22px 24px;
}

.office-auth h2 { color: var(--bcu-navy); margin: 0 0 8px; font-family: Georgia, "Times New Roman", serif; }

.office-auth p { color: var(--bcu-muted); margin: 0 0 4px; }

.office-auth code { background: var(--bcu-office-bg); padding: 1px 5px; border-radius: 3px; }

.auth-row { display: flex; gap: 10px; margin-top: 12px; }

.auth-row input {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--bcu-navy);
  border-radius: 6px;
  font: inherit;
  color: var(--bcu-text);
  background: var(--bcu-bg);
}

.auth-row input:focus { outline: 3px solid var(--bcu-gold); outline-offset: 1px; }

/* ---------- stats ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat-card {
  border: 1.5px solid var(--bcu-navy);
  border-radius: 6px;
  background: var(--bcu-bg);
  box-shadow: 0 2px 8px var(--bcu-shadow);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-confirmed { background: var(--bcu-success); }

.stat-pending { background: var(--bcu-warning); }

.stat-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bcu-navy);
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bcu-muted);
}

/* ---------- toolbar ---------- */

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 12px; }

.toolbar input[type="search"] {
  flex: 1 1 240px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--bcu-navy);
  border-radius: 6px;
  font: inherit;
  color: var(--bcu-text);
  background: var(--bcu-bg);
}

.toolbar input[type="search"]:focus { outline: 3px solid var(--bcu-gold); outline-offset: 1px; }

/* ---------- table ---------- */

.table-card {
  border: 1.5px solid var(--bcu-navy);
  border-radius: 6px;
  background: var(--bcu-bg);
  box-shadow: 0 3px 14px var(--bcu-shadow);
  overflow: hidden;
}

.table-scroll { max-height: 480px; overflow-y: auto; }

.table-scroll::-webkit-scrollbar { width: 10px; }

.table-scroll::-webkit-scrollbar-track { background: var(--bcu-office-bg); }

.table-scroll::-webkit-scrollbar-thumb {
  background: var(--bcu-navy);
  border-radius: 8px;
  border: 2px solid var(--bcu-office-bg);
}

.reg-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

.reg-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bcu-navy); /* header row: white text on navy */
  color: var(--bcu-bg);
  text-align: left;
  padding: 10px 12px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 3px solid var(--bcu-gold); /* thin gold rule under the header */
  white-space: nowrap;
}

.reg-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bcu-line-soft);
  vertical-align: middle;
}

.reg-table tbody tr:hover { background: var(--bcu-hover); }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--bcu-navy);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-confirmed { background: var(--bcu-success); color: var(--bcu-navy); }

.badge-pending { background: var(--bcu-warning); color: var(--bcu-navy); }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.row-actions button {
  min-height: 34px;
  padding: 5px 12px;
  border: 1.5px solid var(--bcu-navy);
  border-radius: 5px;
  background: var(--bcu-bg);
  color: var(--bcu-navy);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}

.row-actions button:hover { background: var(--bcu-warning); }

.empty-state { padding: 30px 20px; text-align: center; color: var(--bcu-muted); margin: 0; }

.office-footnote { margin-top: 14px; font-size: 0.85rem; color: var(--bcu-muted); }

.office-footnote a { color: var(--bcu-navy); font-weight: 600; }

.office-footnote code { background: var(--bcu-office-bg); padding: 1px 5px; border-radius: 3px; }

/* ---------- detail modal ---------- */

body.modal-open { overflow: hidden; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bcu-overlay);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 14px;
  overflow-y: auto;
  z-index: 50;
}

.modal {
  background: var(--bcu-bg);
  border: 2px solid var(--bcu-navy);
  border-top: 6px solid var(--bcu-gold);
  border-radius: 8px;
  width: 100%;
  max-width: 780px;
  box-shadow: 0 12px 40px var(--bcu-drop);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1.5px solid var(--bcu-navy);
}

.modal-header h2 {
  margin: 0;
  color: var(--bcu-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
}

.modal-close-x {
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--bcu-navy);
  cursor: pointer;
  min-width: 40px;
  min-height: 40px;
}

.modal-close-x:hover { color: var(--bcu-danger); }

.modal-body { padding: 8px 20px 18px; }

.detail-group { margin: 16px 0 0; }

.detail-group h3, .detail-group-title {
  color: var(--bcu-navy);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--bcu-gold); /* thin gold rule under each group title */
  padding-bottom: 4px;
  margin: 0 0 10px;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 0;
}

.detail-list div { min-width: 0; }

.detail-list dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--bcu-muted);
}

.detail-list dd { margin: 1px 0 0; font-weight: 600; overflow-wrap: anywhere; color: var(--bcu-text); }

.detail-prose { margin: 0; font-style: italic; }

/* Editable FOR OFFICE USE ONLY block inside the modal */

.office-edit {
  border: 1.5px dashed var(--bcu-office-line);
  background: var(--bcu-office-bg);
  border-radius: 6px;
  padding: 12px 14px;
  margin-top: 10px;
}

.office-edit .grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.office-edit .field { display: flex; flex-direction: column; gap: 4px; }

.office-edit label { color: var(--bcu-navy); font-weight: 700; font-size: 0.8rem; }

.office-edit input[type="text"],
.office-edit input[type="date"] {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--bcu-office-line);
  border-radius: 4px;
  font: inherit;
  background: var(--bcu-bg);
  color: var(--bcu-text);
}

.office-edit input:focus { outline: 3px solid var(--bcu-gold); outline-offset: 1px; }

.office-checkbox { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; min-height: 40px; color: var(--bcu-navy); }

.office-checkbox input { width: 18px; height: 18px; accent-color: var(--bcu-navy); }

.office-edit-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

.office-edit-hint { font-size: 0.8rem; color: var(--bcu-muted); }

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--bcu-line-soft);
}

/* ---------- print-only receipt ---------- */

.print-area { display: none; }

.print-receipt { border: 1.5px solid var(--bcu-navy); padding: 18px 22px; }

.print-eyebrow {
  color: var(--bcu-navy);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  margin: 0 0 6px;
}

.print-receipt h2 {
  color: var(--bcu-navy);
  font-family: Georgia, "Times New Roman", serif;
  border-bottom: 3px solid var(--bcu-gold);
  padding-bottom: 8px;
  margin: 0 0 14px;
}

/* ---------- office responsive ---------- */

@media (max-width: 720px) {
  .detail-list,
  .office-edit .grid-3 { grid-template-columns: 1fr; }

  .office-header-inner { flex-direction: column; align-items: flex-start; }

  /* The register table collapses to stacked label/value cards. */
  .reg-table,
  .reg-table tbody,
  .reg-table tr,
  .reg-table td {
    display: block;
    width: 100%;
  }

  .reg-table thead { display: none; }

  .reg-table tbody tr {
    border: 1.5px solid var(--bcu-navy);
    border-radius: 6px;
    margin: 10px;
  }

  .reg-table tbody tr:hover { background: var(--bcu-bg); }

  .reg-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--bcu-line-soft);
  }

  .reg-table td:last-child { border-bottom: none; }

  .reg-table td[data-label]::before {
    content: attr(data-label);
    color: var(--bcu-navy);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}

/* ---------- office print rules ----------
   When printing from the dashboard (Print button in the modal), only the
   generated receipt in #printArea is sent to the paper. */

@media print {
  body.printing-detail > *:not(#printArea) { display: none !important; }

  body.printing-detail #printArea { display: block !important; }

  .print-area { display: none; }

  .print-receipt { border: 1.5px solid var(--bcu-navy); }
}

/* ============================================================
   OFFICE SIGN-IN (login.html)
   Reuses .office-header, .office-auth, .field, .btn-submit and
   the banner styles — only layout helpers are added here.
   ============================================================ */

.login-main {
  flex: 1 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 44px 16px 56px;
}

.login-card {
  width: 100%;
  margin: 0; /* .office-auth has a top margin for the dashboard layout */
}

.login-card .field { margin-top: 14px; }

.login-lead {
  color: var(--bcu-muted);
  margin: 0 0 10px;
}

/* Password field + Show/Hide toggle */

.pw-row { display: flex; gap: 8px; }

.pw-row input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--bcu-navy);
  border-radius: 4px;
  font: inherit;
  color: var(--bcu-text);
  background: var(--bcu-bg);
}

.pw-row input:focus {
  outline: 3px solid var(--bcu-gold);
  outline-offset: 1px;
}

.pw-toggle { flex: 0 0 auto; min-width: 84px; }

.login-help {
  color: var(--bcu-muted);
  font-size: 0.85rem;
  margin: 18px 0 10px;
}

/* Signed-in chip in the dashboard header (navy header → light text) */

.who-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1.5px solid var(--bcu-chip-line);
  border-radius: 6px;
  color: var(--bcu-bg);
  font-weight: 700;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .login-main { padding: 28px 12px 40px; }

  .who-chip { min-height: 38px; padding: 6px 10px; font-size: 0.78rem; }
}

/* ============================================================
   STUDENT REGISTRATION — form additions (index.html)
   Same BCU tokens; no new raw colours outside :root.
   ============================================================ */

/* ---------- FOR OFFICIAL USE band (two boxes + crest, top of page) ---------- */

.office-band {
  margin-top: 0;
  margin-bottom: 26px;
}

.official-band {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: start;
}

.official-crest {
  margin: 6px 0 0;
  text-align: center;
}

.official-crest img {
  display: inline-block;
  width: 168px;
  height: auto;
}

.official-table {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid var(--bcu-navy);
  background: var(--bcu-bg);
  font-size: 0.82rem;
}

.official-table th,
.official-table td {
  border: 1px solid var(--bcu-navy);
  padding: 6px 8px;
  text-align: left;
  vertical-align: middle;
}

.official-title-cell {
  background: var(--bcu-office-bg); /* grey title bar, as on the printed form */
  color: var(--bcu-navy);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center !important;
  font-size: 0.8rem;
}

.official-table tbody th {
  font-weight: 600;
  color: var(--bcu-navy);
  width: 46%;
}

.official-yes,
.official-no {
  width: 27%;
  text-align: center !important;
  color: var(--bcu-muted);
  min-width: 34px;
}

/* ---------- radio choice groups (Semester, Sex, Status, Level, Mode) ---------- */

.choice-group {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.field-label {
  color: var(--bcu-navy);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0;
  margin: 0 0 2px;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding-top: 10px;
}

.choice-row-wrap { row-gap: 10px; }

.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  min-height: 30px;
  cursor: pointer;
}

.choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--bcu-navy);
  cursor: pointer;
  flex: 0 0 auto;
}

.choice input:focus-visible {
  outline: 3px solid var(--bcu-gold);
  outline-offset: 2px;
}

/* Selected radio option emphasised with the warning wash + navy text */
.choice:has(input:checked) { color: var(--bcu-navy); }

/* "Other:" inline text input inside a choice group */
.sub-field { margin-top: 8px; max-width: 340px; }

/* ---------- mobile number pair ("___ / ___") ---------- */

.mobile-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.mobile-cell { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.mobile-sep {
  align-self: center;
  color: var(--bcu-navy);
  font-weight: 700;
  padding-bottom: 26px; /* visually centred against the input row */
}

/* ---------- 5. educational background table ---------- */

.edu-table {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid var(--bcu-navy);
  margin-top: 16px;
}

.edu-table th {
  background: var(--bcu-navy); /* header row: white text on navy */
  color: var(--bcu-bg);
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--bcu-navy);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.edu-table tbody th {
  background: var(--bcu-office-bg);
  color: var(--bcu-navy);
  font-weight: 700;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.88rem;
}

.edu-table td {
  border: 1px solid var(--bcu-navy);
  padding: 6px 8px;
}

.edu-table td input {
  font: inherit;
  color: var(--bcu-text);
  padding: 8px 10px;
  border: 1px solid var(--bcu-office-line);
  border-radius: 4px;
  background: var(--bcu-bg);
  width: 100%;
  min-height: 40px;
}

.edu-table td input:focus {
  outline: 3px solid var(--bcu-gold);
  outline-offset: 1px;
  border-color: var(--bcu-navy);
}

.edu-level-col { width: 110px; }

.edu-year-col { width: 130px; }

/* ---------- 6. financial information (funding options) ---------- */

.funding-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
  margin-top: 16px;
}

.funding-item { display: flex; flex-direction: column; gap: 10px; }

.funding-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  min-height: 30px;
  cursor: pointer;
  color: var(--bcu-text);
}

.funding-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--bcu-navy);
  cursor: pointer;
  flex: 0 0 auto;
}

.funding-option input:focus-visible {
  outline: 3px solid var(--bcu-gold);
  outline-offset: 2px;
}

.funding-option:has(input:checked) { color: var(--bcu-navy); }

.funding-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  border: 1px dashed var(--bcu-office-line);
  border-left: 4px solid var(--bcu-navy);
  background: var(--bcu-office-bg);
  padding: 10px 12px;
  border-radius: 4px;
}

/* ---------- supporting-document notes (from the printed form) ---------- */

.doc-notes {
  margin-top: 28px;
  border: 1px solid var(--bcu-navy);
  border-left: 6px solid var(--bcu-gold);
  background: var(--bcu-warning);
  padding: 16px 18px;
}

.doc-notes h2 {
  color: var(--bcu-navy);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.doc-notes h2 + .roman-list { margin-bottom: 18px; }

.roman-list {
  margin: 0 0 4px;
  padding-left: 28px;
  list-style-type: lower-roman;
}

.roman-list li {
  margin: 3px 0;
  font-size: 0.9rem;
}

.roman-list a { font-weight: 700; }

/* ---------- declaration name placeholder ---------- */

.declaration p { margin: 0 0 8px; }

.declaration p:last-child { margin-bottom: 0; }

.declaration-name {
  font-weight: 700;
  font-style: normal;
  color: var(--bcu-navy);
  border-bottom: 1.5px solid var(--bcu-office-line);
  padding: 0 14px;
}

/* ---------- responsive additions ---------- */

@media (max-width: 720px) {
  .official-band { grid-template-columns: 1fr; }

  .official-crest { order: -1; }

  .funding-options { grid-template-columns: 1fr; }

  .funding-details { grid-template-columns: 1fr; }

  /* Educational background table collapses to stacked cards. */
  .edu-table,
  .edu-table tbody,
  .edu-table tr,
  .edu-table td {
    display: block;
    width: 100%;
  }

  .edu-table thead { display: none; }

  .edu-table { border: none; }

  .edu-table tbody tr {
    border: 1.5px solid var(--bcu-navy);
    margin-bottom: 10px;
  }

  .edu-table tbody th {
    display: block;
    border: none;
    border-bottom: 1px solid var(--bcu-office-line);
  }

  .edu-table td {
    border: none;
    border-top: 1px solid var(--bcu-office-line);
    padding: 8px 12px;
  }

  .edu-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--bcu-navy);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 2px;
  }
}

@media (max-width: 640px) {
  .mobile-row { flex-direction: column; gap: 8px; }

  .mobile-sep { display: none; }

  .sub-field { max-width: none; }
}

/* ---------- print additions ---------- */

@media print {
  .office-band { border-style: solid; }

  .doc-notes {
    background: var(--bcu-bg) !important;
    border-left-color: var(--bcu-navy);
  }

  .edu-table th {
    background: var(--bcu-navy) !important;
    color: var(--bcu-bg) !important;
  }

  .edu-table td input,
  .field input,
  .field select,
  .field textarea {
    border-color: var(--bcu-office-line);
  }
}
