/* Shared by index.html (form) and dashboard.html. Same style as the organigram and the landing page. */
/* Amazon Ember (text) + Ember Display (headings), from Amazon_Typefaces_Complete_Font_Set_Mar2020.zip. */
/* Latin-subset WOFF2 (~72 KB total), made with pyftsubset. */
@font-face { font-family: "Amazon Ember"; src: url("fonts/AmazonEmber_Rg.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Amazon Ember"; src: url("fonts/Amazon-Ember-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Amazon Ember"; src: url("fonts/AmazonEmber_Bd.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Amazon Ember Display"; src: url("fonts/AmazonEmberDisplay_Bd.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
/* AWS palette only (same as the landing page): dark, orange, and the light tone; surfaces and lines are see-through light. */
:root {
  --bg: #151D26;
  --surface: rgba(246, 250, 255, .04);
  --surface-2: rgba(246, 250, 255, .08);
  --fg: #F6FAFF;
  --muted: rgba(246, 250, 255, .66);
  --line: rgba(246, 250, 255, .28);
  --line-soft: rgba(246, 250, 255, .12);
  --accent: #F7981D;
  --accent-fg: #151D26;
  --accent-text: #F7981D;
  --warn: #F7981D;
  --warn-soft: rgba(247, 152, 29, .12);
  --bad: #FF8A80;
  --bad-soft: rgba(255, 138, 128, .12);
  --font-display: "Amazon Ember Display", "Segoe UI", system-ui, sans-serif;
  --font-body: "Amazon Ember", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Amazon Ember", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
img, svg, canvas { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; }
/* The landing page's square tile grid, as a still background. */
body { background: linear-gradient(rgba(246,250,255,.03) 1px, transparent 1px) 0 0 / 64px 64px, linear-gradient(90deg, rgba(246,250,255,.03) 1px, transparent 1px) 0 0 / 64px 64px, var(--bg) !important; background-attachment: fixed !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  padding-block: 28px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.page { max-width: 1140px; margin: 0 auto; }
.page--narrow { max-width: 760px; }
[hidden] { display: none !important; }

/* Header */
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin-bottom: 32px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { width: 44px; height: 44px; flex: none; display: block; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 5vw, 42px); line-height: 1.05; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.tally { display: flex; align-items: center; gap: 14px; }
.tally-num { font-family: var(--font-mono); font-weight: 500; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.tally-text { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* Cards */
.card {
  position: relative; z-index: 1;
  display: block; width: 100%; min-width: 0;
  text-align: left; font: inherit; color: inherit;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  padding: 9px 12px;
}
button.card { cursor: pointer; padding-right: 28px; }
.card:hover { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
div.card:not([data-tip]):hover, .card.row:hover { border-color: var(--line-soft); box-shadow: none; }
.card.is-dashed:hover { border-color: var(--accent); box-shadow: none; }
.card.is-head:hover { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.card.is-head { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.card.is-head .card-meta, .card.is-head .card-desc { color: inherit; opacity: .85; }
.card.is-dashed { border-style: dashed; border-color: var(--line); }
.card-title { font-family: var(--font-display); font-weight: 600; font-size: 14px; line-height: 1.25; overflow-wrap: break-word; }
.card-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.card-desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.go { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; line-height: 1; }
.is-head .go { color: inherit; }
button.card:focus-visible, .linkbtn:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Motion: colour changes only; the loading spinner is the one animation. */
@media (prefers-reduced-motion: no-preference) {
  .card, .linkbtn, .btn { transition: border-color .15s, background-color .15s, color .15s; }
  .spin { animation: spin .8s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
}

/* Views */
h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 4vw, 34px); line-height: 1.1; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
h2:focus { outline: none; }
.lead { max-width: 65ch; margin: 8px 0 0; font-size: 15px; }
.sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.hint { color: var(--muted); font-size: 13px; margin: 20px 0 0; }
.note { max-width: 65ch; margin: 20px 0 0; color: var(--muted); font-size: 14px; }
.linkbtn { font: inherit; font-size: 14px; font-weight: 500; background: none; border: 0; padding: 0; color: var(--accent-text); cursor: pointer; text-decoration: none; }
.linkbtn:hover { text-decoration: underline; }
.choices { margin-top: 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.choices .card { padding: 14px 32px 14px 14px; }

/* Forms */
form { margin: 0; }
.section { margin-top: 28px; padding-top: 20px; border-top: 1px dashed var(--line-soft); }
.section:first-of-type { margin-top: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field > label, .field > .field-label { font-size: 13px; font-weight: 500; }
.field small { color: var(--muted); font-size: 12px; }
.input {
  width: 100%; min-width: 0;
  font: inherit; font-size: 15px; color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  padding: 9px 12px;
}
select.input option { background: var(--bg); color: var(--fg); }
select.input { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input::placeholder { color: var(--line); }
.input:hover { border-color: var(--line); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.input[readonly] { color: var(--muted); background: transparent; border-style: dashed; }

/* File pickers: a dashed card that turns solid once a file is chosen. */
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
label.card.file { cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 12px; }
.file:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-thumb { width: 44px; height: 44px; flex: none; border-radius: 2px; background: var(--surface-2) center / cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 11px; font-weight: 600; }
.file.has-file { border-style: solid; border-color: var(--line); }
.file[aria-invalid="true"] { border-color: var(--bad); }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; max-width: 70ch; }
.consent input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.consent ul { list-style: disc; margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 24px; }
.btn { font: inherit; font-weight: 600; font-size: 15px; line-height: 1.3; padding: 10px 18px; border-radius: 2px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--fg); border-color: var(--fg); }
.btn.ghost { background: var(--surface); color: var(--fg); border-color: var(--line-soft); }
.btn.ghost:hover { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.btn.small { font-size: 13px; padding: 5px 11px; }
.btn:disabled { opacity: .55; cursor: progress; transform: none; }
.spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; }
.err { color: var(--bad); font-size: 13px; margin: 0; }
.alert { margin: 20px 0 0; padding: 10px 12px; border-radius: 2px; font-size: 14px; background: var(--warn-soft); color: var(--warn); max-width: 70ch; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.status-msg { font-size: 14px; color: var(--muted); }

/* Dashboard */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 0 0 16px; }
.toolbar .input { max-width: 300px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { padding: 12px 14px; }
.row-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; justify-content: space-between; }
.row details { margin-top: 8px; }
.row summary { cursor: pointer; font-size: 13px; color: var(--accent-text); width: max-content; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 14px; margin: 10px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.empty { padding: 28px 14px; text-align: center; color: var(--muted); }
.export .field { width: 140px; }
.export { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.login { max-width: 400px; }
.login .field { margin-top: 14px; }

/* Dashboard: view tabs and the small inline forms for HC and superadmins. */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.tabs [aria-current] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.inline { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin-top: 12px; }
.inline .field { min-width: 140px; flex: 1 1 140px; }
.inline .consent { flex-basis: 100%; }

/* The open list of a select is painted from these: solid colours, because the translucent field colour shows the browser's white behind it. */
select.input { background-color: #1a222c; color: #F6FAFF; color-scheme: dark; }
select.input option, select.input optgroup { background-color: #1a222c; color: #F6FAFF; }
select.input option:checked { background-color: #F7981D; color: #151D26; }
