/*
 * secure-booking-v2.css: presentation for the /secure-booking-v2 checkout
 * variant (app/templates/secure_booking_v2.html). Layered AFTER
 * secure-booking.css and secure-booking-payment.css, and scoped under
 * body.sbv2 so it can never touch the live page.
 *
 * Only layout and the variant's own blocks live here. The controller-owned
 * rules (.sb-hidden, .sb-error-msg, the custody and staff gates, .sb-paying at
 * 919px) are deliberately not overridden. See wiki/secure-booking-v2.md.
 */

/* ---- Page scaffold: header above the two columns ----------------------- */

/* The base .sb-page is a centering flex row; the header has to sit above the
   shell, so stack them. */
.sbv2 .sb-page {
  flex-direction: column;
  align-items: center;
  padding-top: 16px;
}

.sbv2-header {
  width: 100%;
  max-width: 1120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--nc-line);
}

.sbv2-logo {
  display: block;
  height: 26px;
  width: auto;
}

.sbv2-header-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: var(--fs-15, 15px);
  color: var(--nc-slate);
  text-decoration: none;
  white-space: nowrap;
}

.sbv2-header-phone i {
  color: var(--nc-terracotta);
}

.sbv2-header-phone:hover span,
.sbv2-header-phone:focus-visible span {
  text-decoration: underline;
}

/* On a phone the number alone is the useful part. */
@media (max-width: 600px) {
  .sbv2-header-phone-lead {
    display: none;
  }
}

/* ---- Grid: sticky summary on the left, form column on the right ------- */

.sbv2 .sb-shell {
  gap: 28px;
}

@media (min-width: 920px) {
  .sbv2 .sb-page {
    padding-top: 24px;
  }
  .sbv2-header {
    margin-bottom: 48px;
  }
  .sbv2 .sb-shell {
    grid-template-columns: minmax(0, 1fr) 471px;
    column-gap: 72px;
  }
}

/* The form column is long; keep the price and what it buys in view beside it
   (research: price visible at all times). Only where the summary fits the
   viewport, so a short laptop screen never clips it. */
@media (min-width: 920px) and (min-height: 860px) {
  .sbv2 .sbv2-summary {
    position: sticky;
    top: 24px;
    align-self: start;
  }
}

/* ---- Summary ------------------------------------------------------------ */

/* The base badge is 50% slate under parchment text (about 2.6:1); solid slate
   reads as a label instead of a disabled chip and passes contrast. */
.sbv2 .sb-badge {
  background: var(--nc-slate);
}

.sbv2-title {
  font-family: var(--nc-font-serif);
  font-weight: 600;
  color: var(--nc-slate);
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.15;
  margin: 16px 0 0;
}

.sbv2-product {
  margin: 10px 0 0;
  max-width: 480px;
  font-size: var(--fs-17, 17px);
  line-height: 1.5;
  color: var(--nc-ink);
}

.sbv2-price {
  margin: 20px 0 0;
}

.sbv2-price-label {
  margin: 0;
  font-size: var(--fs-13, 13px);
  font-weight: 700;
  /* Sentence case like every label ("Flat fee", Codex run 3). */
  color: var(--nc-ink);
}

/* The base .sb-total carries a 30px top margin meant for the old layout. 26 px is the top of
   the type scale (it was 28 px, off the scale). */
.sbv2 .sbv2-price .sb-total {
  margin: 2px 0 0;
  font-size: var(--fs-26, 26px);
}

/* Under the two plan rows the total keeps the plans' own 14 px gap (secure-booking-plans.css);
   the 2 px rule above outranked it, so "$290.00" sat 2 px under the Evaluation row (layout QA
   round 2). */
.sbv2 .sbv2-price .sb-plans + .sb-total {
  margin-top: 14px;
}

.sbv2 .sbv2-price .sb-total-note {
  margin-top: 4px;
  font-size: var(--fs-15, 15px);
}

.sbv2-facts {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.sbv2-facts li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: var(--fs-16, 16px);
  line-height: 1.45;
  color: var(--nc-ink);
}

.sbv2-facts i {
  flex: 0 0 18px;
  margin-top: 3px;
  text-align: center;
  color: var(--nc-terracotta);
}

/* The timing line is a facts-list item here; the list's own spacing and type
   apply, and the base .sb-timing rules (secure-booking.css) supply the (i)
   toggle. The list's generic icon rule must not reach the toggle's glyph. */
.sbv2 .sbv2-facts .sb-timing {
  margin: 0;
  max-width: none;
  font-size: var(--fs-16, 16px);
}

.sbv2 .sbv2-facts .sb-timing-info i {
  flex: none;
  margin: 0;
  color: inherit;
}

.sbv2-includes {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--nc-line);
}

/* Phones: a compact summary keeps the first field on the first screen; the
   included list (seen on the landing page) is desktop-only. */
