/* CoreFitness brand colors from the supplied kit (2026-12-04): blue #0056A5, orange #EF5D22, white. No black anywhere.
   --cf-blue-dark / --cf-blue-deep (header, footer) and --cf-orange-dark (pressed) are derived shades, not official swatches.
   Orange is used for non-text accents (bars, focus rings, stripes) and for the Submit button with LARGE bold white text
   (20px/700 = WCAG "large text"; white on #EF5D22 is 3.36:1, which passes AA for large text only). Orange text on blue is never used
   (#EF5D22 on #0056A5 is 2.18:1). Every ratio is computed from these variables by tests/contrast.test.mjs and listed in docs/contrast.md.
   Font: Inter (variable, SIL OFL 1.1, self-hosted from @fontsource-variable/inter; license in /fonts/Inter-OFL.txt). */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --cf-blue: #0056A5;
  --cf-blue-dark: #003d75;
  --cf-blue-deep: #00305c;
  --cf-blue-light: #e8f1fa;
  --cf-orange: #EF5D22;
  --cf-orange-dark: #c94a14;
  --cf-white: #ffffff;
  --cf-ink: #14213d;
  --cf-field-border: #0056A5; /* brand blue: 7.31:1 against the white field */
  --cf-muted: #44506a;        /* placeholder text on white */
  --cf-error: #b00020;
  --cf-line: rgba(255, 255, 255, 0.22);
  --radius: 14px;
  --tap: 56px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Same blue as <meta name="theme-color"> and the manifest, so no white strip shows behind the status bar or in overscroll. */
  background: var(--cf-blue);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font: 18px/1.45 var(--font);
  color: var(--cf-white);
  background-color: var(--cf-blue);
  background-image: radial-gradient(1100px 520px at 50% -8%, #1a6fbd 0%, rgba(0, 86, 165, 0) 60%);
  background-repeat: no-repeat;
  -webkit-tap-highlight-color: transparent;
  padding-right: env(safe-area-inset-right);
  padding-left: env(safe-area-inset-left);
}

a { color: inherit; }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--cf-white);
  color: var(--cf-blue-dark);
  font-weight: 700;
}
.skip:focus { top: calc(10px + env(safe-area-inset-top)); outline: 3px solid var(--cf-orange); }

/* ---------- header (sticky, like the reference site: logo left, menu right) ---------- */
header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(0, 61, 117, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--cf-line);
  box-shadow: 0 2px 0 var(--cf-orange), 0 10px 30px rgba(0, 32, 68, 0.35);
  /* The top safe-area inset sits INSIDE the blue header, so the status bar area is blue, never white. */
  padding-top: env(safe-area-inset-top);
}
.top-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 960px;
  margin: 0 auto;
  padding: 10px clamp(16px, 4vw, 40px);
}
.brand { display: inline-block; line-height: 0; border-radius: 8px; }
.brand img { width: 90px; height: auto; display: block; }
.brand:focus-visible { outline: 3px solid var(--cf-orange); outline-offset: 4px; }

.site-menu { margin-left: auto; position: relative; display: flex; align-items: center; }
.menu-btn {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--cf-white);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 12px;
  cursor: pointer;
}
.menu-btn svg { width: 24px; height: 24px; display: block; }
.menu-btn[aria-expanded="true"] { background: var(--cf-white); color: var(--cf-blue); border-color: var(--cf-white); }
.menu-btn:focus-visible { outline: 3px solid var(--cf-orange); outline-offset: 2px; }

.menu-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: 280px;
  padding: 8px;
  background: var(--cf-white);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 32, 68, 0.45);
  border-top: 4px solid var(--cf-orange);
}
.menu-panel.open, html:not(.js) .site-menu:focus-within .menu-panel { display: block; }
.menu-panel ul { list-style: none; margin: 0; padding: 0; }
.menu-panel a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--cf-ink);
  font-weight: 650;
  text-decoration: none;
}
.menu-panel a:hover { background: var(--cf-blue-light); }
.menu-panel a[aria-current="page"] { color: var(--cf-blue); background: var(--cf-blue-light); box-shadow: inset 4px 0 0 var(--cf-orange); }
.menu-panel a:focus-visible { outline: 3px solid var(--cf-blue); outline-offset: -3px; }
@media (max-width: 560px) {
  .site-menu { position: static; }
  .menu-panel { left: 0; right: 0; top: 100%; width: auto; border-radius: 0 0 16px 16px; padding: 8px 12px 12px; }
}

