/* FS Coach — one small stylesheet, no framework. Styled after fitsquad.ca: black and white,
   neon-yellow accent, condensed uppercase headings, pill buttons. Fonts are self-hosted (the
   Content-Security-Policy allows nothing else). Inter, League Gothic and Fragment Mono are open
   source (SIL OFL, see fonts/). Headings use the gym's own Alt Gothic file, only for logged-in
   users (heading-font.css + /fonts in main.py); without it — e.g. on the login page — League
   Gothic, a free revival of the same design, takes over. */
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "League Gothic"; src: url("fonts/league-gothic-latin-wdth-normal.woff2") format("woff2"); font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Fragment Mono"; src: url("fonts/fragment-mono-latin-400-normal.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #f2f2f2;
  --surface: #ffffff;
  --text: #010101;
  --muted: #4f4f4f;
  --faint: #bdbdbd;
  --border: #e0e0e0;
  --ink: #010101;          /* top bar, primary buttons */
  --ink-text: #ffffff;
  --brand: #f6ff01;        /* Fit Squad yellow — on black, or as a highlighter behind black text */
  --accent: #010101;       /* links, focus rings, active tabs */
  --primary: #010101; --primary-text: #ffffff; --primary-hover: #f6ff01; --primary-hover-text: #010101;
  --danger: #b42318;
  --ok-bg: #e7f6ec;   --ok-text: #14532d;
  --warn-bg: #fff4e0; --warn-text: #7a4a00;
  --err-bg: #fdecec;  --err-text: #8a1c1c;
  --changed: rgba(246, 255, 1, .6);
  --radius: 20px;
  --radius-sm: 12px;
  --display: "Alt Gothic Cond ATF", "League Gothic", "Arial Narrow", Impact, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Fragment Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23010101' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #010101; --surface: #171717; --text: #ffffff; --muted: #bdbdbd; --faint: #4f4f4f; --border: #333333;
    --accent: #f6ff01;
    --primary: #f6ff01; --primary-text: #010101; --primary-hover: #ffffff; --primary-hover-text: #010101;
    --danger: #ff8a80;
    --ok-bg: #12321f; --ok-text: #b7f0c9; --warn-bg: #3a2a0c; --warn-text: #ffd9a0;
    --err-bg: #3b1515; --err-text: #ffc9c9; --changed: rgba(246, 255, 1, .22);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15.5px/1.5 var(--sans); letter-spacing: -0.01em;
}
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2 { font-family: var(--display); font-stretch: 85%; font-weight: 400; text-transform: uppercase; letter-spacing: .01em; line-height: 1; }
h1 { font-size: 3rem; margin: 0 0 .5rem; }
h2 { font-size: 1.9rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 0 0 .5rem; }
code { font-family: var(--mono); }
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem; }
footer { max-width: 1100px; margin: 2rem auto 1rem; padding: 0 1rem; color: var(--muted); font-size: .8rem; }

