/* ============================================================
   WhiteCoat Booking Demo — styles.css
   Mobile-first. Two chrome variants (intro / form) + modals.
   Driven by window.BOOKING_CONFIG.branding.primaryColor via JS
   which sets `--c-primary` on :root at boot.
   ============================================================ */

/* ---- Tokens ---- */
:root {
  --c-primary: #00ADEE;
  --c-primary-hover: #0099D6;
  --c-primary-soft: #E6F7FD;

  --c-bg: #FFFFFF;
  --c-text: #1A1F2C;
  --c-text-muted: #667085;
  --c-text-soft: #98A2B3;

  --c-border: #D0D5DD;
  --c-border-soft: #E4E7EC;
  --c-band: #F2F4F7;
  --c-locked: #F2F2F2;
  --c-chip-bg: #F5F5F5;

  --c-danger: #D92D20;
  --c-danger-soft: #FEE4E2;
  --c-warning: #F79009;
  --c-warning-soft: #FEF0C7;

  --r-input: 8px;
  --r-card: 12px;
  --r-pill: 9999px;

  --shadow-card: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.1);
  --shadow-modal: 0 20px 24px -4px rgba(16,24,40,.08), 0 8px 8px -4px rgba(16,24,40,.03);

  --font-display: 'Space Grotesk', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  --z-content: 1;
  --z-fixed: 50;
  --z-modal-backdrop: 100;
  --z-modal: 110;
  --z-toast: 200;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ---- Persistent chrome: DEMO badge + WhiteCoat lockup + partner corner logo ---- */
/* Demo badge — kept in DOM for ?demo=1 wiring but hidden in every screen per spec. */
.demo-badge { display: none !important; }
.demo-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: var(--z-fixed);
  background: var(--c-warning);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-card);
}
@media (min-width: 640px) {
  .demo-badge {
    font-size: 12px;
    padding: 8px 14px;
  }
}
/* Form variant: nudge DEMO badge right of the partner-corner logo (logo max-width 110px mobile / 160px desktop + spacing). */
body[data-chrome="form"] .demo-badge { left: 132px; }
@media (min-width: 640px) { body[data-chrome="form"] .demo-badge { left: 208px; } }

.wc-lockup {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: var(--z-fixed);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--c-text);
  padding: 4px 8px;
  border-radius: 6px;
}
.wc-lockup__caption {
  font-size: 10px;
  color: var(--c-text-muted);
  font-style: italic;
}
.wc-lockup__logo { height: 26px; width: auto; }
@media (min-width: 640px) {
  .wc-lockup { top: 24px; right: 32px; gap: 10px; }
  .wc-lockup__caption { font-size: 12px; }
  .wc-lockup__logo { height: 34px; }
}
@media (max-width: 359px) {
  .wc-lockup__caption { display: none; }
}

.partner-logo-corner {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: calc(var(--z-fixed) - 1);
  display: none;
}
body[data-chrome="form"] .partner-logo-corner { display: block; }
.partner-logo-corner img {
  height: 44px;
  width: auto;
  max-width: 121px;
  object-fit: contain;
  object-position: left center;
}
@media (min-width: 640px) {
  .partner-logo-corner { top: 24px; left: 32px; }
  .partner-logo-corner img { height: 62px; max-width: 176px; }
}

/* ---- Screens ---- */
.screen {
  min-height: 100dvh;
  padding: 80px 16px 40px;
  display: flex;
  justify-content: center;
}
.screen[hidden] { display: none; }
@media (min-width: 640px) {
  .screen { padding: 120px 24px 60px; }
}

/* ============================================================
   INTRO VARIANT (Steps 1.1, 1.2)
   - Logo centered, large
   - Heading cyan
   - Narrow column
   - Pill inputs
   ============================================================ */
