/* ============================================================================
   Adapt & Triumph — the organisation portal.
   The website's look (adapt-triumph-website/public/css/site.css): the logo's navy ground, the app's blue
   (#208AEF) and amber (#F4A23B), Archivo for the wordmark and headings, Atkinson Hyperlegible Next for
   everything read (drawn by the Braille Institute for low-vision readers). Dark only, as the website is.
   Contrast measured there: ink 16.8:1, ink-soft 8.9:1, blue 5.3:1 on the canvas.
   ========================================================================== */

/* Self-hosted from Google Fonts (latin subset), SIL Open Font License 1.1.
   Archivo by Omnibus-Type. Atkinson Hyperlegible Next by the Braille Institute. */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 500 800;
  font-stretch: 100% 125%;
  font-display: swap;
  src: url(/fonts/archivo.woff2) format('woff2');
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/atkinson-next.woff2) format('woff2');
}

:root {
  --canvas: #0A111F;
  --surface: #111B2E;
  --surface-2: #16233A;
  --ink: #EEF2F8;
  --ink-soft: #A7B3C6;
  --accent: #208AEF;
  --accent-ink: #06101F;
  --amber: #F4A23B;
  --good: #7FD1A6;
  --hairline: rgb(238 242 248 / 0.12);
  --hairline-strong: rgb(238 242 248 / 0.22);
  --font-display: 'Archivo', system-ui, sans-serif;
  --font-text: 'Atkinson Hyperlegible Next', system-ui, sans-serif;
  --gutter: clamp(1rem, 4vw, 3rem);
  --maxw: 72rem;
  --r-sm: 8px;
  --r-md: 14px;
  --r-pill: 999px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 1.5rem var(--gutter) 3rem; }
main:focus { outline: none; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 0.5rem; }
h1 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem); font-weight: 800; font-stretch: 112%; }
h2 { font-size: 1.3rem; font-weight: 800; font-stretch: 108%; }
h3 { font-size: 1.05rem; font-weight: 700; margin-top: 1.25rem; }
h4 { font-size: 0.95rem; font-weight: 700; margin-top: 1rem; }
p { margin: 0 0 0.6rem; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: #fff; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
  padding: 0.6rem 1rem; border-radius: var(--r-sm); text-decoration: none;
}
.skip:focus { top: 1rem; }

:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ------------------------------------------------------------------ bar -- */
.bar { border-bottom: 1px solid var(--hairline); background: var(--canvas); }
.bar__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0.5rem var(--gutter);
  min-height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; min-height: 44px; flex-wrap: wrap; }
.brand__mark { width: 36px; height: 36px; border-radius: 9px; }
.brand__word {
  font-family: var(--font-display); font-weight: 800; font-stretch: 118%;
  font-size: 0.98rem; letter-spacing: 0.01em; text-transform: uppercase; white-space: nowrap;
}
.brand__tag { color: var(--ink-soft); font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; min-width: 0; }
.who__email { color: var(--ink-soft); font-size: 0.9rem; overflow-wrap: anywhere; }

/* --------------------------------------------------------------- panels -- */
.panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 1.5rem; }
.panel--narrow { max-width: 34rem; margin: 1rem auto 0; }
.lead { font-size: 1.1rem; }
.muted { color: var(--ink-soft); }
.fine { color: var(--ink-soft); font-size: 0.875rem; }

.org-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.org-pick { display: flex; flex-direction: column; gap: 0.3rem; min-width: min(100%, 16rem); }

.grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 60rem) {
  .grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .card--wide { grid-column: 1 / -1; }
}
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 1.25rem; min-width: 0; }
.foot-line { margin-top: 1.25rem; max-width: 48rem; }

