/* Physiotherapy Plus — shared design tokens and components.
   Linked first on every page; page stylesheets extend it. */

:root {
  /* Ink (Craig's text colour, #1a1a2e) */
  --ink-900: #1a1a2e;
  --ink-800: #26263b;
  --ink-700: #3a3a52;
  --ink-500: #5d6073;
  --ink-400: #858799;
  --ink-300: #b1b3c1;

  /* Surfaces */
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #eff3f9;
  --sand: #f3f5f8; /* kept as a token; now a cool neutral */
  --line: #dfe5ee;
  --line-strong: #c7d1df;

  /* Brand navy (Physiotherapy Plus: #01428c, the "Book Now" blue on Craig's own site) */
  --brand-950: #021a38;
  --brand-900: #032a5a;
  --brand-800: #013470;
  --brand-700: #01428c; /* primary: buttons, links, active states */
  --brand-600: #0b55a8;
  --brand-500: #1f6fcc; /* focus rings, highlights, icons */
  --brand-400: #4f92dc;
  --brand-300: #8db8ea; /* accents on dark */
  --brand-200: #bfd7f3;
  --brand-100: #dde9f8;
  --brand-50: #eff5fc;

  /* Accent: the logo's bright blue (decorative only — never body text) */
  --accent-600: #2a6fb8;
  --accent-500: #377ec8;
  --accent-200: #bcd5f0;
  --accent-100: #e2eefa;

  /* Status (info is violet so it never reads as the brand blue) */
  --success: #1c7d53;
  --success-bg: #e2f3ea;
  --warning: #9a6514;
  --warning-bg: #fbf0da;
  --danger: #b93a26;
  --danger-bg: #fbe6e1;
  --info: #5a4fa8;
  --info-bg: #f0eefa;

  /* Type */
  --font-display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  --text-3xl: clamp(1.875rem, 1.4rem + 1.8vw, 2.5rem);
  --text-4xl: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
  --text-5xl: clamp(2.6rem, 1.6rem + 4.2vw, 4.4rem);

  /* Shape and depth */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(26, 26, 46, 0.06);
  --shadow-sm: 0 1px 3px rgba(26, 26, 46, 0.07), 0 1px 2px rgba(26, 26, 46, 0.04);
  --shadow: 0 10px 30px -12px rgba(26, 26, 46, 0.18), 0 2px 6px rgba(26, 26, 46, 0.05);
  --shadow-lg: 0 30px 70px -24px rgba(26, 26, 46, 0.32), 0 6px 16px rgba(26, 26, 46, 0.06);
  --ring: 0 0 0 3px rgba(31, 111, 204, 0.8); /* brand-500; at 0.8 it measures ≥3:1 on white, --bg and --brand-50 (0.45 is under 2:1) */

  /* Layout */
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 76px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-800);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-900); }
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--ink-900);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: var(--text-4xl); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); letter-spacing: -0.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
::selection { background: var(--brand-200); color: var(--ink-900); }