.screen--intro .intro-content {
  width: 100%;
  max-width: 720px;
  text-align: center;
}
.partner-logo-hero {
  height: 80px;
  width: auto;
  margin: 0 auto 24px;
  object-fit: contain;
}
@media (min-width: 640px) {
  .partner-logo-hero { height: 110px; margin-bottom: 32px; }
}
.intro-heading {
  font-family: var(--font-display);
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--c-primary);
}
.intro-heading__sub {
  font-size: 18px;
  font-weight: 600;
}
.intro-heading__main {
  font-size: clamp(13px, 4.4vw, 24px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap;
}
@media (min-width: 640px) {
  .intro-heading { gap: 6px; margin-bottom: 32px; }
  .intro-heading__sub { font-size: 22px; }
  .intro-heading__main { font-size: clamp(24px, 4.5vw, 32px); }
}
@media (min-width: 1024px) {
  .intro-heading__main { font-size: 36px; }
}
.intro-caption {
  font-size: 16px;
  color: var(--c-text-muted);
  margin: 0 0 24px;
}
.intro-form { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.intro-form .field {
  width: 70%;
  display: flex;
  flex-direction: column;
}
.intro-form .field .error-msg {
  text-align: center;
  /* Reserve space so consent + CTA don't shift when the email error appears */
  min-height: 18px;
  margin-top: 4px;
}
.intro-form .consent { padding: 0 8px; }
.intro-form .consent .consent-label { text-align: left; }
.intro-form #entry-cta { width: 50%; }
.intro-form .consent-error {
  width: 100%;
  text-align: center;
  /* Sits below the CTA — reserve space so other elements don't shift */
  min-height: 18px;
}
@media (max-width: 480px) {
  /* On narrow phones, give the input + button a bit more breathing room */
  .intro-form .field { width: 90%; }
  .intro-form #entry-cta { width: 80%; }
}

/* Consent (centered variant): cluster + error stack, both horizontally centered */
.consent.consent--centered {
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.consent.consent--centered .consent__row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  max-width: 320px;
}
@media (min-width: 480px) {
  .consent.consent--centered .consent__row { max-width: 520px; }
}
.consent.consent--centered .consent-error {
  text-align: center;
  margin-top: 2px;
}

/* Custom consent checkbox: hidden native input + visible box with rounded white tick */
.checkbox-native {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.checkbox-box {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 2px solid var(--c-border);
  border-radius: 4px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: 1px;
  transition: background .15s, border-color .15s;
}
.checkbox-box svg { opacity: 0; transition: opacity .15s; }
.checkbox-native:checked + .checkbox-box {
  background: var(--c-primary);
  border-color: var(--c-primary);
}
.checkbox-native:checked + .checkbox-box svg { opacity: 1; }
.checkbox-native:focus-visible + .checkbox-box {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* Pill input (intro variant) */
.input--pill {
  width: 100%;
  height: 56px;
  padding: 0 24px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  background: #fff;
  font-size: 16px;
  font-family: inherit;
  color: var(--c-text);
  text-align: center;
  transition: border-color .15s, box-shadow .15s;
}
.input--pill::placeholder { color: var(--c-text-soft); font-style: italic; }
.input--pill:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.input--pill[aria-invalid="true"] {
  border-color: var(--c-danger);
}
@media (min-width: 640px) {
  .input--pill { height: 64px; font-size: 17px; }
}

/* ============================================================
   FORM VARIANT (Step 3)
   - Logo top-left small (via .partner-logo-corner)
   - Dark page title
   - Banded gray section headers
   - Wider column
   - Rounded-rectangle inputs
   ============================================================ */
.screen--form .form-content {
  width: 100%;
  max-width: 1120px;
}
.form-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--c-text);
  text-align: center;
  margin: 0 0 24px;
}
@media (min-width: 640px) { .form-title { font-size: 32px; margin-bottom: 32px; } }

/* Tabs (Self / Dependant) */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-pill);
  padding: 4px;
  margin-bottom: 24px;
  overflow: hidden;
}
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--c-text-muted);
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--r-pill);
  transition: background .15s, color .15s;
}
@media (min-width: 640px) {
  .tab { height: 52px; font-size: 16px; }
}
.tab--active {
  background: var(--c-primary);
  color: #fff;
  font-weight: 600;
}

