/* ==========================================================================
   STERLING FACIAL PLASTIC SURGERY - BEVERLY HILLS
   Typeset like a printed letterhead: one serif (Newsreader) for display,
   one sans (Public Sans) for everything else, hairline rules, flat paper.
   Ink #1B1D1F, muted #5B5F66, rules #D6D3CD, page #F3F2EF.
   One accent, oxblood #6B2A2A: links, the focus ring and one short rule.
   ========================================================================== */

:root {
  --ink: #1b1d1f;
  --ink-hover: #33363a;
  --muted: #575b61;
  --rule: #d6d3cd;
  /* input/toggle borders: 3:1 against the field fill (WCAG 1.4.11) */
  --field: #928e87;
  --field-hover: #5f5b55;
  --field-fill: #fbfaf8;
  --track: #e4e1db;
  --page: #f2f0eb;
  --paper: #ffffff;
  --accent: #6b2a2a;
  --error: #a4231c;

  --font-serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --font-sans: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --gutter: 40px;

  /* Room the website chat launcher (fixed bottom-right, 56px tall) needs */
  --chat-launcher-clearance: 200px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

p, li {
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden,
.step-title {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.app-viewport {
  width: 100%;
  max-width: calc(1200px + 2 * var(--gutter));
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   1. HEADER: typographic wordmark + the office number
   ========================================================================== */
.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}

.brand-identity {
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.brand-wordmark {
  display: flex;
  align-items: center;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand-tagline {
  display: flex;
  align-items: center;
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink);
  white-space: nowrap;
}

/* the signature: a 1px oxblood rule, 18px tall, between name and tagline */
.brand-tagline::before {
  content: "";
  display: block;
  width: 1px;
  height: 18px;
  margin: 0 14px 0 16px;
  background: var(--accent);
}

.clinic-phone {
  flex-shrink: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.clinic-phone-label {
  font-size: 12px;
  color: var(--muted);
}

.clinic-phone-number {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.clinic-phone:hover .clinic-phone-number {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

/* ==========================================================================
   2. MAIN STAGE: twelve columns; type on 1-6, the form on 8-12
   ========================================================================== */
.main-stage {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr;
  column-gap: 24px;
  align-items: start;
  padding: 40px 0 64px;
}

.hero-narrative {
  grid-column: 1 / 7;
  grid-row: 1;
}

.hero-extra {
  grid-column: 1 / 7;
  grid-row: 2;
  margin-top: 24px;
}

.intake-card-container {
  grid-column: 8 / 13;
  grid-row: 1 / 3;
  min-width: 0;
}

.hero-heading {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 3.6vw, 3.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
  /* two lines: "Begin your consultation / with Dr. Julian Sterling." */
  max-width: 10.6em;
  text-wrap: balance;
  /* cap height level with the top edge of the card */
  margin-top: -0.04em;
}

.hero-name {
  color: var(--accent);
}

.hero-description {
  margin-top: 24px;
  max-width: 30em;
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

/* --- What happens next: definition-style rows --- */
.next-steps {
  margin-top: 40px;
}

.next-steps-heading,
.credentials-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
}

.next-steps-heading {
  margin-bottom: 8px;
}

.next-steps-list {
  list-style: none;
  max-width: 36rem;
}

.next-steps-list li {
  padding: 11px 0 12px;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.next-steps-list li:first-child {
  border-top: 1px solid var(--rule);
}

.next-steps-list strong {
  font-weight: 600;
  color: var(--ink);
}

.next-steps-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

/* --- Credentials: an editorial sign-off --- */
.hero-credentials {
  margin-top: 0;
}

/* /book/: the credentials follow the headline directly */
.book-page .hero-credentials {
  margin-top: 40px;
}

.hero-credentials::before {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 16px;
}

.credentials-name {
  margin-bottom: 6px;
}

.credentials-list {
  list-style: none;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

/* ==========================================================================
   3. INTAKE CARD: flat white sheet, one hairline
   ========================================================================== */
.intake-card {
  background: var(--paper);
  border: 0;
  border-top: 3px solid var(--ink);
  border-radius: 0;
  padding: 36px 40px 40px;
}

.wizard-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.step-indicator {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.step-pill {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}

.progress-track {
  flex: 1;
  height: 2px;
  background: var(--track);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 25%;
  background: var(--accent);
  transition: width 200ms ease-out;
}

.flow-step {
  display: none;
}

.flow-step.active {
  display: block;
}

.step-heading {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 24px;
}

.step-intro {
  margin: -16px 0 24px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

/* Fields */
.form-row-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.field-group {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.freeform-input,
.freeform-textarea {
  display: block;
  width: 100%;
  background: var(--field-fill);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.4;
  border: 1px solid var(--field);
  border-radius: 0;
  transition: border-color 120ms linear;
}

.form-input,
.form-select {
  height: 52px;
  padding: 0 14px;
}

.freeform-input {
  height: 44px;
  padding: 0 14px;
}

.freeform-textarea {
  min-height: 104px;
  max-height: 200px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.form-input:hover,
.form-select:hover,
.freeform-input:hover,
.freeform-textarea:hover {
  border-color: var(--field-hover);
}

.form-input:focus,
.form-select:focus,
.freeform-input:focus,
.freeform-textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--ink);
}

.form-input::placeholder,
.freeform-input::placeholder,
.freeform-textarea::placeholder {
  color: #6f737a;
  opacity: 1;
}

.form-input.is-invalid,
.freeform-input.is-invalid,
.freeform-textarea.is-invalid {
  border-color: var(--error);
  box-shadow: inset 0 0 0 1px var(--error);
}

.field-error-message {
  display: none;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--error);
}

.field-error-message.visible {
  display: block;
}

/* Select */
.select-wrapper {
  position: relative;
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
}

.select-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
  display: flex;
}

/* Calls & texts consent */
.consent-block {
  margin: 8px 0 0;
}

.consent-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  cursor: pointer;
}

.consent-option input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--ink);
  cursor: pointer;
}

.consent-option a,
.consent-more {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.consent-more {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.consent-details {
  margin: 12px 0 0 30px;
  padding-left: 12px;
  border-left: 1px solid var(--rule);
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

/* Timeline options */
.timeline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.timeline-card {
  min-height: 52px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--field-fill);
  border: 1px solid var(--field);
  border-radius: 0;
  cursor: pointer;
  user-select: none;
  transition: border-color 120ms linear;
}

.timeline-card:hover {
  border-color: var(--ink);
}

.timeline-card.selected {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.timeline-label {
  font-size: 15px;
  color: var(--ink);
}

.timeline-card.selected .timeline-label {
  font-weight: 600;
}

/* ==========================================================================
   STEP 3: medical questions, ruled like a printed form
   ========================================================================== */
.freeform-qual-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}

.qual-question {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
  padding: 16px 0;
  min-width: 0;
}

.qual-question:first-child {
  border-top: 0;
  padding-top: 0;
}

.qual-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.qual-label {
  display: block;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ink);
}

.freeform-field-group {
  width: 100%;
  border-top: 1px solid var(--rule);
  padding-top: 16px;
}

.freeform-field-group > .qual-label {
  margin-bottom: 8px;
}

.yesno-toggle {
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid var(--field);
  border-radius: 0;
}

.yesno-option {
  position: relative;
  cursor: pointer;
}

.yesno-option + .yesno-option {
  border-left: 1px solid var(--field);
}

.yesno-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.yesno-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--ink);
  background: var(--field-fill);
  user-select: none;
}

.yesno-option:hover span {
  background: var(--page);
}

.yesno-option input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  position: relative;
}

.yesno-option input:checked + span {
  background: var(--ink);
  color: #ffffff;
  font-weight: 600;
}

.qual-question.is-invalid .yesno-toggle {
  border-color: var(--error);
}

.qual-detail {
  display: none;
  margin-top: 12px;
}

.qual-question:has(input[value="yes"]:checked) .qual-detail {
  display: block;
}

/* Recap of step 2, a running head on steps 3-4 */
.selection-recap {
  padding-bottom: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}

.selection-recap[hidden] {
  display: none;
}

/* "You're asking about Blepharoplasty · ASAP", one running line */
.recap-details {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.recap-value {
  font-weight: 600;
  color: var(--ink);
}

.recap-badge {
  white-space: nowrap;
  color: var(--muted);
}

.recap-badge::before {
  content: "\00b7\00a0";
}

/* ==========================================================================
   ACTIONS
   ========================================================================== */
.flow-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 120ms linear, border-color 120ms linear;
}

.btn-primary {
  flex: 1;
  background: var(--ink);
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid var(--ink);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-primary[hidden],
.btn-secondary[hidden] {
  display: none;
}

.btn-primary:disabled {
  background: #6f7277;
  border-color: #6f7277;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  font-weight: 400;
  border: 1px solid var(--field);
}

.btn-secondary:hover {
  border-color: var(--ink);
}

/* Back: a plain underlined word (still a <button>, same ids) */
.btn-secondary.btn-back {
  flex: none;
  border-color: transparent;
  padding: 0 12px;
  margin-left: -12px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

.btn-secondary.btn-back:hover {
  border-color: transparent;
  color: var(--accent);
}

.btn-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-primary.loading .btn-spinner { display: inline-block; }
.btn-primary.loading .btn-text { display: none; }

.form-footer-guarantee {
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.form-footer-guarantee a {
  color: var(--accent);
}

/* ==========================================================================
   CONFIRMATION
   ========================================================================== */
.success-stage {
  display: none;
}

.success-stage.active {
  display: block;
}

.success-head {
  margin-bottom: 24px;
}

.success-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 8px;
}

.success-subtitle {
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.success-next {
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
}

.success-next-note {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

.success-next-note a {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Non-JS fallback receipt (success.html) */
.success-card-receipt {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
  margin: 24px 0;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
  padding: 4px 0;
}

.receipt-label { color: var(--muted); }
.receipt-val { color: var(--ink); font-weight: 600; }
.receipt-code { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }

/* ==========================================================================
   FOOTER: two quiet lines on a hairline
   ========================================================================== */
.trust-dock {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 48px;
  border-top: 1px solid var(--ink);
  padding: 20px 0 28px;
  color: var(--muted);
}

.dock-brand {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 4px;
}

.dock-practice {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}

.dock-locations {
  font-size: 12.5px;
  line-height: 1.7;
  text-align: right;
  max-width: 40rem;
}

/* keep each fact together: a line never starts with a lone "· Terms" */
.nb {
  white-space: nowrap;
}

.trust-dock a {
  color: var(--muted);
  text-decoration-color: #a8a49d;
}

.trust-dock a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* Desktop: the "Chat with Ava" launcher sits bottom-right; the right column
   stops short of it only where the page margin is too narrow to hold it */
@media (min-width: 961px) {
  .has-chat .trust-dock {
    padding-right: clamp(0px, calc(216px - (100vw - 1200px) / 2), 176px);
  }
}

/* Spam honeypot field: kept off-screen rather than display:none, which some bots skip */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ==========================================================================
   BOOKING CALENDAR (/book/)
   ========================================================================== */
.booking [hidden] {
  display: none !important;
}

.booking-status {
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.booking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px;
}

.booking-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.booking-month-label {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  color: var(--ink);
}

.booking-nav {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 1px solid var(--field);
  border-radius: 0;
  color: var(--ink);
  cursor: pointer;
}

.booking-nav:hover:not(:disabled) {
  border-color: var(--ink);
}

.booking-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.booking-weekdays,
.booking-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.booking-weekdays span {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}

.booking-date {
  position: relative;
  aspect-ratio: 1;
  max-height: 2.5rem;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: #8e9196;
  display: flex;
  align-items: center;
  justify-content: center;
}

.booking-date.is-available {
  color: var(--ink);
  font-weight: 600;
  border-color: var(--field);
  background: var(--paper);
  cursor: pointer;
}

.booking-date.is-available:hover {
  border-color: var(--ink);
}

.booking-date[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.booking-date.is-today::after {
  content: "";
  position: absolute;
  bottom: 5px;
  width: 10px;
  height: 1px;
  background: currentColor;
}

.booking-date:focus-visible,
.booking-slot:focus-visible,
.booking-nav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.booking-times {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.booking-times-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 6px 0 12px;
}

.booking-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  max-height: 15rem;
  overflow-y: auto;
  padding: 2px 4px 2px 2px;
  scrollbar-width: thin;
}

.booking-slot {
  min-height: 40px;
  background: var(--field-fill);
  border: 1px solid var(--field);
  border-radius: 0;
  padding: 0 6px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
  cursor: pointer;
}

.booking-slot:hover {
  border-color: var(--ink);
}

.booking-slot[aria-checked="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
  font-weight: 600;
}

.booking-tz {
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 4px;
}

#btn-book {
  width: 100%;
  margin-top: 12px;
}

.booking-confirmed {
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.booking-confirmed-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.booking-confirmed-time {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  margin: 4px 0 8px;
}

.booking-fallback-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 15px;
}

.booking-details .form-row-2col {
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .booking-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .booking-slots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 10rem;
  }
}

/* ==========================================================================
   LEGAL PAGES (Privacy Policy, Terms & Conditions)
   ========================================================================== */
.legal-page {
  width: 100%;
  max-width: calc(720px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.legal-card {
  padding: 56px 0 64px;
  line-height: 1.65;
}

.legal-card h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.125rem, 4vw, 2.75rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}

.legal-card h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  margin: 40px 0 8px;
}

.legal-card p,
.legal-card li {
  font-size: 16px;
  color: var(--ink);
}

.legal-card p { margin-bottom: 12px; }

.legal-card ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.legal-card li { margin-bottom: 6px; }

.legal-card li::marker { color: var(--muted); }

.legal-updated {
  color: var(--muted) !important;
  font-size: 14px !important;
  margin-bottom: 32px !important;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Narrower desktops: the form takes half the width */
@media (max-width: 1199px) and (min-width: 961px) {
  .main-stage { column-gap: 40px; }
  .intake-card-container { grid-column: 7 / 13; }
  .intake-card { padding: 32px 32px 36px; }
}

/* Footer stacks once the two columns get cramped */
@media (max-width: 960px) {
  .trust-dock {
    display: block;
    padding: 20px 0 24px;
  }

  .dock-locations {
    text-align: left;
    max-width: none;
    margin-top: 12px;
  }
}

/* Stacked: headline, subhead, form, then credentials and what happens next */
@media (max-width: 960px) {
  .main-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    padding: 40px 0 0;
    /* room for the chat launcher before the footer, so the footer ends the page */
    margin-bottom: 96px;
  }

  .hero-narrative,
  .hero-extra,
  .intake-card-container {
    grid-column: 1;
    grid-row: auto;
  }

  .hero-narrative { order: 1; }
  .hero-heading { margin-top: 0; }

  /* the form keeps a comfortable measure instead of stretching across a tablet */
  .intake-card-container { order: 2; margin-top: 40px; max-width: 560px; }

  .hero-extra { order: 3; margin-top: 56px; }

  /* Past step 1 the hero has been read, so the card gets the screen.
     intake.js sets data-step. */
  body[data-step]:not([data-step="1"]) .hero-narrative,
  body[data-step]:not([data-step="1"]) .hero-extra {
    display: none;
  }

  body[data-step]:not([data-step="1"]) .intake-card-container {
    margin-top: 0;
  }

  /* Book page: calendar first, and the page starts once (no second headline) */
  .book-page .intake-card-container { order: 0; margin-top: 0; }
  .book-page .hero-narrative { margin-top: 56px; }
  .book-page .hero-heading { display: none; }
}

/* Tablet: credentials and what happens next side by side under the form */
@media (min-width: 720px) and (max-width: 960px) {
  .hero-extra {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
  }

  /* level with the credentials name, which sits under its 2px rule */
  .next-steps { margin-top: 0; padding-top: 18px; }
}

@media (max-width: 600px) {
  :root { --gutter: 20px; }

  .brand-header {
    padding: 16px 0 14px;
    gap: 16px;
  }

  /* Stacked wordmark on phones; the vertical rule only works side by side */
  .brand-wordmark {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .brand-name { font-size: 24px; }

  .brand-tagline::before { display: none; }

  .clinic-phone {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
  }

  .main-stage { padding-top: 32px; }

  .hero-heading {
    font-size: clamp(2rem, 7vw + 0.375rem, 2.5rem);
    line-height: 1.08;
  }

  .hero-description {
    margin-top: 16px;
    font-size: 17px;
  }

  .intake-card-container { margin-top: 32px; max-width: none; }

  /* Full-bleed sheet; the bottom padding keeps the consent line clear of the chat launcher */
  .intake-card {
    margin: 0 calc(-1 * var(--gutter));
    padding: 24px var(--gutter) 32px;
  }

  .step-heading { font-size: 26px; }

  /* 16px fields stop iOS zooming into the form on focus */
  .form-input,
  .form-select,
  .freeform-input,
  .freeform-textarea { font-size: 16px; }

  .legal-card { padding: 40px 0 48px; }

  /* the launcher sits in the bottom-right corner: footer text stays left of it */
  .has-chat .trust-dock { padding-right: 64px; }
}

@media (max-width: 480px) {
  .qual-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .flow-actions .btn-primary {
    min-width: 0;
    padding: 0 16px;
  }
}

@media (max-width: 359px) {
  .form-row-2col { grid-template-columns: minmax(0, 1fr); }
}
