/* Shared base: fonts, colours and controls from design 2a (Minimal). The web fonts are linked from each page, so
   loading them does not hold up the page (see the font link there). */

:root {
  --ink: #1B1B27;
  --text: #3C3939;
  --muted: #5E5B5B;
  --soft: #77737F;
  --line: #E1E1EA;
  --line-strong: #C9C7CF;
  --bg-soft: #F5F5F7;
  --blue: #28437E;
  --blue-dark: #15213F;
  --accent: #F39800;
  --error: #B3261E;
  --sans: 'Noto Sans TC', system-ui, sans-serif;
  --serif: 'Noto Serif TC', 'Noto Sans TC', serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); color: var(--text); background: #fff; font-size: 15px; line-height: 1.6; }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 700; margin: 0 0 .5em; }

.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 28px; border-bottom: 1px solid var(--line); }
.wordmark { font-family: var(--serif); color: var(--blue); font-weight: 700; font-size: 17px; }
.wordmark small { display: block; font-family: var(--sans); color: var(--soft); font-size: 12px; font-weight: 400; word-break: keep-all; text-wrap: balance; }
.topbar .spacer { flex: 1; }

.switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.switch button { border: 0; background: none; padding: 4px 12px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.switch button[aria-pressed="true"] { background: var(--blue); color: #fff; }

label.field { display: block; margin: 0 0 16px; }
label.field > span { display: block; font-size: 14px; color: var(--ink); font-weight: 500; margin-bottom: 6px; }
label.field > small { display: block; font-size: 12px; color: var(--soft); margin-top: 4px; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 4px; background: #fff;
}
input:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }

.btn { display: inline-block; padding: 10px 22px; font: inherit; font-weight: 500; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--blue); background: var(--blue); color: #fff; }
.btn:hover { background: var(--blue-dark); }
.btn.ghost { background: #fff; color: var(--blue); }
.btn:disabled { opacity: .6; cursor: default; }

.error { color: var(--error); font-size: 14px; min-height: 1.4em; margin: 8px 0; }
.note { color: var(--muted); font-size: 14px; }
[hidden] { display: none !important; }
.l3-only, .chevbar { display: none; }   /* brand files and the upload chevrons show in look 3 only */

/* MCU's official seal in every look (owner, 2026-10-24; reference-files/mcu-design): the blue seal on light
   backgrounds, the white seal on dark ones (look 2c marks itself dark); the files are used as they are. */
.on-dark { display: none; }
.wordmark .seal { display: block; width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; align-self: center; }
.wordmark .seal.on-dark { display: none; }
.topbar .seal { display: block; width: 40px; height: 40px; object-fit: contain; }
.topbar .seal.on-dark { display: none; }
.page .motto:has(.motto-seal) { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; align-items: center; }
.page .motto-seal { grid-row: span 2; width: 60px; height: 60px; object-fit: contain; }
.page .motto-seal.on-dark { display: none; }
.contact .foot-seal { width: 28px; height: 28px; object-fit: contain; vertical-align: middle; margin-right: 8px; }
.page .status-card { position: relative; }
.page .status-card:has(.status-seal) { padding-right: 120px; }
/* the sheet's clear space (a quarter of the seal) kept free of the page's rings and lines: a circle of the page colour */
.page .status-seal { position: absolute; right: 0; top: 4px; z-index: 1; width: 80px; height: 80px; padding: 16px; box-sizing: content-box; object-fit: contain; border-radius: 50%; background: var(--bg, #fff); }
.page .status-seal.on-dark { display: none; }
@media (max-width: 720px) {
  .wordmark .seal { width: 36px; height: 36px; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar .seal { width: 32px; height: 32px; }
  .topbar .wordmark { font-size: 15px; line-height: 1.35; }
  #look-switch .switch { flex-wrap: wrap; max-width: 100%; }   /* eight looks: the switch takes two rows on a phone instead of running off it */
  .page .status-card:has(.status-seal) { padding-right: 0; }
  .page .status-seal { position: static; width: 56px; height: 56px; padding: 12px; margin: -12px 0 -8px -12px; }
  .page .kv { grid-template-columns: minmax(88px, 38%) minmax(0, 1fr); }   /* phones: room for values such as Checking documents */
}
.contact { padding: 14px 28px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); text-align: center; line-height: 1.6; }
.contact a { color: inherit; }

/* Applicant looks: headings break only between words or phrases, in balanced lines, and short texts never leave one
   character or word alone on the last line (owner, 2026-10-22). One place for all four looks. */
.page :is(.start-title, .step-title, .start-sub, .sec-zh, .rv-head, .card-name, .ss-label, .motto > span, .cr-title, .stage-name, .panel-head) { word-break: keep-all; text-wrap: balance; }
.page .nav-label { word-break: keep-all; }   /* the step bar keeps each look's own wrapping (2a-2c cut long names with …) */
.page :is(.start-lead, .step-intro, .hint, .ss-sub, .notice, .message-text, .term-dates) { text-wrap: pretty; }
html[lang="zh-Hant"] .page .start-title { max-width: none; }
.page .aside { flex-basis: 300px; }
.page .step-title { font-size: clamp(32px, 3.4vw, 44px); }
html[lang="en"] .page .step-title { font-size: 36px; }
html[lang="en"] .page .start-title { font-size: clamp(36px, 4.4vw, 52px); }

/* ---- light and dark (owner, 2026-10-25; shared/theme.js sets html[data-theme] on the applicant pages and sign-in;
   staff pages never set it and stay light). Each look carries its own dark (2c its light) colours; here the shared
   parts: the switches, the plain sign-in page, and the seals: on a dark page every seal is the white one, except
   where a look keeps one seal on a band of its own (look 3's blue field and navy footer). ---- */
.theme-switch button { display: inline-flex; align-items: center; justify-content: center; padding: 4px 10px; }
.theme-switch svg { display: block; }
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #F3F4F8; --text: #D5D8E2; --muted: #A6ABBB; --soft: #9A9FB0; --line: #2A3658; --line-strong: #46527A;
  --bg-soft: #16213F; --blue: #9DB4E8; --blue-dark: #C3D2F2; --error: #FF8A80;
}
/* the plain pages' dark page and fields; :where() keeps them weaker than any look's own (2b's warm paper, look 3's underlined fields) */
:where(html[data-theme="dark"]) body { background: #0F1830; }
html[data-theme="dark"] .rpt-box :is(h1, h2, h3) { color: var(--rp-ink); }   /* the Report panel stays white with its own colours */
html[data-theme="dark"] .switch button[aria-pressed="true"] { background: #9DB4E8; color: #0F1830; }
:where(html[data-theme="dark"]) input:is([type=text], [type=email], [type=password]) { background: #0F1830; }   /* the same weight as the white rule above, which it follows */
html[data-theme="dark"] .btn { color: #0F1830; }
html[data-theme="dark"] .btn.ghost { background: transparent; color: var(--blue); }
html[data-theme="dark"] .on-light { display: none !important; }
html[data-theme="dark"] :is(.wordmark .seal, .topbar .seal, .page .motto-seal, .page .status-seal).on-dark { display: block; }
html[data-theme="dark"] .contact .foot-seal.on-dark { display: inline; }
