/* booking-ui — light theme on the live KKIA parking brand palette. The colour/shape
   values below were extracted as design TOKENS from rac.mawqfi.com (values only — no
   CSS, markup, or assets copied: greenfield rule 1). Type is the brand's own licensed Frutiger LT
   Arabic (commercial — Linotype; client-provided), self-hosted; see the @font-face note below.
   RTL is first-class: LOGICAL PROPERTIES ONLY, never a physical left/right
   mirror-flip. Keyboard focus is always visible; motion respects prefers-reduced-motion.
   The Moyasar hosted form (.mysr-form) is left to moyasar.js's own stylesheet. */

/* Client-provided, LICENSED "Frutiger LT Arabic" (commercial — Linotype/Monotype license held by
   the brand; used on the owner's authorization). One file covers both Latin AND Arabic, so EN + AR
   share the brand type. Self-hosted (served same-origin from /app/fonts), no external request.
   NOTE: only the Light (45) weight was supplied, so heavier text is browser-synthesized until the
   Regular/Bold weights are added. */
@font-face {
  font-family: "Frutiger LT Arabic";
  font-style: normal;
  font-weight: 300; /* the supplied master is "45 Light"; 600/700 are faux-bolded */
  font-display: swap;
  src: url("fonts/frutiger-lt-arabic.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #ffffff; /* the RAC checkout sits on pure white; the card is hairline-bordered */
  --surface: #ffffff;
  --surface-2: #f4faf9;
  --ink: #2f3030;
  --muted: #5c6672;
  --faint: #a8a8a8;
  --line: #e6e9ec;
  --line-strong: #ccd1d8;
  --field: #eef0f2;                 /* light-gray fill for text inputs (unchanged on focus) */
  --primary: #04615c;
  --primary-ink: #034945;
  --primary-soft: #e2f4f2;
  --accent: #47c2bb;
  --danger: #ef4129;
  --danger-ink: #c2331f;
  --danger-soft: #fdedea;
  --focus: rgba(4, 97, 92, 0.22);
  --radius: 0;      /* squared UI — no rounded corners anywhere */
  --radius-sm: 0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  /* Brand font is Frutiger LT Arabic (@font-face above); the rest is the system fallback for when it
     can't load, with Arabic system faces so RTL still degrades to a proper Naskh. */
  --font: "Frutiger LT Arabic", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", "Segoe UI Arabic", "Geeza Pro", "Noto Naskh Arabic", "Noto Sans Arabic", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
  font-synthesis: weight; /* only the Light Frutiger weight is supplied — allow faux-bold for headings */
}

/* ---- chrome: white top bar · page container · teal footer (RAC checkout) ---- */
.topbar { background: var(--surface); border-block-end: 1px solid var(--line); }
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: 72rem;
  margin-inline: auto;
  padding-block: 0.8rem;
  padding-inline: max(1rem, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
}
.brand {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--primary);
}
.brand::before { /* brand-neutral mark: a filled dot in the primary colour */
  content: "";
  display: inline-block;
  inline-size: 0.6em;
  block-size: 0.6em;
  margin-inline-end: 0.5em;
  border-radius: 0;
  background: var(--primary);
}
.page {
  flex: 1 0 auto;
  width: 100%;
  box-sizing: border-box;
  max-width: 72rem;
  margin-inline: auto;
  padding-block: clamp(1rem, 3vw, 2rem) clamp(1.5rem, 4vw, 3rem);
  padding-inline: max(1rem, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-block-end: clamp(0.9rem, 2.5vw, 1.4rem);
  font-size: 0.85rem;
  color: var(--muted);
}
.crumbs[hidden] { display: none; }
.crumb-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 1.5rem;
  block-size: 1.5rem;
  border-radius: 0;
  color: #fff;
  background: var(--primary);
  font-size: 0.85rem;
}
.crumb-sep::before { content: "›"; } /* bidi-mirrors to ‹ in RTL automatically (no dir swap) */

