/* account.css -- the shared stylesheet for Learnington's account pages (sign-up, consent, and any
   other page under the strict CSP in functions/_middleware.js).

   It lives under /acct/ because that is the only asset prefix the gate leaves open to a signed-out
   visitor: OPEN in functions/_middleware.js has /^\/acct\/[a-z0-9.-]+$/, while /js/... and a new
   /account.css at the root both fall through to the gate and are redirected to /join. The page
   scripts live beside it (/acct/sign-up.js, /acct/consent.js) for the same reason.

   No inline <style> and no style= attributes anywhere: style-src is 'self' with no unsafe-inline.
   Palette and fonts match site-cf/public/index.html. Written 9 Nov 2026. */

:root {
  --paper: #FBF4EA;
  --paper-2: #F4EBDE;
  --card: #FFFFFF;
  --ink: #2A2340;
  --ink-soft: #6B6380;
  --clay: #D93D66;
  --clay-dark: #C42650;
  --clay-pale: #FBE2E9;
  --sage: #11804F;
  --sage-pale: #E8F5ED;
  --sage-line: #A9D6BC;
  --sky: #2F4FA8;
  --sky-pale: #E2E8F7;
  --sky-line: #AEBEE6;
  --mustard: #8A6410;
  --mustard-pale: #F8EBCD;
  --mustard-line: #E3C886;
  --error: #B3291C;
  --error-pale: #FBE4E1;
  --error-line: #E4AFA7;
  --line: #EADFCF;
  --line-soft: #F3E9DB;
  --radius: 18px;
  --display: 'Fredoka', 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', 'Verdana', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap { width: 100%; max-width: 680px; margin: 0 auto; padding: 0 16px; }
.wrap.bar { max-width: 1080px; }

a { color: var(--clay-dark); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.18;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(1.75rem, 5.8vw, 2.5rem); }
h2 { font-size: 1.28rem; }
h3 { font-size: 1.04rem; margin-bottom: .3em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 12px 18px; z-index: 50; }
.skip:focus { left: 0; }

[hidden] { display: none !important; }

/* ---- header and footer ---- */

header.site { border-bottom: 2px solid var(--line-soft); background: var(--paper-2); }
header.site .bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; }
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
  text-decoration: none;
}
.brand-plain { color: var(--ink); }

/* the town's wordmark: eleven letters that bob, the second half in the accent */
.logo { display: inline-flex; font-family: var(--display); font-weight: 700; line-height: .95; letter-spacing: -0.01em; }
.logo span { display: inline-block; animation: bob 3.2s ease-in-out infinite; }
.logo span:nth-child(2n) { animation-delay: -.4s; }
.logo span:nth-child(3n) { animation-delay: -1.1s; }
.logo .v { color: var(--clay-dark); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .logo span { animation: none; } }
nav.site { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
nav.site a { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .97rem; }
nav.site a:hover { color: var(--clay-dark); text-decoration: underline; }

main { flex: 1 0 auto; padding: 28px 0 10px; }
.lead { font-size: 1.07rem; color: var(--ink-soft); }
.sub { color: var(--ink-soft); font-size: .95rem; }

footer.site {
  margin-top: 44px;
  border-top: 2px solid var(--line);
  padding: 20px 0 40px;
  font-size: .93rem;
  color: var(--ink-soft);
}
footer.site ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; margin: 0 0 10px; }
footer.site a { color: var(--ink-soft); }

/* ---- panels and notices ---- */

.panel {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin: 22px 0;
}
.panel.quiet { background: var(--paper-2); border-color: var(--line-soft); }
.panel > h2, .panel > h3 { margin-top: 0; }