@media (max-width: 919px) {
  .sbv2-title {
    margin-top: 12px;
  }
  .sbv2-price {
    margin-top: 14px;
  }
  .sbv2-facts {
    margin-top: 14px;
  }
  .sbv2-includes {
    display: none;
  }
}

/* ---- Below the form: one privacy line (stays beside Pay) --------------- */

.sbv2-assure {
  margin: 12px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--fs-14, 14px);
  line-height: 1.45;
  color: var(--nc-ink);
}

.sbv2-assure i {
  color: var(--nc-slate);
  font-size: var(--fs-15, 15px);
  margin-top: 2px;
  flex: 0 0 16px;
  text-align: center;
}

/* Under the privacy line's text, past its icon (16px icon + 10px gap). */
.sbv2-legal-name {
  margin: 8px 0 0 26px;
  font-size: var(--fs-13, 13px);
  color: var(--nc-ink);
}

/* ---- Payment step: a framed card area reads as more secure (Baymard) ---- */

/* Not while loading: the shimmer belongs to .sb-pe-loading. Not on small
   phones: the padding would squeeze Stripe's payment-method tabs. */
.sbv2 .sb-pay #sb-stripe-element:not(.sb-pe-loading) {
  padding: 16px;
  border: 1px solid var(--nc-line-strong);
  border-radius: var(--nc-radius-card);
  background: var(--nc-vellum);
}

@media (max-width: 600px) {
  .sbv2 .sb-pay #sb-stripe-element:not(.sb-pe-loading) {
    padding: 0;
    border: 0;
    background: none;
  }
}

/* ---- Details deferred to the app (#351) --------------------------------- */

/* Sex at birth and the home address are asked in the app after the account is
   set up; the State select stays, relabelled for the live session, with State
   of Residence added above it by deferred-details.js. The fields
   stay in the DOM because the shared controller addresses them by id, and the
   rule must beat the controller's own show/hide of the sex field. */
.sbv2[data-defer-details] #sb-sex-field,
.sbv2[data-defer-details] .sb-field:has(#sb-dep-gender),
.sbv2[data-defer-details] .sb-field:has(> #sb-street),
.sbv2[data-defer-details] .sb-row--three > div:has(#sb-city),
.sbv2[data-defer-details] .sb-row--three > div:has(#sb-zip) {
  display: none !important;
}
.sbv2[data-defer-details] .sb-row--three {
  grid-template-columns: 1fr;
}

/* ---- "where we serve" map (#351) ----------------------------------------- */

/* The side padding matches the State dropdown's (16px), so the message's text
   starts in line with the state named above it. */
.sbv2 .sb-blocked {
  padding: 14px 16px;
}
/* v2's message is a single paragraph, so its bottom margin would leave more
   space under the text than above it. */
.sbv2 .sb-blocked p:last-child {
  margin-bottom: 0;
}

/* Colours match the website's own map (UsServiceMap.tsx). */
.sbv2-map-modal .sb-modal-card {
  width: min(820px, 100%);
}
.sbv2-map-modal .sb-modal-body {
  padding-top: 16px;
}
.sbv2-map svg {
  display: block;
  width: 100%;
  height: auto;
}
.sbv2-map path {
  fill: #fef9f0;
  stroke: #3a3c41;
  stroke-width: 1;
  stroke-linejoin: round;
}
.sbv2-map path.is-served {
  fill: var(--nc-terracotta);
}
/* As on the website: a state lights up under the pointer or keyboard focus. */
.sbv2-map path {
  cursor: pointer;
  outline: none;
  transition: opacity 0.15s;
}
.sbv2-map path:hover,
.sbv2-map path:focus-visible {
  opacity: 0.75;
}

/* The state card opens over the map, so it stacks above it. */
.sbv2-state-modal {
  z-index: 1001;
}
.sbv2-state-modal .sb-modal-card {
  width: min(420px, 100%);
}
.sbv2-state-body {
  padding: 28px 28px 26px;
}
.sbv2-state-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: var(--fs-13, 13px);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nc-ink);
}
.sbv2-state-name {
  margin: 10px 0 0;
  font-family: var(--nc-font-serif);
  font-size: 28px;
  line-height: 1.15;
  color: var(--nc-slate);
}
.sbv2-state-text {
  margin: 12px 0 0;
  font-size: var(--fs-15, 15px);
  line-height: 1.55;
  color: var(--nc-ink);
}
.sbv2-state-text a {
  color: var(--nc-terracotta);
  font-weight: 600;
  text-decoration: none;
}
.sbv2-state-action {
  margin-top: 22px;
}
.sbv2-map-legend {
  display: flex;
  gap: 18px;
  margin: 14px 0 0;
  font-size: var(--fs-14, 14px);
  color: var(--nc-ink);
}
.sbv2-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sbv2-map-key {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #3a3c41;
  background: #fef9f0;
}
.sbv2-map-key--served {
  background: var(--nc-terracotta);
}