/* Section bands */
.section-band {
  background: var(--c-band);
  border-radius: var(--r-input);
  padding: 12px 16px;
  margin: 24px 0 16px;
}
.section-band__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
}
@media (min-width: 640px) {
  .section-band { padding: 14px 20px; margin-top: 32px; margin-bottom: 20px; }
  .section-band__title { font-size: 16px; }
}

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) {
  .form-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .form-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text);
}
.input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-input);
  background: #fff;
  font-size: 16px;
  font-family: inherit;
  color: var(--c-text);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--c-text-soft); }
.input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.input:disabled,
.input[readonly] {
  background: var(--c-locked);
  color: var(--c-text-muted);
  cursor: not-allowed;
}
.input--with-icon {
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;
  padding-right: 42px;
}
.input--date {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2'><rect x='3' y='5' width='18' height='16' rx='2'/><path d='M3 10h18M8 3v4M16 3v4'/></svg>");
}
/* For <input type="date">: drop our custom icon (browser provides its own calendar indicator). */
input[type="date"].input--date { background-image: none; padding-right: 14px; }
input[type="date"].input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: .65;
  filter: grayscale(1);
}
.input--select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;
  padding-right: 42px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
}
.input--select::-ms-expand { display: none; }

/* Segmented control (Giới tính) */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--c-border);
  border-radius: var(--r-input);
  overflow: hidden;
  height: 48px;
}
.segmented__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--c-text-muted);
  font-weight: 500;
  font-size: 15px;
  border: 0;
  height: 100%;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.segmented__option--active {
  background: var(--c-primary);
  color: #fff;
  font-weight: 600;
}

/* Package block */
.package-block { display: flex; flex-direction: column; gap: 12px; }
.package-caption {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text);
  margin: 0;
}
.dropdown { position: relative; }
.dropdown__trigger {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 14px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-input);
  font-size: 16px;
  color: var(--c-text);
  cursor: pointer;
  position: relative;
}
/* Inline chevron SVG — rotates 180° when the trigger is aria-expanded.
   Replaces the legacy background-image chevron so we can animate it. */
.dropdown__trigger > .dropdown__chevron-svg {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-muted);
  pointer-events: none;
  transition: transform .18s cubic-bezier(.2,.8,.2,1);
}
.dropdown__trigger[aria-expanded="true"] > .dropdown__chevron-svg {
  transform: translateY(-50%) rotate(180deg);
  color: var(--c-primary);
}
/* Cal-trigger calendar icon — used by Ngày khám (booking date). Same size
   as the DOB icon so the two date fields read as a pair. */
.cal-trigger > .cal-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-muted);
  pointer-events: none;
}
.dropdown__trigger:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.dropdown__trigger:disabled,
.dropdown__trigger[disabled] {
  background: var(--c-locked);
  color: var(--c-text-muted);
  cursor: not-allowed;
  opacity: .7;
}
/* Filterable variant — text input + chevron, shares panel/option styling */
.dropdown--filter { position: relative; }
.dropdown--filter .dropdown__filter-input.input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-input);
  background: #fff;
  font-size: 16px;
  color: var(--c-text);
}
.dropdown--filter .dropdown__filter-input.input::placeholder { color: var(--c-text-soft); }
.dropdown--filter .dropdown__filter-input.input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.dropdown__chevron {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-muted);
  cursor: pointer;
}
.dropdown__chevron:hover { background: var(--c-band); color: var(--c-text); }
.dropdown__chevron > svg { transition: transform .18s cubic-bezier(.2,.8,.2,1); }
.dropdown__chevron[aria-expanded="true"] > svg {
  transform: rotate(180deg);
  color: var(--c-primary);
}
.dropdown__option--empty {
  color: var(--c-text-muted);
  font-style: italic;
  text-align: center;
  cursor: default;
}
.dropdown__option--empty:hover { background: transparent; }
.field--error .dropdown--filter .dropdown__filter-input.input { border-color: var(--c-danger); }
.cal-trigger:disabled,
.cal-trigger[disabled] {
  background: var(--c-locked);
  color: var(--c-text-muted);
  cursor: not-allowed;
  opacity: .7;
}
.cal-trigger:disabled .cal-label,
.cal-trigger[disabled] .cal-label { color: var(--c-text-muted); }
.dropdown__panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-input);
  box-shadow: var(--shadow-modal);
  max-height: 280px;
  overflow-y: auto;
  z-index: 5;
}
.dropdown__panel[hidden] { display: none; }
.dropdown__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border-soft);
  cursor: pointer;
  font-size: 15px;
}
.dropdown__option:last-child { border-bottom: 0; }
.dropdown__option:hover { background: var(--c-band); }
.dropdown__option--selected { background: var(--c-primary-soft); }
.dropdown__option--selected::after {
  content: "✓";
  color: var(--c-primary);
  font-weight: 700;
}

