/* The sign-in, sign-up and account pages: the same paper, ink, buttons and fields as CORE's own page
   (tokens.css), as plain scrolling pages that work well on a phone or an iPad. They follow the
   device's light or dark setting. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ui-ink); background: var(--ui-glow) top center / 100% 70vh no-repeat, var(--ui-grain), var(--ui-paper);
  font: var(--text-base) / var(--leading-normal) var(--ui-font); -webkit-font-smoothing: antialiased;
  display: flex; justify-content: center; padding: 11vh 16px 56px;
}
[hidden] { display: none !important; }
a { color: var(--ui-ink); text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }

/* ---------- The card in the middle ---------- */
main { width: 100%; max-width: 420px; }
main.wide { max-width: 760px; }
/* CORE's name as its top bar shows it: the little orb, then the name */
.brand {
  display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-1);
  font: var(--weight-black) var(--text-xl) / 1 var(--ui-font-display); letter-spacing: -0.01em;
}
.brand::before {
  content: ""; width: 28px; height: 28px; border-radius: var(--r-xs); flex: none;
  background: url(/icons/icon-192.png) center / cover; /* the app's icon, the one on her home screen */
}
.brand + .sub { color: var(--ui-ink-2); margin: 0 0 var(--space-6); }
/* Compact branding matches the study workspace without crowding the form. */
main:not(.wide) .brand { flex-direction: row; gap: var(--space-3); font-size: var(--text-2xl); font-weight: var(--weight-black); letter-spacing: -0.01em; text-align: center; }
main:not(.wide) .brand::before { width: var(--control-md); height: var(--control-md); box-shadow: none; }
main:not(.wide) .brand + .sub { text-align: left; margin-top: var(--space-3); }
.card { background: var(--ui-card); border: var(--edge) solid var(--ui-line); border-radius: var(--ui-r-xl); padding: var(--space-6); box-shadow: var(--ui-shadow-sm); }
.card + .card, .card + .small, .card + .hint { margin-top: var(--space-4); } /* a card and what follows it */
h1 { font: var(--weight-black) var(--text-3xl) / var(--leading-tight) var(--ui-font-display); letter-spacing: -0.02em; margin: 0 0 6px; }
h2 { font-family: var(--ui-font-display); font-size: var(--text-lg); font-weight: var(--weight-display); margin: 0 0 var(--space-3); }
p { margin: 0 0 14px; }
.hint { color: var(--ui-ink-2); font-size: var(--text-md); }
.small { font-size: var(--text-sm); color: var(--ui-ink-3); }

/* ---------- Forms: the same fields as the app ---------- */
form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--ui-ink-2); }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input:not([type]), select {
  width: 100%; min-height: var(--control-lg); padding: 0 var(--space-4); border-radius: var(--ui-r-md);
  border: var(--edge) solid var(--ui-line); background: var(--ui-well); color: var(--ui-ink);
  font-size: var(--text-lg); /* 17px: an iPhone doesn't zoom into the field */
}
input:focus, select:focus { outline: none; border-color: var(--ui-focus); background: var(--ui-card); box-shadow: 0 0 0 3px var(--ui-active-soft); }
/* Checkboxes and radios in the app's own look, the same in every browser (canvas.css draws the
   app's the same way): a well with an edge, filled with the main button's colour once chosen, a
   tick or a dot on it. The browsers' own were small, grey and different on each phone. */
