/* Stage 6A PROTOTYPE: customer booking page. Mobile first; brand colours from 00-facts/brand/brand-guidelines.md only.
   Fonts are not named in the brand facts (OQ-54), so the system font stack is used. */
:root {
  --navy: #05445E;        /* Navy: text, primary buttons */
  --grotto: #189AB4;      /* Blue Grotto: accents, borders, focus */
  --blue-green: #75E6DA;  /* Blue Green: available dates */
  --baby-blue: #D4F1F4;   /* Baby Blue: soft backgrounds */
  --yellow: #F5C300;      /* Yellow (radiator): highlights */
  --ink: #05445E;
  --muted: #3f5f6b;
  --line: #b9d9df;
  --bg: #ffffff;
  --soft: #f3fafb;
  --error: #b00020;
  --ok: #05445E;
  --radius: 12px;
  --gap: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 17px; }
img { max-width: 100%; height: auto; }
a { color: var(--navy); text-underline-offset: 2px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
h1:focus, h2:focus, main:focus, [tabindex="-1"]:focus { outline: none; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.lead { margin: 0 0 20px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--grotto); outline-offset: 2px; }

.proto-banner { background: var(--yellow); color: var(--navy); text-align: center; font-size: .9rem; padding: 6px 16px; }
.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.brand img { display: block; width: 140px; }
.call { font-weight: 600; text-decoration: none; white-space: nowrap; font-size: .95rem; }
.call-label { display: none; font-weight: 400; color: var(--muted); }

/* progress */
.progress { list-style: none; display: flex; gap: 4px; padding: 0; margin: 16px 0; counter-reset: s; }
.progress li { flex: 1; font-size: .75rem; color: var(--muted); border-top: 4px solid var(--line); padding-top: 6px; counter-increment: s; }
.progress li::before { content: counter(s) ". "; }
.progress li span { display: none; }
.progress li[aria-current="step"] { color: var(--navy); font-weight: 700; border-top-color: var(--navy); }
.progress li.done { border-top-color: var(--grotto); }
@media (max-width: 520px) {
  .progress li { font-size: 0; }
  .progress li::before { font-size: .8rem; content: counter(s); }
  .progress li[aria-current="step"] { font-size: .8rem; flex: 3; }
  .progress li[aria-current="step"]::before { content: counter(s) ". "; }
}

.layout { display: grid; gap: 24px; padding-bottom: 32px; }
.step { min-width: 0; }

/* service tier cards: stacked on mobile, side by side on wide screens; everything visible, no tooltips */
.cards { display: grid; gap: 12px; }
.card { position: relative; display: flex; flex-direction: column; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card.featured { border-color: var(--grotto); }
.card:has(.choose[aria-pressed="true"]) { border-color: var(--navy); background: var(--soft); box-shadow: inset 0 0 0 1px var(--navy); }
.card-name { font-weight: 700; font-size: 1.15rem; margin: 0; }
.price { font-weight: 800; font-size: 1.6rem; margin: 4px 0; }
.card p { margin: 0 0 8px; }
.card ul { margin: 0 0 12px; padding-left: 20px; }
.card li { margin-bottom: 4px; }
.card .choose { margin-top: auto; width: 100%; }
.badge { display: inline-block; background: var(--baby-blue); color: var(--navy); border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 600; }
.badge.popular { align-self: flex-start; background: var(--yellow); margin-bottom: 8px; }
.warning { background: #fff8d6; border-left: 4px solid var(--yellow); padding: 8px 10px; border-radius: 6px; font-size: .92rem; font-weight: 600; }

/* boiler questions */
.choices { margin-bottom: 18px; }
.choice { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 10px; padding: 0 12px; margin-bottom: 8px; min-height: 48px; }
.choice:has(input:checked) { border-color: var(--navy); background: var(--soft); }
.choice input { width: 22px; height: 22px; min-height: 22px; margin: 0; flex: none; accent-color: var(--navy); }
.choice label { margin: 0; flex: 1; padding: 12px 0; cursor: pointer; }
fieldset[aria-invalid="true"] .choice { border-color: var(--error); }
#boilerModel { max-width: 40ch; }

/* forms */
fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
legend { font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; padding: 0; }
.field { margin-bottom: 14px; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
.opt { font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: #fff; border: 2px solid #6f8f99; border-radius: 8px; padding: 10px 12px; min-height: 48px; }
textarea { min-height: 88px; resize: vertical; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); }
#pc { max-width: 14ch; text-transform: uppercase; }
.hint { margin: 4px 0 0; font-size: .88rem; color: var(--muted); }
.error { margin: 4px 0 0; font-size: .92rem; color: var(--error); font-weight: 600; }
.row2 { display: grid; gap: 0 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 24px; height: 24px; min-height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--navy); }
.check label { font-weight: 600; margin: 0; }

.actions { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 20px; }
.btn { font: inherit; font-weight: 700; border-radius: 10px; padding: 12px 20px; min-height: 48px; cursor: pointer; border: 2px solid transparent; text-align: center; text-decoration: none; display: inline-block; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: #04364a; }
.btn.secondary { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--navy); text-decoration: underline; font-weight: 600; }
.btn[disabled], .btn[aria-disabled="true"] { background: #c9d6da; color: #4c626a; border-color: transparent; cursor: not-allowed; }
.btn.busy::after { content: ""; display: inline-block; width: 1em; height: 1em; margin-left: 8px; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }

.loading { color: var(--muted); }
.loading::before { content: ""; display: inline-block; width: 1em; height: 1em; margin-right: 8px; vertical-align: -2px; border: 2px solid var(--grotto); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.flash { background: #fff4f4; border-left: 5px solid var(--error); padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.flash.info { background: var(--baby-blue); border-left-color: var(--grotto); }
.notice { margin-top: 20px; background: var(--soft); border-left: 5px solid var(--grotto); padding: 16px; border-radius: 8px; }
.error-summary { border: 3px solid var(--error); border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary a { color: var(--error); font-weight: 600; }

/* calendar */
.calendar { display: grid; gap: 18px; }
.month h2 { font-size: 1rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { text-align: center; font-size: .75rem; color: var(--muted); font-weight: 600; padding-bottom: 2px; }
.day { min-height: 46px; border-radius: 8px; border: 2px solid transparent; font: inherit; font-size: .95rem; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.day.blank { visibility: hidden; }
.day.open { background: var(--blue-green); color: var(--navy); font-weight: 700; cursor: pointer; }
.day.open:hover { border-color: var(--navy); }
.day.none { background: #f1f4f5; color: #6b7f86; text-decoration: line-through; cursor: not-allowed; }
.day[aria-pressed="true"] { background: var(--navy); color: #fff; }
.legend { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.key { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.key-open { background: var(--blue-green); }
.key-none { background: #f1f4f5; border: 1px solid #c9d6da; margin-left: 10px; }
.windows { margin-top: 20px; }
.window-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.slot label { margin: 0; border: 2px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; cursor: pointer; font-weight: 700; min-height: 48px; }
.slot label small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.slot input:checked + label { border-color: var(--navy); background: var(--navy); color: #fff; }
.slot input:checked + label small { color: #e6f6f8; }
.slot input:focus-visible + label { outline: 3px solid var(--grotto); outline-offset: 2px; }

/* review + summary */
.review { margin: 0 0 16px; }
.review div, .summary dl div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.review dt, .summary dt { color: var(--muted); flex: none; }
.review dd, .summary dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.review dd .btn.link { font-size: .85rem; margin-left: 8px; }
.pay-box { background: var(--soft); border-radius: var(--radius); padding: 16px; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.15rem; margin: 0 0 4px; }
.total strong { font-size: 1.6rem; }
.terms { margin: 16px 0; }
.terms .check { margin-top: 12px; }
.terms .check:first-child { margin-top: 0; }
.terms .hint { margin-left: 34px; }
.terms .error { margin-left: 34px; }
.email-preview { white-space: pre-wrap; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: .85rem; max-width: 100%; overflow-x: auto; }
.policy { padding: 24px 16px 40px; }
.policy-text { max-width: 720px; }
.policy-text h2 { margin-top: 24px; }
.policy-text p { margin: 0 0 12px; }
.summary { background: var(--soft); border-radius: var(--radius); padding: 16px; align-self: start; }
.summary h2 { font-size: 1rem; }
.summary dl { margin: 0; font-size: .95rem; }
.hold { margin: 12px 0 0; background: #fff; border-left: 5px solid var(--yellow); padding: 8px 12px; border-radius: 6px; font-size: .92rem; }

/* return */
.return { padding: 24px 0 40px; }
.status-card { max-width: 620px; margin: 0 auto; border: 2px solid var(--line); border-radius: var(--radius); padding: 24px 20px; }
.status-icon { width: 56px; height: 56px; border-radius: 50%; margin-bottom: 12px; display: grid; place-items: center; font-size: 30px; font-weight: 800; color: #fff; background: var(--grotto); }
.status-card[data-outcome="checking"] .status-icon, .status-card[data-outcome="processing"] .status-icon { background: none; border: 5px solid var(--baby-blue); border-top-color: var(--grotto); animation: spin 1s linear infinite; }
.status-card[data-outcome="confirmed"] { border-color: var(--navy); }
.status-card[data-outcome="confirmed"] .status-icon { background: var(--navy); }
.status-card[data-outcome="confirmed"] .status-icon::after { content: "✓"; }
.status-card[data-outcome="awaiting_payment"] .status-icon, .status-card[data-outcome="payment_not_completed"] .status-icon { background: var(--yellow); color: var(--navy); }
.status-card[data-outcome="awaiting_payment"] .status-icon::after, .status-card[data-outcome="payment_not_completed"] .status-icon::after { content: "!"; }
.status-card[data-outcome="expired"] .status-icon, .status-card[data-outcome="not_booked"] .status-icon, .status-card[data-outcome="unknown"] .status-icon { background: #6b7f86; }
.status-card[data-outcome="expired"] .status-icon::after, .status-card[data-outcome="not_booked"] .status-icon::after, .status-card[data-outcome="unknown"] .status-icon::after { content: "i"; }

.proto-tools { margin: 8px 0 32px; border: 2px dashed #a88600; border-radius: 10px; padding: 12px 16px; background: #fffbea; }
.proto-tools summary { cursor: pointer; font-weight: 700; }
.proto-tools select { max-width: 420px; }

.site-footer { background: var(--navy); color: #fff; padding: 20px 0; font-size: .9rem; }
.site-footer a { color: #fff; }
.site-footer p { margin: 4px 0; }

@media (min-width: 600px) {
  .call-label { display: inline; }
  .brand img { width: 180px; }
  .row2 { grid-template-columns: 1fr 1fr; }
  .actions { flex-direction: row; justify-content: space-between; }
  h1 { font-size: 1.9rem; }
  .status-card { padding: 32px; }
}
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .summary { position: sticky; top: 16px; }
  .calendar { grid-template-columns: 1fr 1fr; }
  .layout.wide { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