/* Calendar picker (data-cal-picker) — styled trigger + popover.
   Brand-aware version of the survey-builder calendar. */
.cal-picker { position: relative; width: 100%; }

/* Hybrid DOB variant: editable text input + calendar icon button right-aligned. */
.cal-input-wrap { position: relative; width: 100%; }
.cal-input-wrap .input.cal-input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-input);
  background: #fff;
  font-size: 16px;
  font-family: inherit;
  color: var(--c-text);
}
.cal-input-wrap .input.cal-input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.cal-trigger.cal-trigger--icon {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--c-text-muted);
  transition: background .15s, color .15s;
}
.cal-trigger.cal-trigger--icon:hover { background: var(--c-band); color: var(--c-text); }
.cal-trigger.cal-trigger--icon[aria-expanded="true"] { color: var(--c-primary); background: var(--c-primary-soft); }
.field--error .cal-input-wrap .input.cal-input { border-color: var(--c-danger); }
.cal-trigger {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 14px; /* leave room for the absolute icon on the right */
  border: 1px solid var(--c-border);
  border-radius: var(--r-input);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 16px;
  font-family: inherit;
  color: var(--c-text);
  position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.cal-trigger:hover { border-color: var(--c-text-muted); }
.cal-trigger[aria-expanded="true"],
.cal-trigger:focus-visible {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.cal-label.cal-placeholder { color: var(--c-text-soft); }
.cal-chevron { color: var(--c-text-muted); flex: 0 0 18px; transition: transform .15s; }
.cal-trigger[aria-expanded="true"] .cal-chevron { transform: rotate(180deg); }

.cal-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 320px;
  max-width: 100vw;
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-modal);
  padding: 12px;
  z-index: 20;
  display: none;
}
.cal-popover.open { display: block; }
.cal-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-nav {
  width: 28px; height: 28px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text);
}
.cal-nav:hover { background: var(--c-band); }
.cal-selects { display: flex; gap: 6px; flex: 1; justify-content: center; }
.cal-month-select, .cal-year-select {
  padding: 4px 6px;
  border: 1px solid var(--c-border-soft);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  font-family: inherit;
  cursor: pointer;
}
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.cal-weekday { text-align: center; font-size: 12px; color: var(--c-text-muted); padding: 4px 0; font-weight: 500; }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day {
  border: 0;
  background: transparent;
  width: 100%;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  color: var(--c-text);
  font-family: inherit;
}
.cal-day:hover { background: var(--c-band); }
.cal-day.outside { color: var(--c-text-soft); opacity: 0.5; }
.cal-day.today:not(.selected) { background: #E5E7EB; }
.cal-day.selected { background: var(--c-primary); color: #fff; font-weight: 600; }
.cal-day.selected:hover { background: var(--c-primary-hover); }

/* Examinations grid */
.exam-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 8px;
}
@media (min-width: 640px) { .exam-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .exam-grid { grid-template-columns: repeat(4, 1fr); } }
.exam-chip {
  background: var(--c-chip-bg);
  border-radius: var(--r-input);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--c-text);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  min-height: calc(1.4em * 2 + 24px); /* 2 lines + vertical padding so chips align */
  cursor: default;
}
.exam-chip > span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* Empty banner (no eligible packages) */
.empty-banner {
  background: var(--c-warning-soft);
  border: 1px solid var(--c-warning);
  color: var(--c-text);
  padding: 12px 16px;
  border-radius: var(--r-input);
  font-size: 14px;
  margin-top: 8px;
}

