/*
 * secure-booking-checkout.css: the phone-first checkout layout
 * (app/templates/secure_booking_checkout.html), in Evergreen, the website
 * redesign's look (forest button, lichen page, Newsreader headings, Geist text,
 * apricot focus ring). Page scaffold, header, heading and the form's fields.
 * The order bar and sheet are in secure-booking-checkout-order.css, the payment
 * step in secure-booking-checkout-pay.css.
 *
 * Layered after the live page's stylesheets and scoped under body.sbc, so it
 * never touches the classic page. Most of the live page's look comes from
 * tokens (--nc-* in secure-booking.css, --ps-* / --ui-* in the frozen
 * components), so they are re-pointed at Evergreen first and only the shapes
 * that differ are restyled. The controller-owned rules (.sb-hidden, the custody
 * gate, .sb-error-msg.visible) are left alone. See wiki/secure-booking-checkout.md.
 */

/* Geist, the website's text face, self-hosted (app/static/fonts/geist, OFL). */
@font-face {
  font-family: 'Geist';
  src: url('/static/fonts/geist/geist-latin-400-normal.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('/static/fonts/geist/geist-latin-500-normal.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('/static/fonts/geist/geist-latin-600-normal.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---- Evergreen tokens over the live page's ------------------------------ */

body.sbc {
  --sbc-ink: #15251E;
  --sbc-muted: #4B5A50;
  --sbc-page: #F6F7F2;
  --sbc-card: #FFFFFF;
  --sbc-line: #D5DBCD;
  --sbc-panel: #EAEEE4;
  --sbc-forest: #1E3D32;
  --sbc-link: #A64D24;
  --sbc-apricot: #E07B4B;
  --sbc-display: 'Newsreader', Georgia, serif;
  --sbc-text: 'Geist', system-ui, -apple-system, sans-serif;

  /* secure-booking.css */
  --nc-bg: var(--sbc-page);
  --nc-slate: var(--sbc-ink);
  --nc-ink: var(--sbc-ink);
  --nc-terracotta: var(--sbc-forest);
  --nc-terracotta-hover: var(--sbc-link);
  --nc-line: var(--sbc-line);
  --nc-line-strong: var(--sbc-muted);
  --nc-font-serif: var(--sbc-display);
  --nc-font-sans: var(--sbc-text);
  /* The frozen components (patient-tokens.css, ui-components.css) */
  --ps-text: var(--sbc-ink);
  --ps-text-soft: var(--sbc-muted);
  --ps-surface: var(--sbc-card);
  --ps-accent: var(--sbc-forest);
  --ps-accent-text: var(--sbc-forest);
  --ps-red: var(--sbc-link);
  --ui-field-line: var(--sbc-line);
  --ui-line: var(--sbc-line);
  --ui-placeholder: #6B786F;
  --font-ui: var(--sbc-text);
  /* 52px fields and 16px type: 16px or iOS Safari zooms in on focus. */
  --ui-input-h: 52px;
  --ui-input-fs: 16px;
  --ui-input-radius: 8px;
  --ui-btn-main-h: 52px;
  --ui-label-fs: 14.5px;

  background: var(--sbc-page);
  color: var(--sbc-ink);
  font-family: var(--sbc-text);
  font-size: 16px;
}

/* ---- Page scaffold --------------------------------------------------------- */

/* A 16px gutter on phones, so fields get the width. */
body.sbc .sb-page {
  padding: 0 16px 64px;
}

body.sbc .sb-shell {
  gap: 0;
  max-width: 1040px;
}

/* From 920px: the form on the left, the order card on the right (owner,
   2026-11-17). The order is first in the page for phones, so it is placed. */
@media (min-width: 920px) {
  body.sbc .sb-page {
    padding: 0 40px 120px;
  }
  body.sbc .sb-shell {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 56px;
  }
  body.sbc .sb-shell > .sb-product {
    grid-column: 2;
    grid-row: 1;
  }
  body.sbc .sb-shell > section:not(.sb-product) {
    grid-column: 1;
    grid-row: 1;
    max-width: 560px;
  }
}

/* ---- Heading and the plan switch -------------------------------------------- */

.sbc-title {
  margin: 20px 0 18px;
  font-family: var(--sbc-display);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--sbc-ink);
}
.sbc-title [hidden] {
  display: none;
}
@media (min-width: 920px) {
  .sbc-title {
    margin-top: 0;
    font-size: 38px;
  }
}

.sbc-plans {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  min-width: 0;
}
.sbc-plans-legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 14.5px;
  font-weight: 500;
}

/* The two-or-three-way switch: the plan (radios) and who it is for (buttons). */
.sbc-seg {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--sbc-panel);
}
.sbc-seg-opt,
.sbc-seg-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--sbc-ink);
  font: 500 14.5px/1.2 var(--sbc-text);
  text-align: center;
  cursor: pointer;
}
.sbc-seg-opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.sbc-seg-opt:has(input:checked),
.sbc-seg-btn[aria-checked='true'] {
  background: var(--sbc-card);
  box-shadow: 0 1px 2px rgba(21, 37, 30, 0.12), 0 0 0 1px var(--sbc-line);
  font-weight: 600;
}
.sbc-seg-opt:has(input:focus-visible),
.sbc-seg-btn:focus-visible {
  outline: 2px solid var(--sbc-apricot);
  outline-offset: 2px;
}
.sbc-seg-opt:has(input:disabled) {
  cursor: default;
  opacity: 0.6;
}

