/* Fonts, served from our own site. Figtree (SIL Open Font License, see fonts/OFL-Figtree.txt) for reading;
   Gilam Bold (Fontfabric) for the logo and headings, as in the Sevenoaks Driving Lessons brand. */
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("fonts/figtree-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Gilam"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/gilam-700.woff2") format("woff2");
}

/* Brand colours: near-black #1D1D1B, red #DB3532, amber #FDB316, green #3CB54C, on cream #F6F3EE.
   Amber and green are fills only on light backgrounds (too faint as text); --brand is a darker green for
   text, ticks and borders on white. */
:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --text: #1d1d1b;
  --muted: #55554f;
  --border: #d9d4cc;
  --red: #db3532;
  --amber: #fdb316;
  --green: #3cb54c;
  --green-hover: #34a343;
  --on-green: #1d1d1b;
  --brand: #1e7a31;
  --brand-hover: #17602a;
  --accent: #db3532;
  --focus: #fdb316;
  --error: #b3261e;
  --info-bg: #e7f1fb;
  --info-fg: #1d5fa8;
  --success-bg: #e6f4e8;
  --warn-bg: #fdf1dc;
  --warn-fg: #8a5300;
  --radius: 14px;
  --display: "Gilam", "Figtree", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151514; --surface: #1f1f1d; --text: #f6f3ee; --muted: #b3aea5; --border: #3a3935;
    --brand: #3cb54c; --brand-hover: #52c462; --accent: #ec5b57; --error: #f2948c;
    --info-bg: #1c2b3b; --info-fg: #8cc0f5; --success-bg: #183126; --warn-bg: #352812; --warn-fg: #f2c27a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151514; --surface: #1f1f1d; --text: #f6f3ee; --muted: #b3aea5; --border: #3a3935;
  --brand: #3cb54c; --brand-hover: #52c462; --accent: #ec5b57; --error: #f2948c;
  --info-bg: #1c2b3b; --info-fg: #8cc0f5; --success-bg: #183126; --warn-bg: #352812; --warn-fg: #f2c27a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.55 "Figtree", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
a { color: var(--info-fg); }
:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }  /* amber is too faint on cream */
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.site-header { padding: 18px 16px; max-width: 640px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand img { width: 46px; height: 46px; flex: none; }
.wordmark { display: flex; flex-direction: column; font-family: var(--display); font-weight: 700; text-transform: uppercase; line-height: 1; letter-spacing: .01em; }
.wordmark .place { font-size: 15px; letter-spacing: .08em; }
.wordmark .name { font-size: 21px; }
.wordmark em { font-style: normal; color: var(--accent); }

/* The three traffic-light bars from the book cover. */
.signal { display: flex; gap: 8px; margin: 18px 0 20px; }
.signal span { width: 44px; height: 8px; border-radius: 4px; background: var(--red); }
.signal span:nth-child(2) { background: var(--amber); }
.signal span:nth-child(3) { background: var(--green); }
.signal.small { gap: 5px; margin: 0 0 14px; }
.signal.small span { width: 26px; height: 5px; }

.hero { padding: 16px 0 24px; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: 0; }
h1 { font-size: clamp(30px, 7vw, 42px); line-height: 1.12; margin: 0 0 12px; }
h2 { font-size: 26px; line-height: 1.2; margin: 24px 0 8px; }  /* about 1.6× body, as the brand guidelines say */
h3, legend, summary { font-weight: 700; }
.card h1 { font-size: 28px; }
.lede { font-size: 19px; color: var(--muted); margin: 0 0 20px; }
.how { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.how li { display: flex; align-items: center; gap: 12px; }
.how span {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--green); color: var(--on-green); font-weight: 700; font-size: 15px;
}

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 20px; margin-bottom: 24px;
}
@media (min-width: 560px) { .card { padding: 32px; } }
.card > h2:first-of-type { margin-top: 0; }

.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 20px; font-size: 14px; color: var(--muted); counter-reset: step; }
.steps li { flex: 1; border-top: 4px solid var(--border); padding-top: 6px; counter-increment: step; }
.steps li::before { content: counter(step) ". "; }
.steps li.done { border-color: var(--brand); }
.steps li.current { border-color: var(--brand); color: var(--text); font-weight: 700; }

fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font-weight: 700; margin-bottom: 8px; font-size: 19px; }
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 700; margin-bottom: 4px; }
.hint { color: var(--muted); font-size: 16px; margin: 0 0 8px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row .field { min-width: 0; }
input[type="email"], input[type="tel"], input[type="date"], input[type="time"] {
  width: 100%; font: inherit; padding: 10px 12px; min-height: 48px;
  border: 2px solid var(--text); border-radius: 8px; background: var(--surface); color: var(--text);
}
.has-error { border-left: 4px solid var(--error); padding-left: 12px; }
.has-error input { border-color: var(--error); }
.error { color: var(--error); font-weight: 700; margin: 0 0 6px; font-size: 16px; }
.error-summary { border: 3px solid var(--error); border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; }
.error-summary h2 { margin: 0 0 6px; font-size: 19px; font-family: inherit; }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary a { color: var(--error); }

.checkbox { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.checkbox .error { grid-column: 1 / -1; }
.checkbox input { width: 26px; height: 26px; margin: 2px 0 0; accent-color: var(--brand); }
.checkbox label { font-weight: 400; font-size: 16px; }

.add-date { display: flex; gap: 10px; }
.add-date input { flex: 1; min-width: 0; }
.chips { list-style: none; padding: 0; margin: 12px 0 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { display: inline-flex; align-items: center; gap: 4px; background: var(--warn-bg); color: var(--warn-fg); border-radius: 999px; padding: 4px 6px 4px 14px; font-size: 15px; }
.chip-remove { border: 0; background: transparent; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; width: 28px; height: 28px; border-radius: 50%; }
.chip-remove:hover { background: rgba(0,0,0,.08); }

.note, .summary { background: var(--bg); border-radius: 8px; padding: 10px 14px; font-size: 16px; }
.button {
  display: inline-block; font: inherit; font-weight: 700; text-decoration: none; text-align: center; cursor: pointer;
  border: 0; border-radius: 10px; padding: 13px 22px; min-height: 48px;
  background: var(--green); color: var(--on-green); box-shadow: 0 3px 0 #2b8a39;
}
.button:hover { background: var(--green-hover); }
.button[hidden] { display: none; }
.button.secondary { background: var(--bg); color: var(--text); box-shadow: 0 3px 0 var(--border); border: 1px solid var(--border); }
.button.danger { background: var(--error); box-shadow: none; }
.button.link { background: none; box-shadow: none; color: var(--info-fg); text-decoration: underline; padding-left: 4px; padding-right: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 20px; }
.actions form { margin: 0; }

.icon-badge { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 700; margin-bottom: 12px; }
.icon-badge.success { background: var(--success-bg); color: var(--brand); }
.icon-badge.info { background: var(--info-bg); color: var(--info-fg); }
.icon-badge.warn { background: var(--warn-bg); color: var(--warn-fg); }

.swap { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin: 20px 0 8px; }
.swap > div:not(.arrow) { background: var(--bg); border-radius: 10px; padding: 14px; }
.swap dt { color: var(--muted); font-size: 14px; }
.swap dd { margin: 4px 0 0; font-weight: 700; }
.swap .arrow { font-size: 24px; color: var(--muted); }
@media (max-width: 480px) {
  .swap { grid-template-columns: 1fr; }
  .swap .arrow { text-align: center; transform: rotate(90deg); }
}

/* Subheadings are Figtree Bold; Gilam is for headlines. */
.prose h2, .timeline h2 { font-family: inherit; font-size: 19px; }
.draft-banner { background: var(--warn-bg); color: var(--warn-fg); padding: 8px 12px; border-radius: 8px; font-weight: 700; }
.outbox { padding-left: 20px; font-size: 15px; word-break: break-all; }

.site-footer { color: var(--muted); font-size: 15px; padding-bottom: 40px; }
.site-footer a { color: var(--muted); }

.optin { background: var(--info-bg); border-radius: 10px; padding: 12px; }
.notice { border-radius: 8px; padding: 10px 14px; font-weight: 700; }
.notice.warn { background: var(--warn-bg); color: var(--warn-fg); }
.option-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.option-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
}
.option-list li div { display: grid; }
.option-list form { margin: 0; }

/* admin */
.wrap.wide { max-width: 960px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; }
.admin-head form { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; gap: 4px; }
.tile-n { font-size: 32px; font-weight: 700; line-height: 1; }
.tile-l { color: var(--muted); font-size: 15px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.admin-table th, .admin-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: right; font-variant-numeric: tabular-nums; }
.admin-table th[scope="row"], .admin-table thead th:first-child { text-align: left; font-weight: 400; }
.admin-table thead th { color: var(--muted); font-size: 14px; font-weight: 400; }
.admin-grid { display: grid; gap: 0 24px; }
@media (min-width: 760px) { .admin-grid { grid-template-columns: 1fr 1fr; } }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.bars li { display: grid; grid-template-columns: 110px 1fr 32px; gap: 8px; align-items: center; }
.bars b { text-align: right; font-variant-numeric: tabular-nums; }
.bars progress { width: 100%; height: 14px; appearance: none; border: 0; border-radius: 4px; background: var(--bg); overflow: hidden; }
.bars progress::-webkit-progress-bar { background: var(--bg); border-radius: 4px; }
.bars progress::-webkit-progress-value { background: var(--brand); border-radius: 4px; }
.bars progress::-moz-progress-bar { background: var(--brand); border-radius: 4px; }
input[type="password"] {
  width: 100%; font: inherit; padding: 10px 12px; min-height: 48px;
  border: 2px solid var(--text); border-radius: 8px; background: var(--surface); color: var(--text);
}

body:has(.wide) .site-header, body:has(.wide) .site-footer { max-width: 960px; }

.promises { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.promises li {
  background: var(--success-bg); border-radius: 10px; padding: 12px 14px 12px 44px; position: relative; font-size: 17px;
}
.promises li::before {
  content: "✓"; position: absolute; left: 14px; top: 11px; font-weight: 700; color: var(--brand); font-size: 19px;
}
.provided-by { color: var(--text); }

/* header navigation */
.site-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 16px;
}
.site-nav a:hover { background: var(--surface); }
.site-nav a[aria-current="page"] { background: var(--surface); box-shadow: inset 0 -3px 0 var(--brand); }

/* notices */
.notice.info { background: var(--info-bg); color: var(--info-fg); font-weight: 400; }
.notice.info strong { font-weight: 700; }
.date-feedback .notice { margin: 0 0 16px; }

/* contact */
textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 2px solid var(--text); border-radius: 8px;
  background: var(--surface); color: var(--text); resize: vertical;
}
input[type="text"] {
  width: 100%; font: inherit; padding: 10px 12px; min-height: 48px;
  border: 2px solid var(--text); border-radius: 8px; background: var(--surface); color: var(--text);
}

/* FAQs accordion */
.faq-group { margin-bottom: 28px; }
.faq-group h2 { font-size: 24px; margin: 0 0 10px; }
.accordion { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.accordion details + details { border-top: 1px solid var(--border); }
.accordion summary {
  list-style: none; cursor: pointer; padding: 16px 52px 16px 18px; font-weight: 700; position: relative;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 3px solid var(--brand); border-bottom: 3px solid var(--brand); transform: rotate(45deg);
  transition: transform .2s ease;
}
.accordion details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.accordion summary:hover { background: var(--bg); }
.accordion .answer { padding: 0 18px 16px; color: var(--text); }
.accordion .answer p { margin: 0; }
.cta { text-align: center; }

/* "dates I can't do" calendar */
.excluded-summary { font-weight: 700; color: var(--warn-fg); min-height: 1.2em; margin: 4px 0 8px; }
.calendar { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 20px; }
.cal-month h3 { font-size: 17px; margin: 0 0 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head { font-size: 14px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal-day {
  aspect-ratio: 1; display: grid; place-items: center; font: inherit; font-size: 15px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; padding: 0;
}
button.cal-day:hover { border-color: var(--brand); }
button.cal-day[aria-pressed="true"] {
  background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-fg); font-weight: 700;
  text-decoration: line-through;
}
.cal-day.disabled { border-color: transparent; background: transparent; color: var(--muted); opacity: .45; cursor: default; }
.cal-day.own { opacity: 1; color: var(--brand); font-weight: 700; border: 2px solid var(--brand); }

/* radios */
.radios { border: 0; padding: 0; }
.radios legend { font-size: 18px; }
.radio { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; }
.radio input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.radio label { font-weight: 400; margin: 0; }
.radio-row { display: flex; gap: 20px; flex-wrap: wrap; }
fieldset.has-error { border-left: 4px solid var(--error); padding-left: 12px; }

/* swap page */
.notice.success { background: var(--success-bg); color: var(--text); font-weight: 400; }
.checklist { padding-left: 22px; margin: 8px 0 16px; }
.checklist li { margin-bottom: 6px; }
.phone-box { background: var(--bg); border-radius: 10px; padding: 14px 16px; margin: 12px 0 16px; }
.phone-box p { margin: 0; }
.phone-box .phone { font-size: 28px; font-weight: 700; }
.phone-box .phone a { color: var(--text); text-decoration: none; }
.ref { font-family: ui-monospace, Menlo, monospace; font-size: 20px; letter-spacing: .05em; }
.inline-form label { display: block; font-weight: 700; margin-bottom: 4px; }
.safety, .source { margin: 0 0 32px; }
.button[disabled] { opacity: .5; cursor: not-allowed; }
h3 { font-size: 18px; margin: 20px 0 6px; }

.nap { font-style: normal; margin: 0 0 12px; }

/* manage */
.details { margin: 0; display: grid; gap: 10px; }
.details div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
@media (max-width: 480px) { .details div { grid-template-columns: 1fr; gap: 0; } }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 700; }
.link-list { padding-left: 20px; }
.link-list li { margin-bottom: 10px; }
.link-list .hint { display: block; }
.site-nav ul { flex-wrap: wrap; }
.button.small { padding: 6px 12px; min-height: 0; font-size: 15px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions form { margin: 0; }
.ban-form { display: grid; gap: 0 16px; }
@media (min-width: 700px) { .ban-form { grid-template-columns: 1fr 1fr; } .ban-form button { justify-self: start; } }
.admin-table td, .admin-table th[scope="row"] { word-break: break-word; }

/* messages */
.thread { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 10px; }
.thread li { max-width: 85%; border-radius: 12px; padding: 8px 12px; }
.thread li p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread .who { font-size: 14px; color: var(--muted); }
.thread .mine { justify-self: end; background: var(--success-bg); }
.thread .theirs { justify-self: start; background: var(--bg); }
.message-form label, .report label { display: block; font-weight: 700; margin: 8px 0 4px; }
.message-form button, .report button { margin-top: 8px; }
.report { margin-top: 16px; }
.report summary { cursor: pointer; color: var(--info-fg); text-decoration: underline; }
.flag { color: var(--error); }

/* Call sheet */
.sheet { width: 100%; border-collapse: collapse; margin: 0 0 1rem; }
.sheet th, .sheet td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.sheet th { font-weight: 400; color: var(--muted); width: 45%; }
.tick-list { list-style: none; padding: 0; }
.tick-list li { padding-left: 1.8rem; position: relative; margin: .4rem 0; }
.tick-list li::before { content: ""; position: absolute; left: 0; top: .2rem; width: 1rem; height: 1rem; border: 2px solid currentColor; border-radius: 3px; }
.write-in { display: flex; gap: .5rem; align-items: flex-end; }
.write-in span { flex: 1; border-bottom: 1px solid currentColor; min-height: 1.6rem; }

@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: 0; box-shadow: none; padding: 0; background: #fff; }
  .call-sheet .phone-box { border: 2px solid #000; background: #fff; color: #000; }
  .call-sheet .phone-box * { color: #000; }
  a { color: #000; }
}

/* Instructors page poster */
.poster { text-align: center; }
.poster .tick-list { display: inline-block; text-align: left; font-size: 1.1rem; }
.poster-kicker { font-weight: 700; color: var(--muted); margin: 0; }
.poster-title { font-size: 1.8rem; margin: .3rem 0 1rem; }
.poster-url { font-size: 1.4rem; font-weight: 700; margin: 1rem 0 .5rem; }
#share-message { width: 100%; }
@media print {
  .poster { font-size: 1.3rem; padding-top: 3rem; }
  .poster-title { font-size: 2.6rem; }
  .poster-url { font-size: 2rem; }
}
.poster .tick-list li::before { content: "✓"; border: 0; top: 0; width: auto; height: auto; font-weight: 700; }

/* Step 2: earlier, later or either */
.direction-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.direction-option { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--border); border-radius: 10px;
  padding: 12px 14px; cursor: pointer; font-weight: 400; margin: 0; background: var(--surface); }
.direction-option input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.direction-option strong { display: block; }
.direction-option .hint { display: block; margin: 0; }
.direction-option:has(input:checked) { border-color: var(--brand); }
.direction-option:has(input:disabled) { opacity: .6; cursor: not-allowed; }
.direction-option:has(input:focus-visible) { outline: 3px solid var(--text); outline-offset: 2px; }

/* Reassurance */
.reassure { color: var(--muted); font-size: .95rem; margin: .75rem 0; padding-left: 1.6rem; position: relative; }
.reassure::before { content: "🔒"; position: absolute; left: 0; }
.concerns { width: 100%; border-collapse: collapse; }
.concerns th, .concerns td { text-align: left; vertical-align: top; padding: .75rem .5rem; border-bottom: 1px solid var(--border); }
.concerns th { width: 34%; }
@media (max-width: 600px) {
  .concerns th, .concerns td { display: block; width: auto; padding: .25rem 0; border: 0; }
  .concerns tr { display: block; padding: .6rem 0; border-bottom: 1px solid var(--border); }
}
.about { display: flex; gap: 1rem; align-items: flex-start; }
.about-photo { border-radius: 50%; object-fit: cover; flex: none; }
.timeline { list-style: none; padding: 0; counter-reset: none; }
.timeline li { border-left: 3px solid var(--brand); padding: 0 0 .5rem 1rem; margin: 0 0 1rem; }
.timeline h2 { margin-top: 0; }