/* Dependant stack */
.dep-stack {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--c-border-soft);
  margin-bottom: 24px;
}
.dep-stack:last-child { border-bottom: 0; margin-bottom: 0; }
.dep-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px auto 0;
  background: var(--c-danger-soft);
  color: var(--c-danger);
  border: 0;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
}
.dep-remove__icon {
  flex: 0 0 18px;
  color: var(--c-danger);
}
.dep-actions { display: flex; justify-content: center; margin: 24px 0; }

/* Add-dependant button — cyan-soft accent, primary text */
.btn--soft-cyan,
.btn--soft-cyan:not(:disabled):hover {
  background: var(--c-primary-soft);
  color: var(--c-primary);
  border-color: var(--c-primary-soft);
}
.btn--soft-cyan:not(:disabled):hover { background: #D5F0FB; }

/* Form footer */
.form-footer {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.booking-error {
  text-align: center;
  font-size: 13px;
  color: var(--c-danger);
}
.booking-error:empty { display: none; }

/* Per-field error state (Step 3) — red border on the input + inline message */
.field--error .input,
.field--error .dropdown__trigger,
.field--error .cal-trigger,
.field--error .segmented {
  border-color: var(--c-danger);
}
.field--error .input:focus,
.field--error .dropdown__trigger:focus,
.field--error .cal-trigger:focus,
.field--error .cal-trigger[aria-expanded="true"] {
  box-shadow: 0 0 0 3px rgba(217, 45, 32, .15);
}
.field-error {
  color: var(--c-danger);
  font-size: 13px;
  margin-top: 4px;
}

/* Consent row */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: var(--c-text);
}
.consent-label { line-height: 1.5; }
.checkbox {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--c-primary);
  flex: 0 0 18px;
}

/* Error messages */
.error-msg {
  color: var(--c-danger);
  font-size: 13px;
  min-height: 1px;
}
.error-msg:empty { display: none; }
/* Step 1 reserves vertical space for both the email error and the consent error
   so the CTA + consent cluster don't shift when an error toggles on/off. */
.intro-form .field .error-msg:empty,
.intro-form .consent-error:empty { display: block; }