/* A staff session sees the form disabled behind its notice (the controller's
   .sb-form--staff); the plan switch sits outside the form, so it goes too. */
body.sbc .sb-shell:has(.sb-form--staff) .sbc-plans {
  display: none;
}

/* An original control kept for the controller, behind its stand-in
   (checkout-form.js): out of sight but still in the page and focusable, so the
   controller's focus on an invalid field reaches the stand-in. */
.sbc-proxied {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

/* ---- Fields ---------------------------------------------------------------- */

body.sbc .sb-field {
  margin-bottom: 20px;
}
body.sbc .sb-label {
  margin-bottom: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--sbc-ink);
}
body.sbc .sb-label .sb-req {
  color: var(--sbc-link);
}
body.sbc .sb-section-heading {
  font-family: var(--sbc-display);
  font-weight: 500;
  font-size: 22px;
  margin: 8px 0 16px;
}

body.sbc .ui-input {
  padding: 12px 16px;
  border: 1px solid var(--sbc-line);
  border-radius: 8px;
  background: var(--sbc-card);
  font-family: var(--sbc-text);
  font-size: 16px;
}
body.sbc .ui-input:focus,
body.sbc .ui-input:focus-visible {
  border-color: var(--sbc-forest);
  outline: 2px solid var(--sbc-apricot);
  outline-offset: 2px;
}
body.sbc .ui-input[aria-invalid='true'],
body.sbc .sb-select.sb-error {
  border-color: var(--sbc-link);
}
body.sbc .sb-select-wrap::after {
  border-color: var(--sbc-muted);
}
body.sbc .sb-error-msg,
body.sbc .ui-field-error {
  color: var(--sbc-link);
  font-size: 13px;
}

/* Date of birth: MM | DD | YYYY, all on the number pad. */
body.sbc .sb-dob {
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 8px;
}

/* Sex at birth, the home address and the state of residence are asked after
   the account is set up (#351; owner, 2026-11-17). The fields stay in the DOM
   for the controller; the rule must beat its own show/hide of the sex field.
   The residence field follows the session state (deferred-details.js). */
body.sbc[data-defer-details] #sb-sex-field,
body.sbc[data-defer-details] .sb-field:has(#sb-dep-gender),
body.sbc[data-defer-details] .sb-field:has(> #sb-street),
body.sbc[data-defer-details] .sb-row--three > div:has(#sb-city),
body.sbc[data-defer-details] .sb-row--three > div:has(#sb-zip),
body.sbc[data-defer-details] #sb-residence-field {
  display: none !important;
}
body.sbc[data-defer-details] .sb-row--three {
  grid-template-columns: 1fr;
}

/* ---- Notes, boxes and Continue ---------------------------------------------- */

body.sbc .sb-inline-note,
body.sbc .sb-disclosure,
body.sbc .sb-field-hint {
  color: var(--sbc-muted);
  font-size: 13.5px;
}
body.sbc .sb-check-row p {
  font-size: 14.5px;
  color: var(--sbc-ink);
}

/* The Daily box's small print: smaller and closer than the other notes, so the
   optional texts box doesn't take a quarter of a phone screen (owner,
   2026-11-17). 12.5px stays readable; the words are the consent wording. */
body.sbc .sb-sms-consent .sb-disclosure {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.4;
}
body.sbc .sb-check-row input[type='checkbox'] {
  background: var(--sbc-card);
  border-color: var(--sbc-muted);
}
/* Ticked: the rule above outranks the live page's :checked fill, so it is
   restated here; without it a ticked box stayed white and its white tick
   vanished (found by the owner, 2026-11-17). */
body.sbc .sb-check-row input[type='checkbox']:checked {
  background: var(--sbc-forest);
  border-color: var(--sbc-forest);
}
body.sbc .sb-check-row input[type='checkbox']:focus-visible {
  outline: 2px solid var(--sbc-apricot);
  outline-offset: 2px;
}
body.sbc .sb-legal-link,
body.sbc .sb-blocked a,
body.sbc .sb-consult a {
  color: var(--sbc-link);
}

/* The main button: the website's .eg-btn. */
body.sbc .sb-submit.ui-btn--main {
  min-height: 52px;
  margin-top: 8px;
  padding: 14px 26px;
  border: 0;
  border-radius: 8px;
  background: var(--sbc-forest);
  color: var(--sbc-page);
  font: 600 16px/1.2 var(--sbc-text);
}
body.sbc .sb-submit.ui-btn--main:hover:not(:disabled) {
  background: var(--sbc-forest);
  opacity: 0.9;
}
body.sbc .sb-submit.ui-btn--main:focus-visible {
  outline: 2px solid var(--sbc-apricot);
  outline-offset: 2px;
}

/* The privacy line under the button (v2's words). */
.sbc-assure {
  margin: 14px 0 0;
  color: var(--sbc-muted);
  font-size: 13.5px;
  line-height: 1.45;
  text-align: center;
}