.notice { border-radius: 14px; padding: 14px 16px; margin: 0 0 22px; border: 2px solid; }
.notice h2 { margin: 0 0 .3em; font-size: 1.14rem; }
.notice.info { background: var(--sky-pale); border-color: var(--sky-line); }
.notice.warn { background: var(--mustard-pale); border-color: var(--mustard-line); }
.notice.bad { background: var(--error-pale); border-color: var(--error-line); color: #7E1838; }
.notice.bad a:not(.btn) { color: #7E1838; }
.notice.good { background: var(--sage-pale); border-color: var(--sage-line); }

/* a block that carries weight: the under-14 explanation, the "what we store" list */
.keep {
  border: 2px solid var(--line);
  border-left: 8px solid var(--clay);
  border-radius: 14px;
  background: var(--clay-pale);
  padding: 16px;
  margin: 0 0 20px;
}
.keep h3 { margin: 1.4em 0 .3em; color: #8C1B3C; }
.keep > h3:first-child { margin-top: 0; }
.keep.cool { border-left-color: var(--sky); background: var(--sky-pale); }
.keep.cool h3 { color: #233B7E; }

/* ---- forms ---- */

form { margin: 0; }
fieldset { border: 2px solid var(--line-soft); border-radius: 14px; padding: 14px 14px 4px; margin: 0 0 20px; min-width: 0; }
legend { font-family: var(--display); font-weight: 700; font-size: 1.06rem; padding: 0 8px; }
.field { margin: 0 0 18px; }
.field > label, .grouplabel { display: block; font-weight: 700; margin-bottom: 6px; }
.hint { display: block; font-weight: 400; font-size: .91rem; color: var(--ink-soft); margin-top: 2px; }
.req { color: var(--clay-dark); font-weight: 700; }
.opt { color: var(--ink-soft); font-weight: 400; }

input[type=text], input[type=email], input[type=password] {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 11px;
  padding: 12px;
  min-height: 48px;
}
input:focus-visible { border-color: var(--sky); }
input[aria-invalid="true"] { border-color: var(--error); background: #FFF5F8; }

/* one choice per row: big targets, works for a seven-year-old and with a keyboard */
.choices { display: grid; gap: 10px; margin: 4px 0 0; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  min-height: 56px;
  cursor: pointer;
  font-size: 1rem;
}
.choice:hover { border-color: var(--clay); background: var(--clay-pale); }
.choice input { margin: 2px 0 0; width: 22px; height: 22px; flex: none; accent-color: #C42650; }
.choice .why { display: block; font-size: .91rem; color: var(--ink-soft); margin-top: 2px; }
.choice-strong { font-weight: 700; }

/* a single tick that has to be deliberate (the parent's declaration) */
.tick {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card);
  border: 2px solid var(--clay);
  border-radius: 14px;
  padding: 16px;
  margin: 0 0 20px;
  font-size: 1rem;
  cursor: pointer;
}
.tick input { margin: 2px 0 0; width: 24px; height: 24px; flex: none; accent-color: #C42650; }

.err { color: var(--error); font-weight: 700; font-size: .95rem; margin: 6px 0 0; }

.btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.08rem;
  padding: 14px 26px;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid var(--clay-dark);
  background: var(--clay-dark);
  color: #fff;
  cursor: pointer;
  text-align: center;
  min-height: 52px;
}
.btn:hover { background: #8C1B3C; border-color: #8C1B3C; color: #fff; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--clay-dark); border-color: var(--line); }
.btn.ghost:hover { background: var(--clay-pale); border-color: var(--clay-dark); color: var(--clay-dark); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 4px 0 0; }
.after { font-size: .92rem; color: var(--ink-soft); margin: 14px 0 0; }

.status { font-weight: 700; color: var(--clay-dark); margin: 12px 0 0; min-height: 1.6em; }

/* ---- the parent's two choices: the same shape, the same weight, side by side ---- */

.decide { display: grid; gap: 16px; margin: 4px 0 0; }
.decide > div {
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.decide .btn { width: 100%; }
/* Agree and Refuse carry exactly the same weight: same size, same colour, same border.
   Nothing on this page may nudge a parent towards either answer. */
.decide .btn, .decide .btn:hover { border-color: var(--clay-dark); }
.decide p { font-size: .95rem; color: var(--ink-soft); margin: 0; }
.decide .warnline { color: #8C1B3C; font-weight: 700; }

/* ---- the list of what is stored ---- */

.store { list-style: none; padding: 0; margin: 0; }
.store li { padding: 9px 0; border-top: 1px solid var(--line-soft); }
.store li:first-child { border-top: 0; }
.store b { font-family: var(--display); font-weight: 600; }
.store .no { color: var(--ink-soft); }
.facts { list-style: none; padding: 0; margin: 0 0 4px; }
.facts li { padding: 7px 0; border-top: 1px solid var(--line-soft); display: flex; gap: 10px; flex-wrap: wrap; }
.facts li:first-child { border-top: 0; }
.facts dfn { font-style: normal; font-weight: 700; min-width: 11rem; }

@media (min-width: 620px) {
  .panel { padding: 22px 20px; }
  .choices.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15121E;
    --paper-2: #2A2440;
    --card: #211C2E;
    --ink: #F3EEFB;
    --ink-soft: #AAA2C0;
    --clay: #FF8FA8;
    --clay-dark: #FFB3C4;
    --clay-pale: #3C2030;
    --sage-pale: #1B3328;
    --sage-line: #3A6B52;
    --sky-pale: #1C243D;
    --sky-line: #3D4F7E;
    --mustard-pale: #332A16;
    --mustard-line: #6B5A2A;
    --error: #F2786D;
    --error-pale: #3A1E22;
    --error-line: #7A3A40;
    --line: #342D46;
    --line-soft: #2B2439;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .logo .v { color: #FF8FA8; }
  :root:not([data-theme="light"]) .skip { color: var(--paper); }
  :root:not([data-theme="light"]) input[type=text],
  :root:not([data-theme="light"]) input[type=email],
  :root:not([data-theme="light"]) input[type=password] { background: #100D19; color: var(--ink); }
  :root:not([data-theme="light"]) .choice { background: #100D19; }
  :root:not([data-theme="light"]) .notice.bad,
  :root:not([data-theme="light"]) .notice.bad a:not(.btn) { color: #FFB8B0; }
  :root:not([data-theme="light"]) .keep h3 { color: #FFA8BC; }
  :root:not([data-theme="light"]) .keep.cool h3 { color: #AFC4FF; }
  :root:not([data-theme="light"]) .decide .warnline { color: #FFA8BC; }
  :root:not([data-theme="light"]) .btn { color: #15121E; background: var(--clay-dark); border-color: var(--clay-dark); }
  :root:not([data-theme="light"]) .btn:hover { background: #FFC9D6; border-color: #FFC9D6; color: #15121E; }
  :root:not([data-theme="light"]) .btn.ghost { background: transparent; color: var(--clay-dark); border-color: var(--line); }
}