/* Link — policy hyperlinks (privacy / TOS) are bold for emphasis */
.link {
  color: var(--c-primary);
  text-decoration: underline;
  font-weight: 700;
}
.link:hover { color: var(--c-primary-hover); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn[hidden] { display: none !important; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--r-input);
  font-weight: 600;
  font-size: 15px;
  font-family: inherit;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--pill { border-radius: var(--r-pill); }
.btn--block { width: 100%; }
.btn--primary {
  background: var(--c-primary);
  color: #fff;
}
.btn--primary:not(:disabled):hover { background: var(--c-primary-hover); }
.btn--primary:disabled {
  background: #E0E0E0;
  color: #98A2B3;
  opacity: 1;
}
/* Soft state — visually muted but still clickable so submit-time validation can fire. */
.btn.btn--soft,
.btn.btn--soft:hover {
  background: #E0E0E0;
  color: #98A2B3;
}
.btn--ghost {
  background: var(--c-band);
  color: var(--c-text);
  border-color: var(--c-band);
}
.btn--ghost:not(:disabled):hover {
  background: var(--c-border-soft);
}
.btn--danger {
  background: var(--c-danger);
  color: #fff;
}
.btn--danger:not(:disabled):hover { background: #B42318; }
.btn--cta {
  width: 100%;
  height: 56px;
  font-size: 16px;
}
@media (min-width: 640px) {
  .btn--cta { width: auto; min-width: 320px; max-width: 480px; }
  .intro-form .btn--block { width: 100%; }
}
.btn--cta-pair {
  width: 100%;
}
@media (min-width: 640px) {
  .btn--cta-pair { width: auto; min-width: 240px; }
}

/* ============================================================
   STEP 4 — Confirmation (success state)
   ============================================================ */
.screen--confirm .confirm-content {
  width: 100%;
  max-width: 800px;
  text-align: center;
}
.success-icon {
  display: inline-flex;
  margin: 0 auto 16px;
  color: var(--c-primary);
  filter: drop-shadow(0 0 18px rgba(0, 173, 238, .25));
}
.success-icon svg { width: 80px; height: 80px; }
@media (min-width: 640px) {
  .success-icon svg { width: 96px; height: 96px; }
}
.confirm-heading {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--c-primary);
  margin: 0 0 8px;
}
@media (min-width: 640px) { .confirm-heading { font-size: 36px; } }
.confirm-id {
  font-size: 14px;
  color: var(--c-text-muted);
  margin: 0 0 24px;
}
.confirm-id strong { color: var(--c-text); font-weight: 600; }

.confirm-card {
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-card);
  text-align: left;
  margin-bottom: 24px;
  overflow: hidden;
}
.confirm-card .section-band { margin: 0; border-radius: 0; }
.confirm-card .section-band:first-child { border-radius: 0; }
.confirm-grid {
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .confirm-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .confirm-grid--2 { grid-template-columns: repeat(2, 1fr); }
}
.confirm-cell .confirm-cell__label {
  font-size: 13px;
  color: var(--c-text-muted);
  display: block;
  margin-bottom: 4px;
}
.confirm-cell .confirm-cell__value {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text);
  word-break: break-word;
}

.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
@media (min-width: 640px) {
  .confirm-actions { flex-direction: row; justify-content: center; }
}
.confirm-actions .btn { width: 100%; }
@media (min-width: 640px) {
  .confirm-actions .btn { width: auto; min-width: 240px; }
}
.confirm-pdf {
  display: inline-block;
  font-size: 14px;
  color: var(--c-text);
  text-decoration: underline;
}

