/* Solebury Soccer: the one stylesheet. Colors follow soleburysoccer.org; light
   and dark follow the device. Pages use the building blocks in src/ui.ts;
   /styleguide shows every one. Plain elements get a baseline so an unstyled
   page still reads well. */

@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(/assets/source-sans-3-v20-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(/assets/source-sans-3-v20-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---- Tokens ---- */
:root {
  color-scheme: light dark;
  --font: "Source Sans 3", system-ui, sans-serif;
  --bg:          light-dark(#F6F4EF, #0A1626);
  --surface:     light-dark(#FFFFFF, #112238);
  --surface-2:   light-dark(#FBFAF7, #16293F);
  --text:        light-dark(#1E2A38, #E6EAF0);
  --muted:       light-dark(#5B6676, #9AA8BA);
  --line:        light-dark(#E2DDD3, #24384F);
  --line-strong: light-dark(#CFC8BB, #34506F);
  --header:      light-dark(#0B2138, #071120);
  --header-text: #FFFFFF;
  --primary:     #F4C430;
  --primary-hover: #E4B322;
  --primary-text: #0B2138;
  --link:        light-dark(#133B63, #F2CF5B);
  --control:     light-dark(#133B63, #F4C430);
  --ok:     light-dark(#1F7A4D, #6FCF97); --ok-bg:     light-dark(#E5F3EA, #12301F);
  --warn:   light-dark(#9A5B00, #F0B45A); --warn-bg:   light-dark(#FDF1DC, #33240E);
  --danger: light-dark(#B91C1C, #F59A92); --danger-bg: light-dark(#FEF2F2, #3A1717);
  --info:   light-dark(#133B63, #9DC0EA); --info-bg:   light-dark(#E7EEF6, #14273F);
  --shadow: light-dark(0 12px 32px rgba(15,47,79,.10), 0 12px 32px rgba(0,0,0,.35));
  --radius: 12px;
  --radius-sm: 8px;
}

/* ---- Baseline for plain elements ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 var(--font); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .4em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; margin-top: 1.6em; }
h3 { font-size: 1.05rem; margin-top: 1.4em; }
p, ul, ol { margin: 0 0 .9em; }
a { color: var(--link); text-underline-offset: .15em; }
small { color: var(--muted); font-size: .88rem; }
:focus-visible { outline: 3px solid var(--control); outline-offset: 2px; border-radius: 4px; }
label { display: block; margin: 0 0 1rem; font-weight: 600; }
label > input:not([type=checkbox]):not([type=radio]), label > select, label > textarea { display: block; margin-top: .3rem; font-weight: 400; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: .55rem .7rem; min-height: 46px; width: 100%; max-width: 28rem; }
textarea { min-height: 6rem; }
input[type=checkbox], input[type=radio] { accent-color: var(--control); width: 1.2rem; height: 1.2rem; margin: 0 .5rem 0 0; vertical-align: -.2em; }
button { font: inherit; font-weight: 700; cursor: pointer; min-height: 46px; padding: .55rem 1.15rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--primary); color: var(--primary-text); }
button:hover { background: var(--primary-hover); }
table { border-collapse: collapse; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0 0 1rem; }
th, td { text-align: left; vertical-align: top; padding: .55rem .75rem; border-bottom: 1px solid var(--line); }
th { font-size: .88rem; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td label { display: inline; margin: 0; font-weight: 400; }
.error { color: var(--danger); font-weight: 600; }

/* ---- Frame ---- */
.app-header { background: var(--header); color: var(--header-text); border-bottom: 3px solid var(--primary); }
.app-header > div { max-width: 44rem; margin: 0 auto; display: flex; align-items: center; gap: .65rem; padding: .65rem 1rem; }
.brand { display: flex; align-items: center; gap: .65rem; color: inherit; text-decoration: none; font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.brand img { width: 38px; height: 38px; }
.app-header .account { margin-left: auto; color: #C9D3E0; font-size: .9rem; }
main { max-width: 44rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

/* ---- Page head ---- */
.eyebrow { color: var(--muted); font-size: .85rem; font-weight: 600; margin: 0 0 .25rem; }
.meta { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 1rem; }
.back { display: inline-block; margin-bottom: .8rem; font-size: .95rem; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; text-decoration: none; font-weight: 700; }
a.btn { min-height: 46px; padding: .55rem 1.15rem; border-radius: var(--radius-sm); border: 1px solid transparent; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-quiet { background: none; color: var(--link); border-color: transparent; text-decoration: underline; font-weight: 600; padding-inline: .4rem; }
.btn-quiet:hover { background: none; }
.btn-block { display: flex; width: 100%; }
.actions { display: grid; gap: .6rem; margin-top: 1.4rem; }
/* A gated button waits for its form's gate checkbox (the waiver); the browser still enforces it on submit. */
form:has([data-gate]:not(:checked)) [data-gated] { opacity: .45; pointer-events: none; }
.gate-hint { display: none; text-align: center; }
form:has([data-gate]:not(:checked)) .gate-hint { display: block; }

/* ---- Forms ---- */
.field > span { display: block; }
.field .opt { color: var(--muted); font-weight: 400; font-size: .9rem; }
.field .hint { display: block; color: var(--muted); font-weight: 400; font-size: .92rem; margin-top: .1rem; }
.field .error { display: block; margin-top: .3rem; font-size: .9rem; }
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.check { display: flex; gap: .1rem; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .15rem; }
.waiver { max-height: 12rem; overflow: auto; white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .7rem .8rem; font-size: .92rem; color: var(--muted); margin: 0 0 .8rem; }
.section { margin-top: 1.8rem; }
.section > h2 { margin-top: 0; }

/* ---- Rows: a list where each row is one target (a link, a radio, a checkbox) ---- */
.rows { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.row { display: flex; align-items: center; gap: .75rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .8rem .9rem; margin: 0; color: inherit; text-decoration: none; font-weight: 400; }
a.row:hover, label.row:hover { border-color: var(--line-strong); }
label.row { cursor: pointer; }
.row:has(input:checked) { border-color: var(--control); box-shadow: inset 0 0 0 1px var(--control); }
.row .grow { flex: 1; min-width: 0; }
.row b { display: block; font-weight: 600; }
.row small { display: block; }
.row .go { color: var(--muted); font-size: 1.3rem; line-height: 1; }
.row.off { opacity: .6; }
.row input { margin: 0; flex: none; }

/* ---- Badges and notices ---- */
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.badge.info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.notice { border-radius: var(--radius-sm); padding: .7rem .85rem; margin: 0 0 1rem; border-left: 4px solid; }
.notice > :last-child { margin-bottom: 0; }
.notice.info { background: var(--info-bg); border-color: var(--info); }
.notice.ok { background: var(--ok-bg); border-color: var(--ok); }
.notice.warn { background: var(--warn-bg); border-color: var(--warn); }
.notice.danger { background: var(--danger-bg); border-color: var(--danger); color: var(--text); font-weight: 400; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