:focus-visible { outline: 3px solid var(--brand-500); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Utilities ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--ink-900); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; transition: top 0.2s var(--ease); }
.skip-link:focus { top: 12px; color: #fff; }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand-600);
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--accent-500); }
.lead { font-size: var(--text-lg); color: var(--ink-500); line-height: 1.65; }
.muted { color: var(--ink-500); }
.small { font-size: var(--text-sm); }
.stack > * + * { margin-top: var(--stack, 1rem); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--cluster, 12px); align-items: center; }
.hidden, [hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink-900);
  --btn-border: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; letter-spacing: -0.005em;
  text-decoration: none; white-space: nowrap; line-height: 1;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { color: var(--btn-fg); border-color: var(--ink-300); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { --btn-bg: var(--brand-700); --btn-fg: #fff; --btn-border: var(--brand-700); box-shadow: 0 6px 16px -6px rgba(1, 66, 140, 0.55); }
.btn-primary:hover { --btn-bg: var(--brand-800); --btn-border: var(--brand-800); color: #fff; box-shadow: 0 10px 22px -8px rgba(1, 66, 140, 0.6); }
.btn-dark { --btn-bg: var(--ink-900); --btn-fg: #fff; --btn-border: var(--ink-900); }
.btn-dark:hover { --btn-bg: var(--ink-800); color: #fff; }
.btn-soft { --btn-bg: var(--brand-50); --btn-fg: var(--brand-800); --btn-border: var(--brand-100); }
.btn-soft:hover { --btn-bg: var(--brand-100); --btn-border: var(--brand-200); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; --btn-fg: var(--brand-700); }
.btn-ghost:hover { --btn-bg: var(--brand-50); box-shadow: none; }
.btn-danger { --btn-bg: var(--surface); --btn-fg: var(--danger); --btn-border: #efc3b9; }
.btn-danger:hover { --btn-bg: var(--danger-bg); border-color: #e4a597; }
.btn-on-dark { --btn-bg: rgba(255, 255, 255, 0.1); --btn-fg: #fff; --btn-border: rgba(255, 255, 255, 0.35); }
.btn-on-dark:hover { --btn-bg: rgba(255, 255, 255, 0.18); color: #fff; border-color: rgba(255, 255, 255, 0.6); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 0.85rem; }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: 1.02rem; }
.btn-block { display: flex; width: 100%; }

/* ---------- Cards, badges, alerts ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(20px, 3vw, 28px);
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--brand-50); color: var(--brand-800);
  border: 1px solid var(--brand-100);
  font-size: var(--text-xs); font-weight: 600; line-height: 1.4; white-space: nowrap;
}
/* Accent badge ("New", "Start here"): solid logo blue, so it stands apart from the soft navy badges. */
.badge--accent { background: var(--accent-600); color: #fff; border-color: var(--accent-600); }
.badge--success { background: var(--success-bg); color: var(--success); border-color: #bfe3cf; }
.badge--warning { background: var(--warning-bg); color: var(--warning); border-color: #f1d9a8; }
.badge--danger { background: var(--danger-bg); color: var(--danger); border-color: #f1c2b8; }
.badge--neutral { background: var(--surface-2); color: var(--ink-700); border-color: var(--line); }

.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-800);
  font-size: var(--text-sm);
}
.alert--info { background: var(--info-bg); border-color: #d6d1f0; color: #3b3275; }
.alert--success { background: var(--success-bg); border-color: #bfe3cf; color: #145c3d; }
.alert--warning { background: var(--warning-bg); border-color: #f1d9a8; color: #6d470c; }
.alert--danger { background: var(--danger-bg); border-color: #f1c2b8; color: #8a2a1b; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 16px; }
.label { font-weight: 600; font-size: var(--text-sm); color: var(--ink-900); }
.label .optional { font-weight: 400; color: var(--ink-500); }
.input, .select, .textarea {
  width: 100%; min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-900);
  font-size: 1rem; /* ≥16px stops iOS zoom */
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 40px; background-image: 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='%235d6073' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input::placeholder, .textarea::placeholder { color: var(--ink-300); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-300); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--ring); }
.field.is-invalid .input, .field.is-invalid .select, .field.is-invalid .textarea, .input[aria-invalid="true"] { border-color: var(--danger); }
.hint { font-size: var(--text-sm); color: var(--ink-500); }
.field-error { font-size: var(--text-sm); color: var(--danger); font-weight: 500; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: var(--text-sm); color: var(--ink-700); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand-700); flex: none; }

/* ---------- Spinner / skeleton ---------- */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--brand-100); border-top-color: var(--brand-700); animation: pp-spin 0.8s linear infinite; }
@keyframes pp-spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, #e3eaf3 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: pp-shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes pp-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 249, 252, 0.82);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); background: rgba(255, 255, 255, 0.9); box-shadow: 0 6px 24px -18px rgba(26, 26, 46, 0.35); }
.site-header__inner { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
/* Brand lockup, after Craig's logo: "Physiotherapy" in a light humanist sans, the tagline over a thin
   rule beneath it, then the navy-and-blue "plus" cross. The link's aria-label names it; the mark is decorative. */
.brand { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--ink-900); flex: none; }
.brand:hover { color: var(--ink-900); }
.brand__text { display: grid; justify-items: start; line-height: 1; }
.brand__name { font-family: var(--font-body); font-weight: 300; font-size: 1.95rem; letter-spacing: -0.025em; line-height: 1; padding-bottom: 1px; }
.brand__tagline {
  margin-top: 5px; padding: 0 2px 4px 0; border-bottom: 1px solid var(--ink-300);
  font-size: 0.7rem; font-weight: 400; letter-spacing: 0.005em; color: var(--ink-500); white-space: nowrap;
}
.brand__mark { width: auto; height: 58px; flex: none; } /* a touch taller than the text, as in the original logo */
@media (max-width: 599px) {
  .brand { gap: 6px; }
  .brand__name { font-size: 1.6rem; }
  .brand__tagline { display: none; }
  .brand__mark { height: 42px; }
}
@media (max-width: 359px) {
  .brand__name { font-size: 1.38rem; }
  .brand__mark { height: 36px; }
}
.header-link { font-weight: 600; font-size: var(--text-sm); color: var(--ink-700); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.header-link:hover { color: var(--brand-700); }
.header-link svg { width: 16px; height: 16px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-950); color: rgba(255, 255, 255, 0.72); padding: 64px 0 28px; font-size: var(--text-sm); }
.site-footer a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer h2, .site-footer h3, .site-footer h4 { color: #fff; font-size: var(--text-base); margin-bottom: 14px; letter-spacing: -0.005em; }
.site-footer .brand, .site-footer .brand:hover { color: #fff; }
/* The footer has room for the whole lockup at every width. */
.site-footer .brand { gap: 7px; }
.site-footer .brand__name { font-size: 1.95rem; }
.site-footer .brand__mark { height: 58px; }
.site-footer .brand__tagline { display: block; color: rgba(255, 255, 255, 0.66); border-bottom-color: rgba(255, 255, 255, 0.24); }
.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 48px; padding-top: 22px; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; color: rgba(255, 255, 255, 0.55); font-size: var(--text-xs); }

/* ---------- Toast ---------- */
.toast-region { position: fixed; z-index: 200; right: 16px; bottom: 16px; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--ink-900); color: #fff; padding: 14px 16px; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: var(--text-sm); display: flex; gap: 10px; align-items: flex-start; animation: pp-toast-in 0.3s var(--ease); }
.toast--success { background: #0f4f3a; }
.toast--error { background: #7a2416; }
@keyframes pp-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Icons ---------- */
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-chip { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); flex: none; }
.icon-chip .icon { width: 24px; height: 24px; }