/* ---------------------------------------------------------------- forms -- */
.form { display: flex; flex-direction: column; gap: 0.6rem; margin: 1rem 0 0.5rem; }
.form--inline { display: grid; grid-template-columns: 1fr; gap: 0.75rem; align-items: end; }
@media (min-width: 48rem) {
  .form--inline { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; }
}
.field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; border: 0; margin: 0; padding: 0; }
label, legend { font-weight: 700; font-size: 0.95rem; padding: 0; }
input[type='email'], input[type='text'], input[type='date'], select, textarea {
  width: 100%; min-height: 48px; padding: 0.5rem 0.85rem;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--hairline-strong); border-radius: var(--r-sm);
  font: inherit; font-size: 1rem;
}
input::placeholder, textarea::placeholder { color: var(--ink-soft); opacity: 0.8; }
/* ── ORG-MEMBERS ── the box for pasted addresses, and the date beside it. */
textarea { resize: vertical; line-height: 1.5; }
#members-until { max-width: 14rem; color-scheme: dark; }
#code { letter-spacing: 0.3em; font-size: 1.3rem; max-width: 12rem; }
.choices { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.choice {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; padding: 0 1rem;
  border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); font-weight: 600; cursor: pointer;
}
.choice input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); margin: 0; }
.add-coach { display: grid; grid-template-columns: 1fr; gap: 0.4rem; margin-top: 0.6rem; }
@media (min-width: 30rem) { .add-coach { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } .add-coach label { grid-column: 1 / -1; } }

/* -------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 48px; padding: 0 1.25rem; border-radius: var(--r-pill);
  font: inherit; font-weight: 700; font-size: 0.95rem; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; background: transparent; color: var(--ink);
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover:not(:disabled) { background: #3d9bf2; }
.btn--quiet { border-color: var(--hairline-strong); }
.btn--quiet:hover:not(:disabled) { border-color: var(--ink-soft); }
.btn--warn { border-color: var(--amber); color: var(--amber); }
.btn--warn-quiet { border-color: var(--hairline-strong); color: var(--amber); }
.btn--small { min-height: 44px; padding: 0 1rem; font-size: 0.875rem; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.row--tight { align-items: center; justify-content: space-between; margin-top: 0.25rem; }

/* ---------------------------------------------------------------- lists -- */
.list { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.item { border-top: 1px solid var(--hairline); padding: 0.85rem 0; overflow-wrap: anywhere; }
.item p { margin-bottom: 0.2rem; }
.item__title { font-weight: 700; }
.list--plain .item { padding: 0.5rem 0; }

/* ---------------------------------------------------------------- notes -- */
.note { font-size: 0.95rem; margin: 0.4rem 0; }
.note:empty { display: none; }
.note--good { color: var(--good); }
.note--warn { color: var(--amber); }

/* --------------------------------------------------------------- totals -- */
.totals h3:first-child { margin-top: 0.25rem; }
.big { margin: 0.75rem 0 0; }
.big__n { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; line-height: 1; }
.big__sub { color: var(--ink-soft); font-size: 1rem; }
.big__label { color: var(--ink-soft); margin-bottom: 0.4rem; }
.mid { margin: 0.4rem 0; }
.mid__n { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; }
.mid__sub { color: var(--ink-soft); }
.pair { display: flex; justify-content: space-between; max-width: 16rem; border-bottom: 1px solid var(--hairline); padding: 0.3rem 0; margin: 0; }
.rule { border: 0; height: 1px; background: var(--hairline); margin: 1.25rem 0 0.5rem; }

/* ----------------------------------------------------------------- foot -- */
.foot { border-top: 1px solid var(--hairline); }
.foot__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 1rem var(--gutter);
  display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: 0.9rem;
}
.foot a { color: var(--ink-soft); min-height: 44px; display: inline-flex; align-items: center; }

@media (max-width: 30rem) {
  .panel, .card { padding: 1rem; }
  .brand__tag { display: none; }
  .btn { width: 100%; }
  .row .btn { width: auto; flex: 1 1 auto; }
  .who .btn, .row--tight .btn { width: auto; flex: 0 0 auto; }
}

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