/* Version: 0.1.0 | Updated: 2026-11-19 */
/* The alumni website: phone-first, light and dark following the device
   (mock-ups approved 2026-11-18; the Alumni Database's colour tokens). */

:root {
  color-scheme: light dark;
  --bg: #F4F6FA; --surface: #FFFFFF; --surface2: #EDF1F7; --border: #C9D2E0; --input-border: #6B778C;
  --text: #1A2233; --muted: #4F5B72; --primary: #1F3864; --on-primary: #FFFFFF; --link: #2557A7;
  --good: #1E7F4F; --good-bg: #E3F3EA; --bad: #B42318; --bad-bg: #FBE7E5; --warn: #8A5A00; --warn-bg: #FCEFD2;
  --chip: #E6EEF9; --chip-text: #1D4F96; --focus: #2557A7;
  --mark-body: #12295C; --mark-sub: #3B8CC4;
  accent-color: var(--primary);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1320; --surface: #151e31; --surface2: #1c2740; --border: rgba(123, 175, 212, 0.28); --input-border: #8C9AB3;
    --text: #E9EDF4; --muted: #B0BACC; --primary: #F0C040; --on-primary: #162040; --link: #8EC0E6;
    --good: #5CC48E; --good-bg: rgba(92, 196, 142, 0.16); --bad: #F08A8A; --bad-bg: rgba(240, 138, 138, 0.14);
    --warn: #F2C46B; --warn-bg: rgba(240, 192, 64, 0.14); --chip: rgba(123, 175, 212, 0.16); --chip-text: #9CC8EE; --focus: #8EC0E6;
    --mark-body: #FFFFFF; --mark-sub: #86C5F0;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: 17px; line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -100px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 8px; }

/* Header and footer */
.top { background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: block; line-height: 0; }
.logo-lockup { display: block; height: 44px; width: auto; max-width: 100%; }
.logo-ink { fill: var(--mark-body); }
.logo-sub { fill: var(--mark-sub); }
.preview-banner { margin: 0; padding: 8px 16px; background: var(--warn-bg); color: var(--text); border-bottom: 1px solid var(--warn); font-size: 15px; text-align: center; }
main { width: 100%; max-width: 640px; margin: 0 auto; padding: 24px 16px 8px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
main:focus { outline: none; }
#mails { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px; }
.foot { color: var(--muted); font-size: 14px; text-align: center; padding: 24px 16px; }

/* Text */
h1 { font-size: 27px; line-height: 1.25; margin: 0; }
h2 { font-size: 20px; line-height: 1.3; margin: 0; }
h3 { font-size: 18px; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.note { font-size: 15px; color: var(--muted); }
.hint { display: block; font-size: 15px; font-weight: 400; color: var(--muted); }
.center { text-align: center; }
.step { font-size: 15px; font-weight: 600; color: var(--muted); }
ul.plain { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
ul.plain.dots { padding-left: 22px; list-style: disc; }

/* Cards and notices */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card.quiet { background: transparent; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.notice { padding: 12px 16px; border-radius: 10px; background: var(--chip); color: var(--text); }
.notice.good { background: var(--good-bg); }
.notice.warn, .warn-card { background: var(--warn-bg); border-color: var(--warn); }
.error { color: var(--bad); background: var(--bad-bg); padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.chip { align-self: flex-start; display: inline-flex; font-size: 14px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--good-bg); color: var(--good); }
.chip.na { background: var(--warn-bg); color: var(--warn); margin-top: -6px; }

/* Buttons: big enough to tap (at least 48px) */
.btn, .btn2 {
  display: flex; align-items: center; justify-content: center; text-align: center; width: 100%;
  min-height: 52px; padding: 8px 16px; border-radius: 10px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn { background: var(--primary); color: var(--on-primary); border: 0; font-size: 18px; }
.btn.danger { background: var(--bad); color: #fff; }
.btn2 { background: transparent; color: var(--text); border: 1.5px solid var(--border); min-height: 48px; }
.btn2.small { width: auto; min-height: 44px; font-size: 15px; padding: 6px 14px; }
.btn:disabled, .btn2:disabled { opacity: 0.6; cursor: wait; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; min-height: 44px; }

/* Forms */
label.f { display: flex; flex-direction: column; gap: 2px; font-weight: 600; margin-bottom: -6px; }
.input {
  font: inherit; font-size: max(1rem, 17px); color: var(--text); background: var(--surface); width: 100%;
  border: 1.5px solid var(--input-border); border-radius: 10px; padding: 10px 12px; min-height: 48px;
}
.input.short { max-width: 12em; }
.input.code { text-transform: uppercase; letter-spacing: 0.08em; max-width: 14em; }
textarea.input { min-height: 84px; resize: vertical; }
.input[aria-invalid="true"] { border-color: var(--bad); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.choice, .checks { display: flex; flex-direction: column; gap: 4px; }
.choice.inline { flex-direction: row; flex-wrap: wrap; gap: 4px 18px; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 0; cursor: pointer; font-weight: 400; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex-shrink: 0; }
.pair { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.pair > span { display: flex; flex-direction: column; gap: 12px; }
details.address-block summary { cursor: pointer; font-weight: 600; color: var(--link); min-height: 44px; display: flex; align-items: center; }
details.address-block[open] summary { margin-bottom: 8px; }
.add-link .add-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ts:empty { display: none; }

/* What we hold */
.facts { margin: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 12px; }
.facts dt { color: var(--muted); font-size: 15px; padding-top: 1px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts .sub { display: block; font-size: 15px; color: var(--muted); }

/* Yes/No for each consent item (mock-up 3) */
.purpose { display: flex; flex-direction: column; gap: 10px; }
.purpose + .purpose { padding-top: 14px; border-top: 1px solid var(--border); }
.yn-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.ch { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.ch .icon { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.yn { display: flex; gap: 8px; }
.yn label { position: relative; display: block; }
.yn input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.yn label > span { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 76px; min-height: 48px; padding: 0 12px;
  border: 1.5px solid var(--input-border); border-radius: 10px; font-weight: 600; color: var(--muted); }
.yn input:checked + span { border-color: var(--text); color: var(--text); background: var(--surface2); }
.yn input.y:checked + span { border-color: var(--good); color: var(--good); background: var(--good-bg); }
.yn input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.saved { flex-basis: 100%; font-size: 14px; color: var(--good); min-height: 0; }
.saved:empty { display: none; }
.saved.bad { color: var(--bad); }
.saved-line:empty { display: none; }
.saved-line { color: var(--good); font-size: 15px; }

/* Confirmations: a native modal <dialog> (ui.js confirmDialog) */
dialog { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); padding: 20px; width: min(440px, calc(100vw - 32px)); }
dialog[open] { display: flex; flex-direction: column; gap: 12px; }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: rgba(10, 16, 30, 0.55); overflow: hidden; overscroll-behavior: contain; }

/* The staff preview's emails, shown instead of sent */
.mail-box { margin: 16px 0; padding: 16px; border: 2px dashed var(--warn); border-radius: 14px; background: var(--warn-bg); display: flex; flex-direction: column; gap: 12px; }
.mail { background: var(--surface); border-radius: 10px; padding: 12px 14px; }
.mail-head { font-size: 15px; margin-bottom: 8px; overflow-wrap: anywhere; }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }

@media (min-width: 700px) {
  main { padding-top: 40px; }
  h1 { font-size: 32px; }
  .logo-lockup { height: 52px; }
}
@media (forced-colors: active) {
  .yn input:checked + span { border-width: 3px; }
}