.banner { padding: .5rem 1rem; text-align: center; font-size: .85rem; font-weight: 500; }
.banner.warn { background: var(--brand); color: #010101; }

.topbar {
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; justify-content: space-between;
  padding: .85rem 1.25rem; background: var(--ink); color: var(--ink-text); border-bottom: 1px solid #212121;
}
/* Logo + "Coaching Assistant" in the site's extra-condensed headline style */
.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: #fff; }
.brand img { height: 26px; width: auto; display: block; }
.brand span { font-family: var(--display); font-stretch: 80%; text-transform: uppercase; font-size: 2.15rem; line-height: 1; letter-spacing: .01em; color: #fff; padding-left: .9rem; border-left: 1px solid #4f4f4f; }
.mainnav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; align-items: center; font-weight: 500; font-size: .95rem; }
.mainnav a { text-decoration: none; color: #fff; }
.mainnav a:hover { color: var(--brand); }
.mainnav .linklike { color: #fff; background: rgba(255, 255, 255, .14); border-radius: 999px; padding: .35rem .9rem; }
.mainnav .linklike:hover { background: #fff; color: #010101; }
.subnav { display: flex; gap: 1.25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.subnav a { padding: .4rem 0; text-decoration: none; color: var(--muted); font-family: var(--display); text-transform: uppercase; font-size: 1.35rem; letter-spacing: .02em; }
.subnav a.active { color: var(--text); border-bottom: 2px solid var(--text); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1rem; }
.card.narrow { max-width: 560px; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h2:not(:first-child) { margin-top: 1.75rem; }
.pagehead { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.25rem; }
.pagehead h1 { margin: 0; }
.pagehead p { margin: .35rem 0 0; }
.muted { color: var(--muted); font-size: .9rem; }
.empty { color: var(--muted); padding: 1rem 0; }
.prewrap { white-space: pre-wrap; }
.right { text-align: right; }
.tag { display: inline-block; padding: .05rem .6rem; border-radius: 999px; background: transparent; border: 1px solid var(--border); font-size: .75rem; color: var(--muted); vertical-align: middle; }
.tag.warn { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.tag.error { background: var(--err-bg); color: var(--err-text); border-color: transparent; }

.flash { padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: .75rem; background: var(--ok-bg); color: var(--ok-text); }
.flash.error { background: var(--err-bg); color: var(--err-text); }
.flash.warn { background: var(--warn-bg); color: var(--warn-text); }

/* forms */
form.stack { display: flex; flex-direction: column; gap: 1rem; }
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 500; }
label.check { flex-direction: row; align-items: flex-start; gap: .55rem; font-weight: 400; }
label.check input { flex: none; margin: .3rem 0 0; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; margin: 0; }
legend { font-weight: 600; padding: 0 .25rem; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .35rem 1rem; }
input, select, textarea {
  font: inherit; line-height: 1.25; letter-spacing: inherit; color: var(--text); background-color: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .85rem;
}
input[type=checkbox], input[type=radio] { accent-color: var(--text); width: 1rem; height: 1rem; padding: 0; }
select:not([multiple]) {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: var(--chevron); background-repeat: no-repeat; background-position: right .95rem center; background-size: 12px 8px;
  padding-right: 2.6rem;
}
textarea { line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; }
select[multiple] { min-height: 9rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: end; }  /* fields line up even when one label wraps */
.help { font-weight: 400; color: var(--muted); font-size: .85rem; }

/* buttons: pills, like the site */
button, .button {
  font: inherit; letter-spacing: inherit; font-weight: 500; line-height: 1.25; cursor: pointer; text-decoration: none; display: inline-block;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .6rem 1.3rem;
  transition: background-color .15s, color .15s, border-color .15s;
}
button:hover, .button:hover { border-color: var(--text); }
button:focus-visible, .button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.primary:hover { background: var(--primary-hover); color: var(--primary-hover-text); border-color: var(--primary-hover); }
.primary::after { content: "→"; display: inline-block; margin-left: .55rem; }
.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.small { font-size: .85rem; padding: .35rem .85rem; }
.linklike { border: none; background: none; color: var(--text); padding: 0; font-weight: 400; border-radius: 0; }
.linklike:hover { color: var(--muted); }
form.inline { display: inline-flex; gap: .4rem; align-items: center; margin: 0; }
.actions { display: flex; gap: .6rem; align-items: center; margin-top: .5rem; }
.actions.wrap { flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.filters input[type=search] { min-width: 240px; }
.filters input, .filters select, form.inline select { border-radius: 999px; padding-left: 1.1rem; }

/* tables */
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list tr:last-child td { border-bottom: none; }
table.list th { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface); }
table.list.compact td { font-size: .9rem; padding: .5rem .75rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

/* 2FA */
.steps li { margin-bottom: .75rem; }
.qr { margin: .75rem 0; }
.qr img { background: #fff; padding: 6px; border-radius: var(--radius-sm); }
code.secret { word-break: break-all; }
.temp-password code { font-size: 1.4rem; padding: .5rem .75rem; background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius-sm); display: inline-block; }

/* questionnaire */
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem 1.25rem; }
.qwide { grid-column: 1 / -1; }

/* job progress */
.progress-box { display: flex; gap: 1rem; align-items: flex-start; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--text); border-radius: 50%; animation: spin 1s linear infinite; flex: none; margin-top: .2rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.thinking { font-size: .9rem; color: var(--muted); white-space: pre-wrap; max-height: 12rem; overflow: hidden; }

/* program view */
.issues { list-style: none; padding: 0; margin: 0; }
.issues li { padding: .5rem .8rem; border-radius: var(--radius-sm); margin-bottom: .35rem; }
.issues li.violation { background: var(--err-bg); color: var(--err-text); }
.issues li.warning { background: var(--warn-bg); color: var(--warn-text); }
/* week tabs: big condensed words, the active one underlined (like the site's equipment tabs) */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin-bottom: 1rem; }
.tabs button { background: none; border: none; border-radius: 0; padding: .1rem 0; font-family: var(--display); font-stretch: 85%; font-size: 1.85rem; text-transform: uppercase; letter-spacing: .01em; color: var(--faint); border-bottom: 2px solid transparent; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--text); }
.tabpanel[hidden] { display: none; }
.workouts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.workout { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.workout header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.workout h3 { font-family: var(--display); font-stretch: 85%; font-weight: 400; font-size: 1.65rem; text-transform: uppercase; letter-spacing: .01em; margin: 0; }
.workout pre { font-family: var(--mono); font-size: .82rem; letter-spacing: 0; white-space: pre-wrap; margin: 0; line-height: 1.6; }
.workout .line.changed { background: var(--changed); border-radius: 3px; }
.workout .line.unlisted { color: var(--danger); font-weight: 600; }
.copied-tick { display: none; color: #010101; background: var(--brand); font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: 0; text-transform: none; padding: .15rem .55rem; border-radius: 999px; vertical-align: middle; }
.workout.is-copied { border-color: var(--text); }
.workout.is-copied .copied-tick { display: inline-block; }
.copy-progress { margin: .25rem 0 0; }
.chat textarea { width: 100%; }
.versions { list-style: none; padding: 0; margin: 0; }
.versions li { padding: .45rem 0; border-bottom: 1px solid var(--border); }
.versions li.current { font-weight: 600; }
.notes-list { margin: 0; padding-left: 1.2rem; }
.hidden-copy { position: absolute; left: -9999px; width: 1px; height: 1px; }

@media (max-width: 640px) {
  main { padding: 1rem .75rem; }
  .row2 { grid-template-columns: 1fr; }
  table.list th:nth-child(n+4), table.list td:nth-child(n+4) { display: none; }
  .workouts { grid-template-columns: 1fr; }
  h1 { font-size: 2.4rem; }
  .tabs button { font-size: 1.5rem; }
  .brand img { height: 20px; }
  .brand span { font-size: 1.65rem; padding-left: .7rem; }
}
