/*
 * /reservation/ — web booking form (#182). Builds on ../crimemap/pages.css (palette, nav, .btn, .field, .form, footer).
 * Mobile first: one column, the summary under the form; side by side from 960px.
 * Buttons in the LEON brand blue (#007BBE, hover #1F9FE0) like the home page.
 */
:root { --brand: #007BBE; --brand-hi: #1F9FE0; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.bk-hero { position: relative; padding: 44px 0 8px; overflow: hidden; }
.bk-hero::before { content: ''; position: absolute; inset: -40% -20% auto auto; width: 620px; height: 620px; background: radial-gradient(circle, rgba(0,123,190,.22), transparent 62%); pointer-events: none; }
.bk-hero .wrap { position: relative; }
.bk-hero h1 { font-size: clamp(32px, 6vw, 56px); font-weight: 800; }
.bk-hero .lead { color: var(--soft); font-size: 17px; margin: 14px 0 0; max-width: 640px; }

section.bk-section { padding: 28px 0 72px; }
.bk-layout { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
.bk-main { min-width: 0; }

/* Steps */
.bk-steps { list-style: none; display: flex; gap: 8px; margin: 0 0 16px; padding: 0; }
.bk-steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); min-width: 0; }
.bk-steps li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-steps b { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--surface); color: var(--soft); }
.bk-steps li.is-current { color: #fff; border-color: var(--brand); }
.bk-steps li.is-current b, .bk-steps li.is-done b { background: var(--brand); color: #fff; }
.bk-steps li.is-done { color: var(--soft); }

/* Brand-blue buttons */
.btn.blue { background: var(--brand); color: #fff; box-shadow: 0 10px 26px rgba(0,123,190,.3); }
.btn.blue:hover { background: var(--brand-hi); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.form-actions .btn { flex: 1 1 auto; }

/* Service tabs (the app's three modes) */
.bk-tabs { border: 0; margin: 0 0 20px; padding: 4px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--field); border-radius: 16px; }
.bk-tabs label { position: relative; min-width: 0; }
.bk-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.bk-tabs span { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 10px 6px; border-radius: 12px; cursor: pointer; color: var(--soft); transition: background .15s, color .15s; }
.bk-tabs svg { width: 22px; height: 22px; }
.bk-tabs b { font-size: 14px; font-weight: 600; }
.bk-tabs small { font-size: 11px; color: var(--muted); line-height: 1.3; }
.bk-tabs input:checked + span { background: var(--brand); color: #fff; }
.bk-tabs input:checked + span small { color: rgba(255,255,255,.8); }
.bk-tabs input:focus-visible + span { outline: 2px solid var(--brand-hi); outline-offset: 2px; }

/* Address autocomplete */
.bk-place { position: relative; }
.bk-suggest { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin: 6px 0 0; padding: 6px; list-style: none; background: #1A1E26; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.45); max-height: 320px; overflow-y: auto; }
.bk-suggest li { padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 14.5px; line-height: 1.35; }
.bk-suggest li small { display: block; color: var(--muted); font-size: 12.5px; }
.bk-suggest li[aria-selected="true"], .bk-suggest li:hover { background: rgba(0,123,190,.22); }
.bk-suggest li.muted { cursor: default; color: var(--muted); background: none; }
.field input.is-set { border-color: rgba(0,123,190,.6); }
.field input.is-error, .field textarea.is-error { border-color: #F0868A; }

/* Options (vehicle classes / security types) */
.bk-options-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 28px 0 12px; }
.bk-options-head h2 { font-size: 19px; font-weight: 600; }
.bk-options { display: grid; grid-template-columns: 1fr; gap: 10px; }
.bk-empty { margin: 0; padding: 18px; border: 1px dashed var(--border); border-radius: 16px; color: var(--muted); font-size: 14.5px; text-align: center; }
.bk-opt { position: relative; display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px 12px 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--field); cursor: pointer; transition: border-color .15s, background .15s; }
.bk-opt input { position: absolute; opacity: 0; pointer-events: none; }
.bk-opt:hover { border-color: #4C515E; }
.bk-opt.is-selected { border-color: var(--brand); background: rgba(0,123,190,.12); }
.bk-opt:focus-within { outline: 2px solid var(--brand-hi); outline-offset: 2px; }
.bk-opt.is-off { opacity: .55; cursor: not-allowed; }
.bk-opt .pic { width: 84px; height: 52px; border-radius: 10px; background: var(--surface) center / contain no-repeat; }
.bk-opt .txt { min-width: 0; }
.bk-opt .txt b { display: block; font-size: 15.5px; font-weight: 600; }
.bk-opt .txt small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; }
.bk-opt .meta { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--soft); font-size: 12.5px; margin-top: 3px; }
.bk-opt .meta span { white-space: nowrap; }
.bk-opt.no-pic { grid-template-columns: 1fr auto; padding-left: 16px; }
.bk-opt.no-pic .pic { display: none; }
.bk-opt .price { text-align: right; font-size: 17px; font-weight: 700; white-space: nowrap; }
.bk-opt .price small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.bk-opt.is-loading .price, .bk-opt.is-loading .txt b { color: transparent; background: linear-gradient(90deg, var(--surface), #2E333D, var(--surface)); background-size: 200% 100%; border-radius: 6px; animation: bk-shimmer 1.2s infinite linear; }
@keyframes bk-shimmer { to { background-position: -200% 0; } }

/* Payment */
.bk-payment { min-height: 60px; margin: 6px 0 4px; }
.bk-secure { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; }
.bk-secure svg { width: 16px; height: 16px; flex-shrink: 0; }
#pay-mode-text { color: var(--soft); font-size: 14.5px; margin: 0 0 18px; }

/* Summary */
.bk-summary { background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 20px; }
.bk-summary h2 { font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.bk-summary dl { margin: 0; display: grid; gap: 10px; }
.bk-summary dl div { display: grid; grid-template-columns: 76px 1fr; gap: 10px; font-size: 14px; }
.bk-summary dt { color: var(--muted); }
.bk-summary dd { margin: 0; color: #fff; overflow-wrap: anywhere; }
.bk-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--border); margin: 16px 0 10px; padding-top: 14px; font-size: 15px; color: var(--soft); }
.bk-total b { font-size: 24px; color: #fff; }

/* Done */
.bk-done { text-align: center; }
.bk-done .tick { width: 58px; height: 58px; border-radius: 50%; margin: 4px auto 16px; display: grid; place-items: center; background: rgba(48,164,108,.16); }
.bk-done h3 { font-size: 24px; }
.bk-done > p { color: var(--soft); max-width: 520px; margin: 10px auto 0; }
.bk-ref b { display: inline-block; margin-left: 6px; font-size: 20px; color: #fff; letter-spacing: .04em; }
.bk-app { margin: 26px 0 22px; padding: 20px; border-radius: 18px; background: var(--field); border: 1px solid var(--border); }
.bk-app h4 { margin: 0 0 6px; font-size: 17px; }
.bk-app p { margin: 0 0 16px; color: var(--soft); font-size: 14.5px; }
.stores { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.badge { display: inline-flex; align-items: center; gap: 11px; height: 54px; padding: 0 18px; background: #000; border: 1px solid #3a3f4b; border-radius: 13px; text-decoration: none; color: #fff; text-align: left; }
.badge:hover { border-color: #6b7080; }
.badge svg { width: 26px; height: 26px; flex-shrink: 0; }
.badge small { display: block; font-size: 10.5px; line-height: 1; opacity: .8; }
.badge b { display: block; font-size: 17px; font-weight: 600; line-height: 1.25; white-space: nowrap; }

@media (min-width: 640px) {
  .bk-options { grid-template-columns: 1fr 1fr; }
  .form-actions .btn { flex: 0 0 auto; }
}
@media (min-width: 960px) {
  .bk-hero { padding: 64px 0 12px; }
  .bk-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; }
  .bk-summary { position: sticky; top: 88px; }
}
@media (max-width: 600px) {
  #step1 .fields { grid-template-columns: 1fr 1fr; gap: 14px 12px; }
  .bk-opt { grid-template-columns: 64px 1fr auto; }
  .bk-opt .pic { width: 64px; height: 44px; }
  .bk-steps li { padding: 8px; font-size: 12px; }
  .bk-steps li:not(.is-current) { flex: 0 0 auto; }
  .bk-steps li:not(.is-current) span { display: none; }
}
@media (max-width: 400px) {
  .bk-opt, .bk-opt.no-pic { grid-template-columns: 1fr auto; padding-left: 14px; }
  .bk-opt .pic { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bk-opt.is-loading .price, .bk-opt.is-loading .txt b { animation: none; } }

/* #504 payment method: card (Stripe) or Whop, shown only when the API offers Whop */
.bk-providers { display: flex; gap: 10px; margin: 4px 0 14px; flex-wrap: wrap; }
.bk-providers label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border, #2F3543); border-radius: 12px; padding: 10px 16px; cursor: pointer; font-weight: 500; }
.bk-providers label:has(input:checked) { border-color: #007BBE; background: rgba(0, 123, 190, .12); }

/* ───── Embedded on a partner website (27 Nov 2026, embed.js → /reservation/?embed=1&brand=…) ─────
 * Only the form; the brand's colours from html[data-brand]; "<site> · official partner of LEON" above the steps. */
.is-embed .skip, .is-embed nav.top, .is-embed .bk-hero, .is-embed #faq, .is-embed footer { display: none !important; }
.is-embed body { overflow: hidden; }
.is-embed section.bk-section { padding: 18px 0 28px; }
.is-embed .wrap { padding: 0 16px; }
.is-embed .bk-summary { position: static; }
.bk-partner { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 13px; color: var(--soft); }
.bk-partner img { height: 18px; width: auto; flex-shrink: 0; }
.bk-suggest { background: var(--card, #1A1E26); }

/* AlloDriver (allodriver.com theme: #007BBE on #202730 / #242429, Avenir Next → Poppins here) */
html[data-brand="allodriver"] { --brand: #007BBE; --brand-hi: #1F9FE0; --accent: #1F9FE0; --bg: #202730; --bg2: #242429; --card: #242429; --surface: #32333E; --field: #1B2029; --border: #32333E; }
/* French Riviera Limousine (frenchrivieralimousine.com: navy #0B1626 / #12233B, blue #0A76BA, Manrope) */
html[data-brand="frl"] { --brand: #0A76BA; --brand-hi: #1188D6; --accent: #1188D6; --bg: #0B1626; --bg2: #0F1D31; --card: #12233B; --surface: #1A2E4A; --field: #0F1D31; --border: #23395A; --text: #F4F3F0; --soft: #D6DBE3; --muted: #B3BDCB; }
html[data-brand="frl"] body, html[data-brand="frl"] .btn, html[data-brand="frl"] input, html[data-brand="frl"] textarea { font-family: Manrope, Poppins, system-ui, sans-serif; }

/* E-mail code (1 Dec 2026) */
.bk-code { display: grid; gap: 12px; margin: 18px 0 4px; padding: 16px; border-radius: 14px; background: var(--field, #1C2028); }
.bk-code p { margin: 0; }
.bk-code .field { max-width: 220px; }
.bk-code #code { letter-spacing: .4em; font-size: 20px; text-align: center; }
.bk-code .btn { justify-self: start; }

/* Whop's payment element (1 Dec 2026) */
.bk-whop { display: grid; gap: 12px; margin: 8px 0 4px; }

/* Payment step rhythm (1 Dec 2026): notes smaller than the text, with air around them */
#step3 #pay-mode-text { margin: 4px 0 20px; line-height: 1.55; }
#step3 .bk-payment { margin: 0 0 4px; }
#save-note { font-size: 12.5px; line-height: 1.55; color: var(--muted); margin: 16px 0 0; }
#step3 .form-actions { margin-top: 24px; }
#step3 .bk-secure { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }
/* Promo code */
.bk-promo { margin: 0 0 22px; }
.bk-promo label { font-size: 13px; }
.bk-promo-row { display: flex; gap: 10px; }
.bk-promo-row input { flex: 1 1 auto; min-width: 0; text-transform: uppercase; letter-spacing: .04em; }
.bk-promo-row .btn { flex: 0 0 auto; padding-left: 18px; padding-right: 18px; }
.bk-promo-msg { font-size: 12.5px; line-height: 1.5; margin: 2px 0 0; min-height: 0; color: var(--muted); }
.bk-promo-msg:empty { display: none; }
.bk-promo-msg.ok { color: #6FD3A0; }
.bk-promo-msg.err { color: #F0868A; }

/* Popular places heading in the address lists (1 Dec 2026) */
.bk-suggest li.bk-list-head { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 14px 4px; cursor: default; pointer-events: none; }

/* Wide screens with the summary on the right (1 Dec 2026): the route on one line, the small fields on the next */
@media (min-width: 960px) {
  #step1 .fields { display: flex; flex-wrap: wrap; gap: 14px 12px; align-items: flex-end; }
  #step1 .fields > .field { flex: 1 1 84px; min-width: 84px; }
  #step1 .fields > .bk-place { flex: 1 1 calc(50% - 6px); min-width: 0; }
  #step1 .fields:has(#dropoff-field[hidden]) > .bk-place { flex-basis: 100%; }
  #step1 .fields > .field:has(#date) { flex: 1.5 1 138px; }
  #step1 .fields > .field:has(#time) { flex: 1.4 1 150px; }
  #step1 .fields > .field:has(#agents) { flex: 1.4 1 124px; }
  #step1 .fields > .field:not(.bk-place) label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #step1 .bk-tabs { margin-bottom: 16px; }
  #step1 .bk-options-head { margin-top: 20px; }
}

/* ───── 1 Dec 2026: "Continue / Pay" always on the right of the form, "Back" on the left; the status on its own line ───── */
.form-actions .btn[type="submit"] { margin-left: auto; }
.form-actions .form-status { order: 3; flex-basis: 100%; }
.form-actions .form-status:empty { display: none; }

/* Terms: the checkbox and its text on one line; red when not ticked */
.fields .check.bk-terms { flex-direction: row; align-items: center; gap: 12px; }
.fields .check.bk-terms input { margin: 0; }
.check.bk-terms.is-error { color: #F0868A; }
.check.bk-terms.is-error input { outline: 2px solid #F0868A; outline-offset: 2px; border-radius: 4px; }

/* Phone: intl-tel-input on the dark form (flag + dial code, mask of the country) */
.field .iti { width: 100%; display: block; }
:root { --iti-border-color: var(--border); --iti-hover-color: rgba(255,255,255,.06); --iti-icon-color: var(--muted); --iti-country-selector-bg: var(--surface, #252931); }
.iti__selected-dial-code { color: var(--soft); }
.iti__country-selector { color: var(--text, #fff); font-size: 15px; overflow: hidden; }
.iti--inline-country-selector .iti__country-selector { border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.45); margin-top: 4px; }
.iti__country-name { color: var(--text, #fff); }
.iti__dial-code { color: var(--muted); }
.iti__country.iti__highlight { background: rgba(26,154,230,.16); }
.iti__search-input { background: var(--field); color: #fff; font: inherit; }
.field .iti .iti__search-input { border: 0; border-radius: 0; padding: 10px 40px; font-size: 15px; }
.iti__search-input:focus, .field .iti .iti__search-input:focus { outline: none; box-shadow: none; }

/* Looking up the LEON account of the phone: both fields dimmed, a spinner in the phone */
.bk-phone, .bk-email { position: relative; transition: opacity .15s; }
.bk-phone.is-busy, .bk-email.is-busy { opacity: .55; }
.bk-phone.is-busy .iti::after { content: ""; position: absolute; right: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: bk-spin .7s linear infinite; }
@keyframes bk-spin { to { transform: rotate(360deg); } }
.field input.is-account { color: var(--soft); background: rgba(0,123,190,.08); border-color: rgba(0,123,190,.45); cursor: default; }

/* Step 1 lists (1 Dec 2026): time = hour + minutes side by side; the date opens its calendar on any click */
.bk-time { display: flex; align-items: center; gap: 6px; }
.bk-time select { flex: 1 1 0; min-width: 0; }
.bk-time span { color: var(--muted); font-weight: 600; }
.field input[type="date"] { cursor: pointer; }
#step1 .field select { padding-right: 30px; background-position: calc(100% - 17px) 52%, calc(100% - 11px) 52%; }

/* Saved cards of the client's LEON account (1 Dec 2026), above the card element */
.bk-cards { display: grid; gap: 8px; margin: 0 0 16px; }
.bk-cards-title { margin: 0 0 2px; font-size: 13px; font-weight: 500; color: var(--soft); }
.bk-cards label { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: var(--field); }
.bk-cards label:has(input:checked) { border-color: var(--brand); background: rgba(0, 123, 190, .12); }
.bk-cards input { accent-color: var(--brand); width: 18px; height: 18px; margin: 0; flex-shrink: 0; }
.bk-card-name { font-weight: 500; letter-spacing: .02em; }
.bk-cards small { margin-left: auto; font-size: 12.5px; color: var(--muted); }

/* 2 Dec 2026 — the form on a partner site's own domain (frenchrivieralimousine.com/book/, html.is-site[data-brand]):
 * its own header / footer (the site's page), no LEON app block on the confirmation */
.is-site .bk-app, .is-site .bk-partner { display: none !important; }