/* ---------- page ---------- */
.app {
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.hero { text-align: center; padding: 34px 0 26px; }
.logo { display: block; width: 280px; max-width: 100%; height: auto; margin: 0 auto 22px; }
h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--cf-white);
}
h1::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin: 16px auto 0;
  border-radius: 2px;
  background: var(--cf-orange);
}

.card {
  background: var(--cf-white);
  color: var(--cf-ink);
  border-radius: 18px;
  border-top: 4px solid var(--cf-orange);
  padding: 24px 18px;
  box-shadow: 0 24px 60px rgba(0, 32, 68, 0.35);
}

.field { margin-bottom: 18px; }
label { display: block; margin-bottom: 6px; font-weight: 650; font-size: 17px; }

input[type="text"],
input[type="email"],
input[type="tel"] {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  font: inherit;
  font-size: 18px; /* 16px or larger keeps iOS Safari from zooming on focus */
  color: var(--cf-ink);
  background: var(--cf-white);
  border: 2px solid var(--cf-field-border);
  border-radius: 12px;
  appearance: none;
  -webkit-appearance: none;
}
input::placeholder { color: var(--cf-muted); opacity: 1; }
input:focus { outline: 3px solid var(--cf-orange); outline-offset: 1px; border-color: var(--cf-blue-dark); }
/* Set by app.js together with the visible message under the field (color is never the only signal). */
input[aria-invalid="true"] { border-color: var(--cf-error); border-width: 3px; }
.field-error { margin: 6px 0 0; font-size: 16px; font-weight: 600; color: var(--cf-error); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.error { color: var(--cf-error); font-weight: 600; margin: 0 0 14px; }

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--tap);
  padding: 14px 20px;
  font: inherit;
  font-size: 20px;   /* 20px bold = WCAG large text, so white on orange (3.36:1) passes AA */
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--cf-white);
  background: var(--cf-orange);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(239, 93, 34, 0.3);
  text-decoration: none;
  cursor: pointer;
}
.button:active { background: var(--cf-orange-dark); }
.button:focus-visible { outline: 3px solid var(--cf-blue); outline-offset: 3px; }
.button[disabled] { opacity: 0.7; cursor: progress; }
.button-secondary { color: var(--cf-blue); background: var(--cf-white); border: 2px solid var(--cf-blue); box-shadow: none; }

.done { text-align: center; }
.done h2 { margin: 0 0 14px; font-size: 26px; color: var(--cf-blue); }
.done p { margin: 0; }
.link-button {
  min-height: var(--tap);
  padding: 8px 18px;
  font: inherit;
  font-weight: 650;
  color: var(--cf-blue);
  background: var(--cf-white);
  border: 2px solid var(--cf-blue);
  border-radius: 12px;
  cursor: pointer;
}
.link-button:focus-visible { outline: 3px solid var(--cf-orange); outline-offset: 2px; }

/* ---------- QR page ---------- */
.qr-card { text-align: center; }
.qr-title { margin: 0 0 14px; font-size: 22px; color: var(--cf-blue); }
.qr { display: block; width: 300px; max-width: 100%; height: auto; margin: 0 auto; image-rendering: pixelated; }
.qr-url { margin: 12px 0 18px; font-weight: 650; color: var(--cf-ink); word-break: break-all; }
.qr-actions { display: grid; gap: 12px; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--cf-blue-deep);
  border-top: 3px solid var(--cf-orange);
  color: var(--cf-white);
  text-align: center;
  font-size: 16px;
  padding: 26px 16px calc(26px + env(safe-area-inset-bottom));
}
.foot-inner { max-width: 960px; margin: 0 auto; }
.foot-name { margin: 0 0 6px; font-weight: 800; font-size: 18px; letter-spacing: 0.04em; text-transform: uppercase; }
.foot-line { margin: 0 0 6px; }
.site-footer a { color: var(--cf-white); text-underline-offset: 3px; }
.site-footer a:hover { text-decoration-color: var(--cf-orange); }
.site-footer a:focus-visible { outline: 3px solid var(--cf-orange); outline-offset: 2px; border-radius: 4px; }
.foot-social { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.foot-social a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}

@media (min-width: 600px) {
  .hero { padding-top: 48px; }
  .card { padding: 28px 26px; }
  .qr-actions { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .menu-btn, .menu-panel a { transition: background-color 0.15s ease, color 0.15s ease; }
}