input:is([type="checkbox"], [type="radio"]) {
  appearance: none; flex: none; width: 20px; height: 20px; margin: 0; padding: 0;
  border: 1.5px solid var(--ui-ink-3); border-radius: var(--ui-r-xs); background: var(--ui-well) center / 14px no-repeat;
  cursor: pointer; transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
input[type="radio"] { border-radius: 50%; }
input:is([type="checkbox"], [type="radio"]):focus { border-color: var(--ui-ink-3); background-color: var(--ui-well); box-shadow: none; }
input:is([type="checkbox"], [type="radio"]):focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
input:is([type="checkbox"], [type="radio"]):checked { border-color: var(--ui-accent); background-color: var(--ui-accent); }
input[type="checkbox"]:checked { background-image: var(--ui-check); }
input[type="radio"]:checked { box-shadow: inset 0 0 0 4px var(--ui-well); }
@media (hover: hover) { input:is([type="checkbox"], [type="radio"]):hover:not(:checked) { border-color: var(--ui-ink-2); } }
input.code { font-family: var(--font-mono); letter-spacing: 0.3em; text-align: center; font-size: var(--text-2xl); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
form.row { flex-direction: row; }
form.row select { width: auto; }
form.row input[type="number"] { width: calc(var(--control-lg) * 2); } /* "500" and its arrows, no wider */
form.row label.inline { flex-direction: row; align-items: center; gap: var(--space-2); } /* its words before the field, in the row */

/* ---------- Buttons: the app's (violet is the one thing to do; white on a grey lip the other choice).
   Each sits on its lip and goes down onto it when pressed (the tactile look, canvas.css) ---------- */
.btn {
  --press-lip: var(--ui-lip-control);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-lg); padding: 0 var(--space-5); border-radius: var(--ui-r-md);
  border: var(--edge) solid var(--ui-line); background: var(--ui-card); box-shadow: 0 var(--lip) 0 var(--press-lip); color: var(--ui-ink);
  font-family: var(--ui-font-display); font-size: var(--text-lg); font-weight: var(--weight-bold); text-decoration: none; cursor: pointer;
  transition: background var(--dur-fast), opacity var(--dur-fast), filter var(--dur-fast), transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
@media (hover: hover) { .btn:hover { background: var(--ui-raised); } }
.btn:active:not([disabled]) { transform: translateY(calc(var(--lip) - var(--lip-pressed))); box-shadow: 0 var(--lip-pressed) 0 var(--press-lip); }
.btn.primary { --press-lip: var(--ui-accent-lip); border-color: var(--ui-accent); background: var(--ui-accent); color: var(--ui-on-accent); }
@media (hover: hover) { .btn.primary:hover { background: var(--ui-accent); filter: brightness(1.08); } }
.btn.danger { --press-lip: transparent; border-color: transparent; background: var(--ui-danger-soft); color: var(--ui-danger); } /* tinted, so it reads as a warning before it's read */
@media (hover: hover) { .btn.danger:hover { background: color-mix(in srgb, var(--ui-danger) 22%, transparent); } }
.btn.small { min-height: var(--control-sm); padding: 0 var(--space-4); font-size: var(--text-md); }
@media (pointer: coarse) { .btn.small { min-height: var(--control-md); } } /* a fingertip on a phone or an iPad */
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: progress; }
.btn + .hint { margin-top: 10px; }
.link { background: none; border: none; padding: 0; color: var(--ui-ink); font-weight: var(--weight-medium); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.or { display: flex; align-items: center; gap: var(--space-3); color: var(--ui-ink-3); font-size: var(--text-sm); margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--ui-line); }

/* ---------- Messages ---------- */
.message { border-radius: var(--ui-r-md); padding: 10px 14px; font-size: var(--text-md); margin: 14px 0 0; }
.message:empty { display: none; }
.message.error { background: var(--ui-danger-soft); border: 1px solid var(--ui-danger); color: var(--ui-danger); }
.message.ok { background: var(--ui-success-soft); border: 1px solid var(--ui-success); color: var(--ui-success); }

/* ---------- Authenticator setup and recovery codes ---------- */
.qr { display: block; width: 200px; height: 200px; margin: 4px auto 8px; background: #fff; border-radius: var(--ui-r-md); padding: 6px; }
.secret { font-family: var(--font-mono); font-size: var(--text-md); text-align: center; word-break: break-all; color: var(--ui-ink-2); -webkit-user-select: all; user-select: all; }
/* The code that signs in Zuvio Coding, the desktop app (browser-code.html): read off this screen, typed on the other */
.browser-code { margin: 0; padding: var(--space-4); background: var(--ui-well); border: 1px solid var(--ui-line); border-radius: var(--ui-r-md); font-family: var(--font-mono); font-size: var(--text-2xl); font-weight: var(--weight-semibold); letter-spacing: 0.3em; text-align: center; user-select: all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 14px; padding: 14px; list-style: none; background: var(--ui-well); border: 1px solid var(--ui-line); border-radius: var(--ui-r-md); font-family: var(--font-mono); font-size: var(--text-base); text-align: center; }
.check { flex-direction: row; align-items: center; gap: 10px; color: var(--ui-ink); }

/* ---------- Account page lists ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.items { list-style: none; margin: 0 0 14px; padding: 0; }
.items li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--ui-line); }
.items li:first-child { border-top: none; }
.items .what { flex: 1; min-width: 0; }
.items .what b { font-weight: var(--weight-medium); display: block; overflow-wrap: anywhere; }
/* A drop-down beside the words (a student's plan, account.ts) is as wide as its choice: the form
   fields' width: 100% would take the whole row and squash her name to a letter a line */
.items li > select { width: auto; flex: none; }
.items .what > span { color: var(--ui-ink-3); font-size: var(--text-sm); display: block; overflow-wrap: anywhere; }
/* A reported answer and the question before it (account.ts), as she saw them */
.items .what details { margin-top: 6px; font-size: var(--text-sm); }
.items .what summary { cursor: pointer; color: var(--ui-ink-2); overflow-wrap: anywhere; }
.items .what .quote {
  margin: 8px 0 0; padding: 8px 10px; border-radius: var(--ui-r-sm); background: var(--ui-well); color: var(--ui-ink);
  font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto;
}
/* A group report: what was said on its own line, the four answers under it */
#group-reports li { flex-wrap: wrap; }
#group-reports .what { flex-basis: 100%; }
/* A reported answer: Mark done (and Hide, for a library lesson) beside its words, or under them on a phone */
#answer-reports li { flex-wrap: wrap; }
#answer-reports .what { flex: 1 1 16em; }
/* The waitlist card: three numbers, then a bar per day (the tallest day fills the height) */
.wl-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin: 0 0 var(--space-4); }
.wl-stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } /* the dashboard's four plans */
@media (max-width: 480px) { .wl-stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wl-stats div { display: grid; gap: 2px; }
.wl-stats b { font-size: var(--text-2xl); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; }
.wl-stats span, .wl-label, .wl-mix { color: var(--ui-ink-3); font-size: var(--text-sm); }
.wl-label { margin: 0 0 6px; }
.wl-bars { display: flex; align-items: flex-end; gap: 2px; height: 72px; margin: 0 0 var(--space-3); border-bottom: 1px solid var(--ui-line); }
.wl-bars i { flex: 1; min-height: 1px; background: var(--ui-active); border-radius: var(--ui-r-xs) var(--ui-r-xs) 0 0; }
.wl-bars i.zero { background: var(--ui-line); }
.wl-mix { margin: 0 0 var(--space-3); }
.tq-list { margin: 0 0 var(--space-3); padding-left: var(--space-5); }
.tq-list li { margin-bottom: var(--space-2); }
.tq-list span { display: block; color: var(--ui-ink-3); font-size: var(--text-sm); }
#wl-people .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* The dashboard's Growth section (web/admin-growth.ts): tables that scroll sideways on a phone,
   the funnel's bars, and retention cells tinted by their share (--heat, set per cell) */
.gr-scroll { overflow-x: auto; min-width: 0; max-width: 100%; margin: 0 0 var(--space-3); }
.gr-table td { white-space: nowrap; }
.gr-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.gr-table th { color: var(--ui-ink-3); font-weight: var(--weight-medium); text-align: left; white-space: nowrap; }
.gr-table th, .gr-table td { padding: 6px 8px; border-bottom: 1px solid var(--ui-line); }
.gr-table .num { text-align: right; white-space: nowrap; }
.gr-heat { background: color-mix(in srgb, var(--ui-violet) var(--heat), transparent); }
.gr-funnel { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: var(--space-2); }
.gr-funnel li { display: grid; grid-template-columns: minmax(0, 11em) 1fr auto; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.gr-track { height: 10px; background: var(--ui-well); border-radius: var(--ui-r-pill); overflow: hidden; }
.gr-track i { display: block; height: 100%; background: var(--ui-violet); }
.gr-funnel .num { font-variant-numeric: tabular-nums; color: var(--ui-ink-2); }
.badge { display: inline-block; font-size: var(--text-2xs); padding: 2px 8px; border-radius: var(--ui-r-pill); border: 1px solid var(--ui-line-strong); color: var(--ui-ink-2); margin-left: 6px; vertical-align: 1px; font-weight: var(--weight-medium); }
.badge.ok { border-color: var(--ui-success); color: var(--ui-success); }
.badge.off { border-color: var(--ui-danger); color: var(--ui-danger); }
.empty { color: var(--ui-ink-3); font-size: var(--text-md); margin: 0 0 14px; }
.status { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ui-ink-3); }
.status.on::before { background: var(--ui-success); }
.audit { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.audit td { padding: 6px 8px 6px 0; border-top: 1px solid var(--ui-line); vertical-align: top; overflow-wrap: anywhere; }
.audit td:first-child { white-space: nowrap; color: var(--ui-ink-3); }
.scroll { overflow-x: auto; }
.linkbox { font-family: var(--font-mono); font-size: var(--text-sm); word-break: break-all; background: var(--ui-well); border: 1px solid var(--ui-line); border-radius: var(--ui-r-sm); padding: 10px 12px; margin: 0 0 10px; -webkit-user-select: all; user-select: all; }

/* ---------- "Confirm it's you" dialog: a sheet, like the app's ---------- */
dialog { background: var(--ui-card); color: var(--ui-ink); border: 1px solid var(--ui-hairline); border-radius: var(--ui-r-xl); padding: var(--space-6); width: min(400px, calc(100vw - 32px)); box-shadow: var(--ui-shadow-lg); }
dialog::backdrop { background: var(--ui-scrim); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

@media (max-width: 480px) {
  body { padding: 32px 12px; }
  .card { padding: 20px; }
  .codes { grid-template-columns: 1fr; }
}

/* ---------- The PAU's past papers (admins): a folded upload form under the download ---------- */
details.pau-upload { margin: var(--space-4) 0; }
details.pau-upload > summary { cursor: pointer; font-weight: var(--weight-medium); color: var(--ui-ink-2); }
details.pau-upload form { margin-top: var(--space-3); }

/* The privacy policy and the terms (web/legal.ts): a long text to read, in the same room */
.legal { line-height: var(--leading-normal); }
.legal h2 { margin: var(--space-6) 0 var(--space-2); }
.legal p, .legal ul { margin: 0 0 var(--space-3); color: var(--ui-ink-2); }
.legal ul { padding-left: var(--space-5); }
.legal li { margin-bottom: var(--space-2); }
.legal .small b { color: var(--ui-ink); }
.brand a { color: inherit; text-decoration: none; }
/* Under the sign-in and sign-up cards: where the privacy policy and terms are */
.legal-links { margin-top: var(--space-4); text-align: center; font-size: var(--text-sm); color: var(--ui-ink-3); }
.legal-links a { color: var(--ui-ink-2); }
label.consent { display: flex; flex-direction: row; gap: var(--space-2); align-items: flex-start; font-weight: var(--weight-regular); font-size: var(--text-sm); color: var(--ui-ink-2); }
.consent input { margin-top: 1px; } /* level with the first line of its words */

/* The sign-up's age questions (signup.html): month and year side by side */
fieldset.birth { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
fieldset.birth legend { padding: 0; margin-bottom: 6px; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--ui-ink-2); }
fieldset.birth select { flex: 1 1 8em; width: auto; }

/* ---------- The pay page (pay.html): yearly or monthly, as two big choices ---------- */
.pay-periods { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
label.pay-period { flex-direction: row; align-items: flex-start; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--ui-line); border-radius: var(--ui-r-md); background: var(--ui-well); cursor: pointer; }
label.pay-period:has(input:checked) { border-color: var(--ui-focus); background: var(--ui-card); box-shadow: 0 0 0 3px var(--ui-active-soft); }
.pay-period input { margin-top: 2px; }
.pay-period span { display: grid; gap: 2px; }
.pay-period b { color: var(--ui-ink); font-size: var(--text-base); }
.pay-period small { color: var(--ui-ink-2); font-weight: var(--weight-regular); }

/* ---------- The account page (Zuvio 2, docs/DESIGN.md): her account as a phone's own settings are.
   The list first: the way back and "Account", her card (initial, name, email), then rows in groups,
   each with its icon on a coloured tile, its state ("2", "On") and a chevron, and signing out last.
   A row opens its page (#email, #passkeys..., account.ts showRoom): "‹ Account" at the top, then its
   card. #acc[data-room] is set while a page is open; only its parts ([data-room].here) show. ---------- */
main.acc { max-width: 600px; }
main.acc[data-room="admin"] { max-width: 760px; } /* the admins' tables need the room */
.acc-top { display: flex; align-items: center; gap: var(--space-1); min-height: var(--control-md); margin-bottom: var(--space-5); }
.acc-title { margin: 0; font-size: var(--text-2xl); }
.acc-up {
  display: none; align-items: center; gap: 2px; min-height: var(--control-md); margin-left: calc(var(--space-2) * -1);
  padding: 0 var(--space-3) 0 var(--space-1); border-radius: var(--ui-r-md);
  color: var(--ui-violet); font: var(--weight-semibold) var(--text-lg) / 1 var(--ui-font); text-decoration: none;
}
.acc-up svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* The list, or one page: never both */
#acc[data-room] :is(#acc-home, .acc-title, .acc-list) { display: none; }
#acc[data-room] .acc-up { display: flex; }
/* words for a screen reader only (an icon's name) */
.unseen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#acc [data-room]:not(.here) { display: none; }
.acc-hero {
  display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4);
  border: var(--edge) solid var(--ui-line); border-radius: var(--ui-r-lg); background: var(--ui-card); box-shadow: var(--ui-shadow-sm);
}
.acc-avatar {
  flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--ui-violet-soft); color: var(--ui-violet);
  font: var(--weight-display) var(--text-2xl) / 1 var(--ui-font-display); display: flex; align-items: center; justify-content: center;
}
.acc-hero-text { min-width: 0; }
.acc-name { display: block; font: var(--weight-display) var(--text-xl) / var(--leading-tight) var(--ui-font-display); overflow-wrap: anywhere; }
.acc-hero .sub { margin: var(--space-1) 0 0; color: var(--ui-ink-2); font-size: var(--text-sm); overflow-wrap: anywhere; }
.acc-hero .sub:empty { display: none; }
.acc-tick { display: inline-block; width: 16px; height: 16px; margin-left: 6px; vertical-align: -3px; color: var(--ui-good); }
.acc-tick svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.acc-group { margin: var(--space-6) 0 var(--space-2); color: var(--ui-ink-2); font: var(--weight-display) var(--text-base) / var(--leading-normal) var(--ui-font-display); }
h2.acc-group[data-room] { margin-top: 0; color: var(--ui-ink); font-size: var(--text-lg); }
/* The rows: one card, a line between them */
.acc-rows {
  display: flex; flex-direction: column; overflow: hidden;
  border: var(--edge) solid var(--ui-line); border-radius: var(--ui-r-lg); background: var(--ui-card); box-shadow: var(--ui-shadow-sm);
}
.acc-rows a {
  display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 0 var(--space-4) 0 var(--space-3);
  color: var(--ui-ink); font-weight: var(--weight-semibold); text-decoration: none;
}
.acc-rows a + a { border-top: var(--edge) solid var(--ui-line); }
.acc-rows a:focus-visible { outline-offset: -4px; } /* inside the card, which clips what sticks out */
@media (hover: hover) { .acc-rows a:hover { background: var(--ui-raised); } }
.acc-row-name { flex: 1; min-width: 0; }
.acc-rows a[href="#delete"] .acc-row-name { color: var(--ui-danger); }
.acc-value { color: var(--ui-ink-2); font-weight: var(--weight-regular); text-align: right; }
.acc-chev { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--ui-ink-3); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#admin-rows { margin-top: var(--space-6); }
/* On a phone the invite's note goes to a line of its own instead of being squeezed to nothing */
#invite-note { flex-basis: 12em; }
.acc-end { margin-top: var(--space-6); }
/* The icons: a tile in the soft colour, the drawing in the ink over it (a mask). On a card, beside its
   name (h2::before and ::after); in a row, smaller (.acc-icon). */
.card[data-icon] > h2 { position: relative; display: flex; align-items: center; gap: var(--space-3); }
.card[data-icon] > h2::before { content: ""; flex: none; width: 40px; height: 40px; border-radius: var(--ui-r-sm); background: var(--tile-soft); }
.card[data-icon] > h2::after {
  content: ""; position: absolute; left: 9px; top: 50%; width: 22px; height: 22px; margin-top: -11px;
  background: var(--tile-ink); -webkit-mask: var(--tile-icon) center / contain no-repeat; mask: var(--tile-icon) center / contain no-repeat;
}
.acc-icon { position: relative; flex: none; width: 32px; height: 32px; border-radius: var(--ui-r-xs); background: var(--tile-soft); }
.acc-icon::after {
  content: ""; position: absolute; inset: 7px;
  background: var(--tile-ink); -webkit-mask: var(--tile-icon) center / contain no-repeat; mask: var(--tile-icon) center / contain no-repeat;
}
[data-icon="email"] { --tile-soft: var(--subj-physics-soft); --tile-ink: var(--subj-physics-ink); --tile-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='3'/%3E%3Cpath d='M4 7l8 6 8-6'/%3E%3C/svg%3E"); }
[data-icon="passkey"] { --tile-soft: var(--subj-maths-soft); --tile-ink: var(--subj-maths-ink); --tile-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='12' r='4'/%3E%3Cpath d='M12 12h9M18 12v3M21 12v2'/%3E%3C/svg%3E"); }
[data-icon="password"] { --tile-soft: var(--subj-history-soft); --tile-ink: var(--subj-history-ink); --tile-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10' width='14' height='10' rx='3'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E"); }
[data-icon="devices"] { --tile-soft: var(--subj-geography-soft); --tile-ink: var(--subj-geography-ink); --tile-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='13' height='10' rx='2'/%3E%3Crect x='17' y='9' width='4' height='10' rx='1'/%3E%3Cpath d='M7 19h6'/%3E%3C/svg%3E"); }
[data-icon="data"] { --tile-soft: var(--subj-biology-soft); --tile-ink: var(--subj-biology-ink); --tile-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E"); }
[data-icon="app"] { --tile-soft: var(--subj-chemistry-soft); --tile-ink: var(--subj-chemistry-ink); --tile-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v5c0 5-3 8.5-7 10-4-1.5-7-5-7-10V6z'/%3E%3C/svg%3E"); }
[data-icon="delete"] { --tile-soft: var(--ui-danger-soft); --tile-ink: var(--ui-danger); --tile-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7h14M9 7V4.5h6V7M7 7l1 13h8l1-13M10.5 11v5M13.5 11v5'/%3E%3C/svg%3E"); }
[data-icon="admin"] { --tile-soft: var(--subj-code-soft); --tile-ink: var(--subj-code-ink); --tile-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 20V11M12 20V5M19 20v-6'/%3E%3C/svg%3E"); }

/* ---------- Zuvio 2, "Lamplight": a sign-in step (sign in, sign up, a new password, the email's
   link). Zuvio greets her at the top: the orb in its cap (zuvio-orb.css) and its words in the serif,
   which change with each step (web/auth.ts greet()). The form sits on the paper below with no card
   around it, fields and the big button a size up, and the way to the other page (sign in, create an
   account) last. From a landscape iPad up the two sit side by side: Zuvio on the left, bigger, with
   the line about the AI at its foot, and the form on the right (docs/DESIGN.md, "Zuvio 2"). ---------- */
body.hello-page {
  display: block; padding: 0;
  background: radial-gradient(circle 200px at 46px 64px, var(--ui-aura), transparent) no-repeat, var(--ui-paper);
}
.hello-main {
  width: 100%; max-width: 440px; min-height: 100vh; min-height: 100dvh; margin: 0 auto;
  padding: max(var(--space-6), env(safe-area-inset-top)) var(--space-5) max(var(--space-6), env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: var(--space-6);
}
.hello { display: flex; align-items: flex-start; gap: 14px; padding-top: 14px; } /* room for the cap */
.hello-words { flex: 1; min-width: 0; }
.hello-small { margin: 0 0 var(--space-1); font: var(--text-lg) / var(--leading-tight) var(--ui-font-voice); color: var(--ui-ink-2); }
.hello h1 { margin: 0; font: var(--weight-regular) var(--text-3xl) / var(--leading-tight) var(--ui-font-voice); letter-spacing: -0.005em; text-wrap: balance; }
.hello-after { margin: 6px 0 0; font-size: var(--text-base); color: var(--ui-ink-2); overflow-wrap: anywhere; }
.hello-ai { display: none; } /* said beside the form on a wide screen; a phone's sign-up says it in the form */

.hello-form { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.hello-form > :is(form, section) { display: flex; flex-direction: column; gap: 14px; }
.hello-form p { margin: 0; }
.hello-page label { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--ui-ink); }
.hello-page label > .small { font-weight: var(--weight-regular); }
.hello-page :is(input[type="text"], input[type="password"], input[type="email"], input:not([type]), select) {
  min-height: var(--control-xl); border-color: var(--ui-line-strong);
}
.hello-page .btn { min-height: var(--control-xl); }
.hello-page .btn.primary { font-size: var(--text-xl); }
.btn-icon { flex: none; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.hello-form .hint.center { margin-top: -6px; text-align: center; font-size: var(--text-sm); color: var(--ui-ink-3); }
.hello-form .or { margin: 0; }
.hello-form .message { margin: 0; }
/* "Forgot your password?" under the fields, at the right, before the button it would replace */
.forgot { align-self: flex-end; display: flex; align-items: center; min-height: var(--control-md); margin: -10px 0; color: var(--ui-violet); font-weight: var(--weight-semibold); text-decoration: none; }
.hello-form .link { align-self: flex-start; min-height: var(--control-md); }
/* The way to the other page: "New to Zuvio? Create an account" */
.hello-end { margin-top: auto; padding-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); text-align: center; }
.hello-end .legal-links { margin-top: var(--space-2); }
.two-tone { color: var(--ui-ink-2); font-size: var(--text-base); }
.two-tone a { color: var(--ui-violet); font-weight: var(--weight-bold); text-decoration: none; }
@media (hover: hover) { .two-tone a:hover, .forgot:hover { text-decoration: underline; } }

@media (min-width: 960px) {
  body.hello-page { background: var(--ui-paper); }
  .hello-main { max-width: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(420px, 44%) minmax(0, 1fr); gap: 0; }
  .hello {
    flex-direction: column; align-items: flex-start; gap: 0; padding: var(--space-8) 56px 44px;
    background: radial-gradient(circle 280px at 150px 50%, var(--ui-aura), transparent) no-repeat, var(--ui-well);
    border-right: 1px solid var(--ui-line);
  }
  .hello .zorb { --s: 160px; margin: auto 0 38px var(--space-2); }
  .hello-words { flex: none; width: 100%; } /* its height only: the space left goes above the orb and above the AI line */
  .hello-words:last-child { margin-bottom: auto; } /* no AI line under it (sign-up says it in the form): Zuvio in the middle */
  .hello-small { font-size: var(--text-xl); }
  .hello h1 { font-size: var(--ui-text-voice); line-height: 1.08; letter-spacing: -0.01em; }
  .hello-after { margin-top: var(--space-3); font-size: var(--text-xl); line-height: var(--leading-snug); }
  .hello-ai { display: block; margin: auto 0 0; padding-top: var(--space-8); font-size: var(--text-md); color: var(--ui-ink-3); }
  .hello-form { flex: none; align-self: center; justify-self: center; width: min(400px, 100%); padding: 48px 0; }
}

/* The sign-up form's parts (signup.ts shows one at a time) and the bar above: back, and a dot for
   each part, the one she is on long */
.hello-form .part { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.hello-page fieldset.birth legend { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--ui-ink); }
.hello-form form.stack { display: flex; flex-direction: column; gap: 14px; }
.hello-bar { display: grid; grid-template-columns: var(--control-md) 1fr var(--control-md); align-items: center; height: var(--control-md); margin-bottom: calc(var(--space-6) * -1); }
.round-back {
  grid-column: 1; width: var(--control-md); height: var(--control-md); margin-left: -10px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--ui-ink-2); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.round-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .round-back:hover { background: var(--ui-raised); color: var(--ui-ink); } }
.dots { grid-column: 2; display: flex; justify-content: center; align-items: center; gap: 6px; }
.dots i { width: 7px; height: 7px; border-radius: var(--ui-r-full); background: var(--ui-line-strong); transition: width var(--dur) var(--ease); }
.dots i.done { background: var(--ui-active); opacity: 0.5; }
.dots i.here { width: 22px; background: var(--ui-active); }
/* A note from Zuvio in the form: why it asks her age (violet), that it is an AI (amber) */
.hello-form .note { padding: var(--space-3) 14px; border-radius: var(--ui-r-md); background: var(--ui-violet-soft); color: var(--ui-ink); font-size: var(--text-md); line-height: var(--leading-snug); }
.hello-form .note.lamp { background: var(--ui-lamp-soft); }
/* A quiet way out: "Use a password instead", "Sign out" */
.hello-form .link.quiet { align-self: center; color: var(--ui-violet); font-weight: var(--weight-semibold); text-decoration: none; }
@media (hover: hover) { .hello-form .link.quiet:hover { text-decoration: underline; } }
/* Each agreement is a card she ticks, the box a size up for a finger */
.hello-page label.consent {
  gap: var(--space-3); padding: 14px; border: var(--edge) solid var(--ui-line); border-radius: var(--ui-r-lg);
  background: var(--ui-card); box-shadow: var(--ui-shadow-sm); font-size: var(--text-base); color: var(--ui-ink); cursor: pointer;
}
.hello-page label.consent input { width: 26px; height: 26px; margin: 0; border-radius: var(--ui-r-xs); background-size: 17px; }
.hello-page label.consent a { color: var(--ui-violet); font-weight: var(--weight-semibold); }
.hello-page label.check { flex-direction: row; align-items: center; gap: 10px; }
.hello-page input.code { min-height: var(--control-xl); }
.hello-page input[readonly] { color: var(--ui-ink-2); background: var(--ui-raised); border-color: var(--ui-line); }

@media (min-width: 960px) {
  .hello-main { grid-template-rows: auto 1fr; }
  .hello { grid-column: 1; grid-row: 1 / -1; }
  .hello-bar { grid-column: 2; grid-row: 1; justify-self: center; width: min(400px, 100%); margin: var(--space-8) 0 0; }
  .hello-form { grid-column: 2; grid-row: 2; }
}

/* A new visitor's first screen (signup.html #first, Zuvio 2's "First visit"): three lines of what
   Zuvio does, each on its soft violet tile, then Let's start and the way to sign in under it. On a
   phone the buttons sit at the foot of the screen, in reach of the thumb. */
.hello-form #first { flex: 1; }
.first-list { display: grid; gap: var(--space-3); margin: 0 0 auto; padding: 0; list-style: none; }
.first-list li { display: flex; align-items: center; gap: var(--space-3); color: var(--ui-ink); font-size: var(--text-md); font-weight: var(--weight-semibold); }
.first-list svg {
  flex: none; width: var(--control-md); height: var(--control-md); padding: var(--space-2); border-radius: var(--ui-r-sm);
  background: var(--ui-violet-soft); stroke: var(--ui-violet); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.hello-form #first .btn.primary { margin-top: var(--space-5); }