.page-title {
  margin-block: 0 clamp(1rem, 3vw, 1.75rem);
  font-size: clamp(1.4rem, 3.5vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.site-footer {
  display: flex;
  align-items: center;
  min-height: 4.5rem;
  background: var(--primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 650;
  padding-block: 1rem;
  padding-inline: max(1.5rem, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  border-block-end: 0.9rem solid #033f3b; /* the darker base strip under the footer band */
}

/* ---- the three regions: stepper | card | summary ---- */
.layout {
  display: flex;
  align-items: flex-start;
  gap: clamp(1rem, 2.5vw, 1.75rem);
}
#lang-toggle {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, background 0.15s;
}
#lang-toggle:hover { border-color: var(--primary); }

/* ---- vertical stepper (decorative; the <h2> is the assistive-tech step label) ---- */
#steps {
  flex: 0 0 15rem;
  display: flex;
  flex-direction: column;
  gap: 0;                       /* even box-to-box spacing comes from each row's fixed height */
  padding-block-start: 0.5rem;
}
#steps[hidden] { display: none; }
/* Fixed row height -> the boxes are evenly spaced no matter how long a step's label is. */
.jstep {
  position: relative;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  min-block-size: 2.8rem;
}
/* Progress connector: a line from each box down to the next, coloured once the step is done — so
   consecutive checked steps are visibly joined. inset-block-end:0 (with #steps gap:0) makes it
   reach the next box whatever the label height. */
.jstep:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-block-start: 2.1rem;   /* the box height: start at the box's bottom edge */
  inset-block-end: 0;          /* reach the next box's top */
  inset-inline-start: 1.05rem; /* the box's centre */
  transform: translateX(-50%);
  inline-size: 2px;
  background: var(--line);
  border-radius: 0;
  transition: background 0.25s;
}
.jstep.done::after { background: var(--accent); }
.jstep-box {
  flex: none;
  position: relative;
  z-index: 1;                  /* sit above the connector line */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 2.1rem;
  block-size: 2.1rem;
  border-radius: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--line);
  transition: background 0.25s, color 0.25s;
}
.jstep.current .jstep-box { color: #fff; background: var(--primary); }
.jstep.done .jstep-box { color: #fff; background: var(--accent); }
.jstep-text { display: flex; flex-direction: column; gap: 0.1rem; }
.jstep-title { font-size: 0.92rem; font-weight: 650; color: var(--muted); }
.jstep.current .jstep-title, .jstep.done .jstep-title { color: var(--ink); }
.jstep-sub { font-size: 0.8rem; color: var(--faint); }

/* ---- the app card ---- */
main#app {
  flex: 1 1 auto;
  min-inline-size: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(1.15rem, 4vw, 1.75rem);
}

/* ---- the Summary panel: dark teal, persistent from the quote step onward ---- */
#summary {
  flex: 0 0 17rem;
  position: sticky;
  top: 1rem;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.25rem 1.1rem;
  font-size: 0.9rem;
}
#summary[hidden] { display: none; }
.sum-title {
  margin: 0 0 0.9rem;
  padding-block-end: 0.6rem;
  border-block-end: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 1.05rem;
  font-weight: 700;
}
.sum-row { display: flex; flex-direction: column; gap: 0.05rem; margin-block-end: 0.7rem; }
.sum-label { font-weight: 700; }
.sum-value { color: #d5ebe8; font-variant-numeric: tabular-nums; }
.sum-sep { border-block-start: 1px dashed rgba(255, 255, 255, 0.35); margin-block: 0.9rem; }
.sum-sep ~ .sum-row { flex-direction: row; justify-content: space-between; margin-block-end: 0.45rem; }
.sum-total {
  margin-block-start: 0.9rem;
  padding-block-start: 0.75rem;
  border-block-start: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 1.05rem;
  font-weight: 700;
}
.sum-total .sum-row { flex-direction: row; justify-content: space-between; margin-block: 0; }
.sum-total .sum-value { color: #fff; }

h2 {
  margin-block: 0 1rem;
  font-size: clamp(1.35rem, 4vw, 1.6rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h3 { margin-block: 0 0.5rem; font-size: 1.1rem; font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; }
p { margin-block: 0.5rem; }

/* ---- forms ---- */
label {
  display: block;
  margin-block-start: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}
/* RAC form language: label above, UNDERLINE-only field (no box). */
input, select, textarea {
  width: 100%;
  margin-block-start: 0.35rem;
  padding: 0.42rem 0.65rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--field);         /* light-gray filled field */
  border: 0;
  border-block-end: 1.5px solid var(--line-strong);
  border-radius: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="checkbox"], input[type="radio"] {
  width: auto;
  background: none;                 /* keep the native control clean, no gray box */
  accent-color: var(--primary);
}
/* One control height everywhere. iOS renders date/time inputs shorter than text
   inputs and centers their value; the min height + the -webkit pseudo bring them
   in line with the text fields (text-align: start also keeps RTL correct). */
input:not([type="checkbox"]):not([type="radio"]), select { min-block-size: 2.35rem; }
/* iOS Safari sizes NATIVE date controls as content-box regardless of author
   box-sizing, so width:100% + our 0.8rem inline padding overflows the card.
   appearance:none releases the native bezel: the field honors border-box like
   every other input, and tapping still opens the system picker. */
input[type="date"], input[type="time"], input[type="datetime-local"] {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
}
input::-webkit-date-and-time-value { text-align: start; line-height: 1.55; margin: 0; }

/* entry/exit side by side where the card is wide enough; stacked on phones */
.field-pair {
  display: grid;
  column-gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: #a8a8a8; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 1px 0 0 var(--primary); /* focus = the doubled underline; background stays gray */
}

/* ---- buttons ---- */
button { font: inherit; cursor: pointer; border-radius: var(--radius-sm); }
button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.primary, button.secondary {
  display: block;
  inline-size: 100%;
  margin-block-start: 1rem;
  padding: 0.8rem 1.25rem;
  font-size: 1rem;
  font-weight: 650;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
/* The RAC CTA is the aqua accent, white label (their shipped pairing). */
button.primary { color: #fff; background: var(--primary); border: 1.5px solid var(--primary); border-bottom: 3px solid var(--primary-ink); }
button.primary:not(:disabled):hover { background: #057a73; border-color: #057a73; border-bottom-color: var(--primary-ink); }
button.primary:not(:disabled):active { transform: translateY(1px); }
button.secondary { color: var(--primary); background: var(--surface); border: 1.5px solid var(--line-strong); border-bottom: 3px solid var(--primary-ink); }
button.secondary:not(:disabled):hover { border-color: var(--primary); background: var(--primary-soft); border-bottom-color: var(--primary-ink); }
button.ghost {
  padding: 0.35rem 0.1rem;
  color: var(--primary);
  font-weight: 650;
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* Unclassed action buttons (e.g. promo "apply") — a compact outline button. */
button:not([class]) {
  display: inline-block;
  margin-block-start: 0.6rem;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-bottom: 3px solid var(--primary-ink);
}
button:not([class]):not(:disabled):hover { border-color: var(--primary); border-bottom-color: var(--primary-ink); }

/* ---- the Previous / Continue row (RAC checkout) ---- */
.actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-block-start: 1.4rem;
}
.actions button.primary, .actions button.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: auto;
  margin-block-start: 0;
  padding: 0.5rem 1.4rem;
}
.actions button.primary { margin-inline-start: auto; }
/* ‹ › are bidi-mirrored — the browser flips them for RTL automatically. No dir override, or the
   explicit swap double-flips and the CTA arrow points the wrong way in Arabic (اعرض السعر). */
.actions .primary::after { content: "›"; margin-inline-start: 0.5rem; font-weight: 700; }
.actions .secondary.prev::before { content: "‹"; margin-inline-end: 0.5rem; font-weight: 700; }
.actions button.secondary.prev {
  color: var(--ink);
  background: #f1f1f2;
  border-color: transparent;
  border-bottom-color: var(--muted);
}
.actions button.secondary.prev:not(:disabled):hover {
  background: var(--line);
  border-color: transparent;
  border-bottom-color: var(--muted);
}

/* ---- price + savings ---- */
.price {
  margin-block: 0.25rem;
  font-size: clamp(2rem, 8vw, 2.6rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.savings {
  display: inline-block;
  margin-block: 0.6rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--primary-ink);
  background: var(--primary-soft);
  border-radius: 0;
}

/* ---- notices, problems, field messages ---- */
.notice { margin-block: 0.5rem; color: var(--muted); font-size: 0.9rem; }
.problem {
  margin-block: 0.85rem;
  padding: 0.75rem 0.85rem;
  font-size: 0.95rem;
  color: var(--danger-ink);
  background: var(--danger-soft);
  border: 1px solid #f9cfc7;
  border-inline-start: 3px solid var(--danger);
  border-radius: var(--radius-sm);
}
.field-error {
  display: block;
  margin-block-start: 0.3rem;
  color: var(--danger-ink); /* the brand red #ef4129 fails AA at this size on white */
  font-size: 0.85rem;
  font-weight: 500;
}
.field-hint {
  display: block;
  margin-block-start: 0.3rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}

/* ---- price breakdown ---- */
.breakdown { width: 100%; margin-block: 1rem; border-collapse: collapse; font-size: 0.95rem; }
.breakdown td { padding-block: 0.55rem; border-block-end: 1px solid var(--line); }
.breakdown td:first-child { color: var(--muted); }
.breakdown td:last-child { text-align: end; font-weight: 600; font-variant-numeric: tabular-nums; }
.breakdown tr:last-child td { border-block-end: 0; }

/* ---- lock countdown ---- */
.countdown {
  margin-block: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ---- consent + wallet boxes (RAC: consent rows sit flat on the card) ---- */
.consent-box, .wallet-box {
  margin-block: 1rem;
  font-size: 0.92rem;
}
.wallet-box {
  padding: 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.consent-box strong, .wallet-box strong { display: block; margin-block-end: 0.4rem; }
.consent-box label, .wallet-box label {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-block-start: 0.5rem;
  font-weight: 400;
}
.consent-box input[type="checkbox"], .consent-box input[type="radio"],
.wallet-box input[type="checkbox"] {
  margin: 0.15rem 0 0;
  flex: none;
  inline-size: 1.1rem;
  block-size: 1.1rem;
}
/* the "how much credit to apply" field: a compact number input pushed to the row end */
.wallet-box .wallet-amount-row { align-items: center; }
.wallet-box input.wallet-amount {
  inline-size: 7rem;
  margin-inline-start: auto;
  padding-block: 0.3rem;
}
/* payment step: the split tender ("SAR X from credit · SAR Y by card") reads as a heading */
.wallet-split-banner { font-weight: 600; margin-block-end: 0.7rem; }

/* email verification: the address + "Verify" share a row; the code entry sits in its own box.
   Override the full-width input/button base rules so they sit side by side and align. */
.email-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-block-start: 0.35rem;
}
.email-row input {
  flex: 1 1 auto;
  inline-size: auto;
  min-inline-size: 0;
  margin-block-start: 0;
}
.email-row button.secondary {
  flex: none;
  inline-size: auto;
  margin-block-start: 0;
  padding-block: 0;
  padding-inline: 1.1rem;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.otp-box {
  margin-block: 0.75rem;
  padding: 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.otp-box input {
  max-inline-size: 11rem;
  letter-spacing: 0.15em;
}

/* ---- confirmation ticket: the gate-credential QR (D62), or its pending note ---- */
.qr {
  margin-block: 1rem;
  padding: 1.5rem 1rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}
.qr .notice { font-family: var(--font); font-weight: 400; letter-spacing: 0; }
/* A live code sits on solid white (scanners need the quiet zone's contrast). */
.qr.qr-live { background: #fff; border-style: solid; }
.qr.qr-live svg {
  display: block;
  margin-inline: auto;
  inline-size: min(13rem, 70vw);
  block-size: auto;
}
.qr.qr-live .notice { display: block; margin-block-start: 0.5rem; }

/* ---- plate-type segmented toggle (RAC: Saudi / Non-Saudi plate) ---- */
.seg-label { display: block; margin-block-start: 1rem; font-size: 0.85rem; font-weight: 600; }
.segmented {
  display: flex;
  margin-block-start: 0.45rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.segmented button {
  flex: 1 1 0;
  padding: 0.6rem 0.5rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.segmented button.on { color: #fff; background: var(--primary); }

/* ---- E.164 mobile row (phone numbers stay LTR; dir set inline) ---- */
.mobile-row { display: flex; gap: 0.5rem; }
.mobile-row select { flex: 0 1 auto; inline-size: auto; max-inline-size: 44%; }
.mobile-row input { flex: 1 1 auto; min-inline-size: 0; }

/* promo entry reads as one row: code field + apply button on a shared baseline */
.promo { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem; margin-block: 1rem; }
.promo label { flex: 1 1 11rem; margin-block-start: 0; }
.promo button:not([class]) { margin-block-start: 0; min-block-size: 2.35rem; }
.promo button.ghost { margin-block-end: 0.5rem; }
.promo .savings { margin-block: 0; }
.promo .field-error { flex-basis: 100%; margin-block-start: 0; }

/* ---- terminal-first comparison cards ---- */
.compare-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-block: 1rem;
}
.compare-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}
.compare-card:hover:not(.unavailable) {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.compare-card h3 { margin: 0; }
.compare-card .price { margin-block: 0.1rem; font-size: 1.6rem; }
.compare-card button.primary { margin-block-start: auto; }
.compare-card.unavailable { opacity: 0.6; box-shadow: none; }
.badge {
  display: inline-block;
  align-self: flex-start;
  padding: 0.25rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 0;
}

/* ---- Moyasar hosted form: spacing only; moyasar.js owns the fields ---- */
.mysr-form { margin-block: 1rem; }

/* Arabic is a cursive, JOINED script: letter-spacing breaks the joins and changes the
   text's width/size, so EN and AR look mismatched. Reset it for RTL so Arabic renders
   idiomatically (the tight Latin tracking stays only where it belongs). */
[dir="rtl"] :is(h1, h2, h3, .price, .qr, .countdown) { letter-spacing: normal; }
/* Arabic script sits smaller/tighter than Latin at the same size — give body copy a little more
   line-height so it stays comfortable to read (headings keep their own tighter line-height). */
[dir="rtl"] body { line-height: 1.7; }

/* ---- narrow screens: stepper compacts to a numbered row, summary drops below ---- */
@media (max-width: 900px) {
  .layout { flex-direction: column; align-items: stretch; }
  #steps { flex: none; flex-direction: row; justify-content: flex-start; gap: 0.6rem; padding-block-start: 0; }
  .jstep { flex: 0 0 auto; min-block-size: 0; } /* horizontal row — drop the vertical min-height */
  .jstep-text { display: none; }
  /* the connector runs HORIZONTALLY between boxes here (box end -> across the gap -> next box) */
  .jstep:not(:last-child)::after {
    inset-block-start: 1.05rem; inset-block-end: auto;
    inset-inline-start: 2.1rem; inline-size: 0.6rem; block-size: 2px; transform: none;
  }
  #summary { flex: none; position: static; }
}

/* ---- small phones: keep the card airy without wasting width ---- */
@media (max-width: 430px) {
  main#app { padding: 1.1rem 0.95rem 1.35rem; }
  .compare-grid { gap: 0.7rem; }
  .qr { padding: 1.2rem 0.75rem; font-size: 1.15rem; letter-spacing: 0.03em; }
  .actions { flex-wrap: wrap; }
  .actions button.primary, .actions button.secondary { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---- range date picker (datepicker.js): calendar range + 24h time -----------
   Replaces the two native datetime-local inputs. COLLAPSED by default — a compact field
   that opens the calendar panel on tap, so the screen stays small until the customer picks.
   CSS Grid honors `direction`, so the calendar mirrors correctly in RTL with no per-cell
   rules; the nav glyphs swap via ::before like the rest of the UI. Logical (start/end) radii
   round the range ends in both scripts. */
/* The "Your stay …" summary sits on the title row (not inside the calendar). */
.head-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.1rem 1rem; }
.head-stay { color: var(--primary-ink); font-size: 0.95rem; }
.head-stay strong { margin-inline-end: 0.35rem; }

/* "Get price" shares the row with the collapsed date bar; it wraps below on narrow phones.
   flex-start keeps the button beside the summary when the calendar panel expands below it. */
.select-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.6rem; }
.select-row .rangepick { flex: 1 1 60%; min-inline-size: 14rem; }
.select-row .actions { flex: 0 0 auto; margin: 0; align-items: stretch; }

/* Returning customers: a quiet link to look up / manage an existing booking (trailing-aligned). */
.have-booking { text-align: end; margin-block-start: 0.6rem; }
.have-booking button {
  background: none; border: 0; padding: 0.35rem; font: inherit; cursor: pointer;
  color: var(--primary); text-decoration: underline; text-underline-offset: 2px;
}
.have-booking button:hover { color: var(--primary-ink); }

/* position:relative so the calendar opens as an OVERLAY (absolute) below the bar instead of
   growing the box — .rangepick stays the trigger's height, so the button stretches to match it. */
.rangepick { position: relative; display: grid; gap: 0.5rem; font-family: var(--font); }
/* Collapsed field: a Start | End summary (calendar-icon date + clock-icon 24h time), one tap
   opens the calendar panel. */
/* Matches the brand's form fields: gray fill, underline only (no box), doubled-underline focus. */
.rp-trigger {
  display: flex; align-items: stretch; inline-size: 100%; padding: 0.5rem 0.65rem;
  border: 0; border-block-end: 1.5px solid var(--line-strong); border-radius: 0;
  background: var(--field); color: var(--ink); text-align: start;
}
.rp-trigger:hover { border-block-end-color: #a8a8a8; }
.rp-trigger.rp-open { border-block-end-color: var(--primary); box-shadow: 0 1px 0 0 var(--primary); }
.rp-slot { flex: 1; min-inline-size: 0; display: grid; gap: 0.28rem; padding-inline: 0.55rem; }
.rp-slot-label { color: var(--primary); font-size: 0.84rem; font-weight: 600; }
.rp-slot-vals { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; }
.rp-slot-part { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 1.05rem; color: var(--primary-ink); white-space: nowrap; }
.rp-slot-part bdi { font-variant-numeric: tabular-nums; }
/* placeholder (today, until a day is tapped): muted, not the pale faint — readable, clearly unset */
.rp-slot-ph .rp-slot-vals, .rp-slot-ph .rp-ic { color: var(--muted); }
.rp-ic { flex: none; color: var(--muted); }
.rp-slot-div { inline-size: 1px; align-self: stretch; background: var(--line); }
/* Arabic reads smaller/lighter than Latin at the same px — nudge the picker's key text up and
   give it a touch more line-height so it matches the Latin weight and stays legible in RTL. */
[dir="rtl"] .rangepick { line-height: 1.5; }
[dir="rtl"] .rp-slot-label { font-size: 0.9rem; }
[dir="rtl"] .rp-slot-part { font-size: 1.14rem; }
[dir="rtl"] .rp-title { font-size: 1.06rem; }
[dir="rtl"] .rp-day { font-size: 1.08rem; }
[dir="rtl"] .rp-tfield > span { font-size: 0.74rem; }
[dir="rtl"] .rp-timebtn, [dir="rtl"] .rp-timeopt { font-size: 1.2rem; }
/* The opened panel: the calendar + times as a card below the field. */
.rp-panel {
  position: absolute; inset-block-start: calc(100% + 4px); inset-inline-start: 0; z-index: 30;
  inline-size: 21rem; max-inline-size: calc(100vw - 2rem);
  border: 1px solid var(--line); border-block-start: 3px solid var(--primary); /* brand accent edge */
  border-radius: var(--radius); padding: 0.7rem 0.6rem 0.6rem;
  background: var(--surface); box-shadow: var(--shadow); display: grid; gap: 0.55rem;
}
/* After the start is picked, the calendar moves to the END side (pinned to the trigger's trailing
   edge); it returns to the start side when nothing is picked or the range is complete/reset. */
.rp-panel.rp-side-end { inset-inline-start: auto; inset-inline-end: 0; }
/* prev/next are absolutely pinned to the logical edges (inset-inline-start/end), so their
   position never depends on flex reordering — deterministic in LTR and RTL. Each glyph points
   OUTWARD toward its own edge (swapped in RTL, where inline-start is the right). */
.rp-nav {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-block-size: 2rem; margin-block-end: 0.2rem;
}
.rp-title { text-align: center; font-weight: 600; font-size: 1rem; padding-inline: 2.4rem; color: var(--primary-ink); }
.rp-nav button {
  position: absolute; top: 50%; transform: translateY(-50%);
  inline-size: 2rem; block-size: 2rem; min-block-size: 2rem;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius-sm); color: var(--primary-ink);
  font-size: 1.05rem; line-height: 1; display: grid; place-items: center;
}
.rp-prev { inset-inline-start: 0; }
.rp-next { inset-inline-end: 0; }
/* ‹ › are BIDI-MIRRORED: the browser auto-flips them in RTL, so ‹ renders as › (and vice versa)
   in Arabic. With the buttons on logical edges, that mirroring already makes each point outward —
   do NOT add a dir swap on top or they double-flip and point the wrong way. */
.rp-prev::before { content: "\2039"; }   /* ‹ — mirrors to › in RTL (outward on the right) */
.rp-next::before { content: "\203A"; }   /* › — mirrors to ‹ in RTL (outward on the left) */
.rp-nav button:disabled { opacity: 0.35; cursor: not-allowed; }
.rp-dow, .rp-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.rp-dow { margin-block-end: 0.25rem; }
.rp-dow span {
  text-align: center; font-size: 0.74rem; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.02em; padding-block: 0.1rem;
}
.rp-grid { gap: 0; }                       /* touch, so an in-range fill reads as one bar */
.rp-day {
  min-block-size: 1.95rem; border: 0; background: transparent; color: var(--ink);
  border-radius: var(--radius-sm); font: inherit; font-size: 0.95rem;
  display: grid; place-items: center;
}
.rp-day.rp-on:hover { background: var(--primary-soft); }
.rp-out { visibility: hidden; }            /* blank the adjacent-month cells */
.rp-past:not(.rp-out) { color: var(--faint); text-decoration: line-through; }
/* today reads as a plain gray square until it's actually picked; the range/selection
   rules below come later in the cascade, so they override this the moment it's chosen. */
.rp-today { background: var(--field); }
.rp-in { background: var(--primary-soft); border-radius: 0; }
.rp-start, .rp-end, .rp-solo {
  background: var(--primary); color: #fff; font-weight: 600; text-decoration: none;
}
.rp-start { border-start-end-radius: 0; border-end-end-radius: 0; }   /* flat toward the range */
.rp-end   { border-start-start-radius: 0; border-end-start-radius: 0; }
.rp-hint { margin: 0; color: var(--muted); font-size: 0.92rem; }
.rp-stay { margin: 0; color: var(--primary-ink); line-height: 1.5; }
.rp-stay strong { margin-inline-end: 0.35rem; }
/* From→to time bar: two labelled time dropdowns joined by an arrow, so it reads as one
   "entry-time → exit-time" range. The arrow flips in RTL like the calendar nav. */
.rp-timebar { display: flex; align-items: center; justify-content: center; gap: 0.55rem; }
.rp-tfield { display: grid; gap: 0.28rem; justify-items: center; flex: 1; min-inline-size: 0; }
.rp-tfield > span {
  font-size: 0.68rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.02em;
}
.rp-arrow { align-self: center; margin-block-start: 1rem; color: var(--muted); font-size: 1.1rem; }
/* → is bidi-mirrored: it auto-renders as ← in RTL (entry→exit becomes exit←entry). No dir swap. */
.rp-arrow::before { content: "\2192"; }
/* Custom time dropdown: a value chip that opens a SHORT scrolling list (~6 rows, then scroll) —
   a native <select> popup can't be length-capped. Logical padding/caret stay correct in RTL. */
.rp-timefield { position: relative; inline-size: 100%; max-inline-size: 8rem; }
.rp-timebtn {
  inline-size: 100%; min-block-size: 0;
  padding-block: 0.34rem; padding-inline-start: 0.95rem; padding-inline-end: 1.9rem;
  border: 1px solid var(--line-strong); border-radius: 0; background: var(--field);
  color: var(--primary-ink); font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums;
  text-align: center;
}
.rp-timebtn::after {
  content: "\25BE"; position: absolute; inset-inline-end: 0.7rem; top: 50%;
  transform: translateY(-50%); color: var(--muted); font-size: 0.75rem; pointer-events: none;
}
.rp-timefield.rp-open .rp-timebtn { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.rp-timefield.rp-open .rp-timebtn::after { transform: translateY(-50%) rotate(180deg); }
/* Pulse the chip when the guided flow AUTO-opens its list, to pull the eye there. */
@keyframes rp-blink {
  0%, 100% { box-shadow: 0 0 0 3px var(--focus); }
  50% { box-shadow: 0 0 0 6px var(--primary); }
}
.rp-timefield.rp-blink .rp-timebtn { animation: rp-blink 0.45s ease-in-out 2; }
@media (prefers-reduced-motion: reduce) {
  .rp-timefield.rp-blink .rp-timebtn { animation: none; }
}
.rp-timelist {
  display: none; position: absolute; inset-block-end: calc(100% + 4px); inset-inline: 0; /* opens ABOVE the chip */
  z-index: 5; max-block-size: 11rem; overflow-y: auto;  /* ~6 rows tall, scroll for more */
  /* a raised (non-white) fill + stronger elevation so it doesn't blend into the white calendar */
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); box-shadow: 0 8px 20px -6px rgba(16, 32, 48, 0.28); padding: 0.25rem;
  scrollbar-width: thin;
}
.rp-timefield.rp-open .rp-timelist { display: block; }
.rp-timeopt {
  inline-size: 100%; min-block-size: 0; padding: 0.44rem; border: 0; background: transparent;
  border-radius: var(--radius-sm); color: var(--ink); font-size: 1.05rem;
  font-variant-numeric: tabular-nums; text-align: center;
}
.rp-timeopt:hover { background: var(--primary-soft); }
.rp-timeopt-on { background: var(--primary); color: #fff; font-weight: 700; }