/* Print mode (Step 4) */
@media print {
  .demo-badge { display: block !important; }
  .wc-lockup,
  .partner-logo-corner,
  .confirm-actions,
  .confirm-pdf { display: none !important; }
  body { background: white; }
  .screen { padding: 20px !important; }
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: var(--z-modal-backdrop);
  animation: fadeIn .15s ease-out;
}
.modal-backdrop[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 440px;
  padding: 24px;
  position: relative;
  z-index: var(--z-modal);
  animation: slideUp .2s ease-out;
}
@keyframes slideUp { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal--otp { max-width: 440px; }
.modal--otp .modal__head {
  position: relative;
  justify-content: center;
}
.modal--otp .modal__title { text-align: center; }
.modal--otp .modal__close {
  position: absolute;
  top: 0;
  right: 0;
}
/* Verify CTA — narrow on desktop (~70% of modal) per spec; full-width on mobile */
@media (min-width: 640px) {
  .modal--otp #otp-verify-btn { width: 70%; margin: 0 auto; display: block; }
}

/* Status modal (success / error) */
.modal--status {
  max-width: 440px;
  text-align: center;
  padding: 36px 32px 32px;
  position: relative;
}
.modal--status .modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
}
.modal--status .status-icon {
  display: inline-flex;
  margin: 0 auto 20px;
}
.modal--status .status-icon svg { width: 80px; height: 80px; }
.modal--status .modal__title {
  font-size: 22px;
  margin: 0 0 24px;
  text-align: center;
}
.modal--status-success .modal__title { color: #16A34A; }
.modal--status-error   .modal__title { color: #DC2626; }
.modal--status .btn {
  min-width: 200px;
  margin: 0 auto;
}
.modal--doc {
  max-width: 720px;
  max-height: 80vh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal--confirm { max-width: 420px; text-align: center; }

/* Doc modal head: cyan banner with centered white title */
.modal--doc .modal__head {
  background: var(--c-primary);
  color: #fff;
  padding: 18px 24px;
  margin: 0;
  justify-content: center;
  align-items: center;
}
.modal--doc .modal__title {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}
.modal--doc .modal__close { display: none; }
.modal--doc .modal__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--c-text);
}
.modal--doc .modal__body h2 { font-size: 18px; margin: 0 0 12px; }
.modal--doc .modal__body p { margin: 0 0 12px; }
.modal--doc .modal__footer {
  padding: 16px 24px 20px;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--c-border-soft);
}
.modal--doc .btn--close-doc {
  min-width: 160px;
  height: 48px;
  background: #fff;
  border: 1px solid var(--c-border);
  color: var(--c-text);
  border-radius: var(--r-pill);
  font-weight: 500;
  font-size: 15px;
}
.modal--doc .btn--close-doc:hover { background: var(--c-band); }

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.modal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
}
.modal--confirm .modal__title { margin-bottom: 8px; }
.modal__close {
  background: none;
  border: 0;
  width: 32px;
  height: 32px;
  font-size: 24px;
  line-height: 1;
  color: var(--c-text-muted);
  border-radius: 50%;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal__close:hover { background: var(--c-band); }
.modal__caption {
  font-size: 14px;
  color: var(--c-text-muted);
  text-align: center;
  margin: 0 0 16px;
}
.modal__body {
  font-size: 15px;
  color: var(--c-text);
}
.modal--doc .modal__body { line-height: 1.6; }
.modal__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}
.modal__actions .btn { flex: 1; max-width: 160px; }

/* OTP boxes */
.otp-demo-hint {
  text-align: center;
  font-size: 12px;
  color: var(--c-warning);
  margin: 0 0 12px;
}
.otp-boxes {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px; /* exactly 16px above the inline message */
}
@media (min-width: 480px) { .otp-boxes { gap: 16px; } }
.otp-box {
  width: 52px;
  height: 56px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-input);
  background: #fff;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  color: var(--c-text);
  font-family: inherit;
}
.otp-box:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.otp-box--error { border-color: var(--c-danger); }
.otp-box:disabled { background: var(--c-locked); }

.otp-error {
  text-align: center;
  font-size: 13px;
  color: var(--c-danger);
  /* Reserve constant vertical space so toggling the error/success message
     doesn't shift the verify button. 16 (above) + 18 (msg) + 16 (below) = 50px
     total between OTP boxes and submit button. */
  min-height: 18px;
  margin: 0 0 16px;
}
/* Success variant — used for "OTP đã được gửi lại" after a successful resend.
   Same slot as the error message so the layout stays anchored. */
.otp-error[data-kind="success"] { color: #16A34A; }
.otp-error[hidden] { display: block; visibility: hidden; }
.otp-cooldown {
  text-align: center;
  font-size: 13px;
  color: var(--c-text-muted);
  margin: 16px 0 4px;
}
.otp-cooldown strong { color: var(--c-text); font-weight: 600; }
.otp-resend {
  display: block;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-primary);
  text-decoration: none;
}
.otp-resend--disabled {
  color: var(--c-text-soft);
  pointer-events: none;
  cursor: default;
}

/* Toasts consolidated in css/satellite-common.css (.sat-toast) — v3.1.0
   booking.js delegates to Satellite.showToast(msg, {kind}). */

/* ============================================================
   Responsive overrides for very narrow phones
   ============================================================ */
@media (max-width: 360px) {
  .partner-logo-hero { height: 64px; }
  .otp-box { width: 44px; height: 52px; font-size: 20px; }
}
