/* ============================================================
   BOOK MY TRIP — FLIGHT & HOTEL RESERVATION FORM
   Page-scoped styles for flight-hotel-reservation.html.

   Everything here is built from the tokens in base.css — no new
   colours, no new fonts, no new radii. The only genuinely new
   pieces are the ones the site didn't have yet: a numbered step
   card, a radio-card, a number stepper, a file drop zone, and an
   inline field error (the rest of the site validates with a toast,
   which doesn't work on a form this long).
   ============================================================ */

/* ---------- STEP CARDS ----------
   Steps number themselves with a CSS counter rather than hardcoded
   digits, because the Hotel step is hidden for flight-only orders.
   A counter skips display:none elements automatically, so hiding it
   renumbers everything below with no JS involved. */
.rsv-steps { counter-reset: rsvstep; }

.rsv-step {
  counter-increment: rsvstep;
  position: relative;
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  margin-bottom: var(--sp-4);
}
.rsv-step[hidden] { display: none; }

.rsv-step__head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.rsv-step__num {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: var(--r-full);
  background: var(--navy-800);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .92rem;
  font-variant-numeric: tabular-nums;
}
.rsv-step__num::before { content: counter(rsvstep); }

.rsv-step__head h2 {
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 4px 0 0;
}
.rsv-step__head p {
  font-size: .85rem;
  color: var(--ink-mute);
  margin: 5px 0 0;
  line-height: 1.55;
}

/* Two fields side by side, collapsing on narrow screens. The site's
   .grid.g2 collapses at 620px, which is too late for label+input
   pairs on a phone — these want the full width sooner. */
.rsv-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--sp-4);
}
.rsv-row-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) {
  .rsv-row, .rsv-row-3 { grid-template-columns: 1fr; }
}

.field .req { color: var(--red-500); margin-left: 2px; }
.field .opt {
  font-weight: 500;
  color: var(--ink-mute);
  text-transform: none;
  letter-spacing: 0;
}

/* ---------- INLINE VALIDATION ----------
   The rest of the site reports errors with showToast(). On a ten-step
   form the visitor needs to know *which* field, so errors are anchored
   to the field and announced. */
.err {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--red-600);
  margin-top: 6px;
  line-height: 1.4;
}
.err::before {
  content: "";
  flex-shrink: 0;
  width: 14px; height: 14px;
  border-radius: var(--r-full);
  background: var(--red-500);
  /* exclamation mark, drawn rather than typed so it never wraps */
  background-image: linear-gradient(#fff, #fff), linear-gradient(#fff, #fff);
  background-size: 2px 5px, 2px 2px;
  background-position: center 3px, center 9px;
  background-repeat: no-repeat;
}
.field.is-err .err { display: flex; }
.field.is-err .input,
.field.is-err .select,
.field.is-err .textarea { border-color: var(--red-400); }
.field.is-err .input:focus,
.field.is-err .select:focus,
.field.is-err .textarea:focus {
  border-color: var(--red-500);
  box-shadow: 0 0 0 4px rgba(var(--rgb-red), .13);
}
/* Group-level errors (radios, checkbox, uploads) sit under the group. */
.grp.is-err .err { display: flex; }

/* ---------- RADIO CARDS ----------
   Same language as the .opt cards in the eligibility wizard: quiet
   until chosen, then the brand red that the design system reserves
   for action and selection. */
.rsv-opts {
  display: grid;
  gap: var(--sp-3);
  border: 0; padding: 0; margin: 0;   /* it's a <fieldset> */
}
.rsv-opts-2 { grid-template-columns: 1fr 1fr; }
.rsv-opts-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) {
  .rsv-opts-2, .rsv-opts-3 { grid-template-columns: 1fr; }
}

.rsv-opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .6);
  cursor: pointer;
  transition: border-color var(--t-fast) ease, background var(--t-fast) ease,
              box-shadow var(--t-fast) ease, transform var(--t-fast) ease;
}
.rsv-opt:hover { border-color: var(--navy-200); background: #fff; }
.rsv-opt input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  margin: 0;
}
.rsv-opt__dot {
  flex-shrink: 0;
  width: 20px; height: 20px;
  margin-top: 1px;
  border: 2px solid var(--navy-200);
  border-radius: var(--r-full);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.rsv-opt__b { flex: 1; min-width: 0; }
.rsv-opt__t {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  color: var(--navy-900);
  line-height: 1.3;
}
.rsv-opt__s {
  display: block;
  font-size: .8rem;
  color: var(--ink-mute);
  margin-top: 3px;
  line-height: 1.45;
}
.rsv-opt__p {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .88rem;
  color: var(--navy-700);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rsv-opt.sel {
  border-color: var(--red-500);
  background: var(--red-100);
  box-shadow: 0 0 0 3px rgba(var(--rgb-red), .1);
}
.rsv-opt.sel .rsv-opt__dot {
  border-color: var(--red-500);
  box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 10px var(--red-500);
}
.rsv-opt.sel .rsv-opt__p { color: var(--red-600); }
/* Keyboard users need the ring on the card, since the input is visually hidden. */
.rsv-opt input:focus-visible + .rsv-opt__dot {
  outline: 3px solid var(--red-400);
  outline-offset: 3px;
}

/* Star-rating chips — a compact variant of the same idea. */
.rsv-chips { display: flex; flex-wrap: wrap; gap: 10px; border: 0; padding: 0; margin: 0; }
.rsv-chip {
  position: relative;
  padding: 9px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .6);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .86rem;
  color: var(--navy-700);
  cursor: pointer;
  transition: all var(--t-fast) ease;
}
.rsv-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rsv-chip:hover { border-color: var(--navy-200); background: #fff; }
.rsv-chip.sel {
  border-color: var(--red-500);
  background: var(--red-500);
  color: #fff;
  box-shadow: var(--sh-red);
}
.rsv-chip input:focus-visible + span { outline: 3px solid var(--red-400); outline-offset: 6px; }

/* ---------- NUMBER STEPPER ---------- */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .74);
  overflow: hidden;
}
.stepper__b {
  width: 42px; height: 46px;
  border: 0;
  background: transparent;
  color: var(--navy-800);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background var(--t-fast) ease, color var(--t-fast) ease;
}
.stepper__b:hover:not(:disabled) { background: var(--navy-50); }
.stepper__b:disabled { opacity: .3; cursor: not-allowed; }
.stepper__v {
  width: 52px;
  text-align: center;
  border: 0;
  border-inline: 1.5px solid var(--line);
  background: transparent;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
  padding: 12px 0;
  -moz-appearance: textfield;
}
.stepper__v::-webkit-outer-spin-button,
.stepper__v::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper__v:focus { outline: none; background: #fff; }

/* ---------- FILE UPLOAD ---------- */
.drop {
  display: block;
  position: relative;
  padding: var(--sp-5) var(--sp-4);
  border: 2px dashed var(--navy-200);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .5);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast) ease, background var(--t-fast) ease;
}
.drop:hover, .drop.over { border-color: var(--red-400); background: var(--red-100); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop svg { width: 26px; height: 26px; margin: 0 auto 8px; color: var(--navy-600); }
.drop strong {
  display: block;
  font-family: var(--font-display);
  font-size: .92rem;
  color: var(--navy-800);
}
.drop small { display: block; font-size: .78rem; color: var(--ink-mute); margin-top: 4px; }
.drop input:focus-visible ~ strong { outline: 3px solid var(--red-400); outline-offset: 6px; }

.files { margin-top: var(--sp-3); display: grid; gap: 8px; }
.file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .8);
}
.file__thumb {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--navy-50) center/cover no-repeat;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: .62rem;
  font-weight: 800;
  color: var(--navy-700);
  letter-spacing: .04em;
  overflow: hidden;
}
.file__meta { flex: 1; min-width: 0; }
.file__n {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--navy-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file__s { font-size: .74rem; color: var(--ink-mute); }
.file__x {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: #fff;
  color: var(--ink-mute);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: all var(--t-fast) ease;
}
.file__x:hover { background: var(--red-100); color: var(--red-600); border-color: var(--red-400); }

/* The bar fills instantly — there's no upload in flight yet (see the
   backend TODO in reservation.js). It exists so the moment a real
   endpoint is wired in, progress has somewhere to render. */
.file__bar {
  height: 3px;
  border-radius: var(--r-full);
  background: var(--navy-50);
  margin-top: 5px;
  overflow: hidden;
}
.file__bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green-500);
  transition: width .5s var(--ease);
}

/* ---------- ORDER SUMMARY ---------- */
.sum {
  border: 1.5px solid var(--navy-200);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .72);
  overflow: hidden;
}
.sum__body { padding: var(--sp-4); }
.sum__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-4);
  padding: 9px 0;
  font-size: .9rem;
  border-bottom: 1px solid var(--line-soft);
}
.sum__row:last-child { border-bottom: 0; }
.sum__row span:first-child { color: var(--ink-soft); }
.sum__row b {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  color: var(--navy-900);
  white-space: nowrap;
}
.sum__row.is-off b { color: var(--green-500); }
.sum__empty {
  padding: var(--sp-4) 0;
  font-size: .88rem;
  color: var(--ink-mute);
  text-align: center;
}
.sum__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--navy-800);
  color: #fff;
}
.sum__total span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
}
.sum__total b {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

.promo { display: flex; gap: 10px; align-items: flex-start; }
.promo .input { flex: 1; text-transform: uppercase; }
.promo .input::placeholder { text-transform: none; }
.promo-msg { font-size: .78rem; font-weight: 600; margin-top: 7px; }
.promo-msg.ok { color: var(--green-500); }
.promo-msg.no { color: var(--red-600); }

/* ---------- PAYMENT DETAIL PANEL ---------- */
.pay-box {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--navy-50);
  border: 1px solid var(--line);
}
.pay-box h3 { font-size: .95rem; margin-bottom: 8px; }
.pay-box p { font-size: .87rem; color: var(--ink-soft); line-height: 1.7; }
.pay-box code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .82rem;
  background: #fff;
  border: 1px dashed var(--navy-200);
  border-radius: 5px;
  padding: 3px 8px;
  color: var(--navy-800);
}

/* ---------- ACCOUNT DETAIL ROWS ----------
   Label/value pairs for bank and wallet details. Used both in the in-form
   panel and on the confirmation screen, so it is deliberately independent
   of .pay-box — the confirmation card is a plain .card.

   dl/dd carry UA margins that would indent every value, so they're zeroed
   explicitly rather than relying on a global reset. */
.pay-rows { margin: var(--sp-3) 0 0; display: grid; gap: 6px; }
.pay-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0;
  padding: 7px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.pay-row dt {
  /* Fixed basis so the values line up as a column. If the row runs out of
     width the whole dd wraps beneath, which is what happens on a phone. */
  flex: 0 0 132px;
  margin: 0;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.pay-row dd {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}
.pay-val {
  font-family: var(--font-mono);
  font-size: .9rem;
  font-weight: 700;
  color: var(--navy-900);
  /* A 24-character IBAN must not be allowed to widen the card on a phone. */
  word-break: break-all;
  /* One click takes the whole value, which is the point of the row. */
  user-select: all;
}
.pay-copy {
  flex-shrink: 0;
  margin-left: auto;
  font: inherit;
  font-size: .76rem;
  font-weight: 700;
  padding: 5px 10px;
  min-height: 28px;
  border: 1px solid var(--navy-200);
  border-radius: var(--r-sm);
  background: var(--navy-50);
  color: var(--navy-800);
  cursor: pointer;
  transition: background var(--t-fast) ease, color var(--t-fast) ease,
              border-color var(--t-fast) ease;
}
.pay-copy:hover { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.pay-copy.is-ok { background: var(--green-500); border-color: var(--green-500); color: #fff; }

/* ---------- DECLARATION ---------- */
.declare {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: var(--sp-4);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .6);
  cursor: pointer;
  transition: border-color var(--t-fast) ease, background var(--t-fast) ease;
}
.declare.sel { border-color: var(--navy-600); background: rgba(255, 255, 255, .9); }
.declare input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.declare__box {
  flex-shrink: 0;
  width: 22px; height: 22px;
  margin-top: 1px;
  border: 2px solid var(--navy-200);
  border-radius: 6px;
  background: #fff;
  display: grid; place-items: center;
  transition: all var(--t-fast) ease;
}
.declare__box svg { width: 14px; height: 14px; color: #fff; opacity: 0; transition: opacity var(--t-fast) ease; }
.declare.sel .declare__box { background: var(--green-500); border-color: var(--green-500); }
.declare.sel .declare__box svg { opacity: 1; }
.declare input:focus-visible + .declare__box { outline: 3px solid var(--red-400); outline-offset: 3px; }
.declare__t { font-size: .88rem; line-height: 1.7; color: var(--ink-soft); }
.declare__t strong { color: var(--navy-900); display: block; margin-bottom: 4px; font-size: .9rem; }

.rsv-submit[disabled] {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(.4);
}

/* ---------- CONFIRMATION SCREEN ---------- */
.done-badge {
  width: 76px; height: 76px;
  margin: 0 auto var(--sp-5);
  border-radius: var(--r-full);
  background: var(--green-100);
  border: 2px solid var(--green-500);
  display: grid; place-items: center;
  color: var(--green-500);
}
.done-badge svg { width: 36px; height: 36px; }

.done-id {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-radius: var(--r-full);
  background: var(--navy-900);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .06em;
}
.done-id small {
  font-family: var(--font-body);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--navy-400);
}

/* The one loud thing on the page. It is loud on purpose: nothing gets
   processed until the visitor acts on it, so it outranks everything
   else on the confirmation screen. */
.action-alert {
  border: 2px solid var(--red-500);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, #fff 0%, var(--red-100) 100%);
  box-shadow: 0 10px 34px -14px rgba(var(--rgb-red), .5);
  overflow: hidden;
}
.action-alert__top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px var(--sp-5);
  background: var(--red-500);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: .01em;
}
.action-alert__top svg { width: 20px; height: 20px; flex-shrink: 0; }
.action-alert__body { padding: var(--sp-5); }
.action-alert__body p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--navy-900);
  font-weight: 500;
}
.action-alert__body p strong { color: var(--red-600); font-weight: 800; }
.action-alert .btn-wa { margin-top: var(--sp-5); }
.action-alert__note {
  font-size: .8rem;
  color: var(--ink-mute);
  text-align: center;
  margin-top: 12px;
  line-height: 1.6;
}

@media (prefers-reduced-motion: no-preference) {
  .action-alert { animation: alert-pop .6s var(--ease) both; }
  @keyframes alert-pop {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: none; }
  }
}

/* Invoice table on the confirmation screen. */
.inv { width: 100%; border-collapse: collapse; font-size: .89rem; }
.inv th {
  text-align: left;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 700;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.inv th:last-child, .inv td:last-child { text-align: right; }
.inv td {
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
  vertical-align: top;
}
.inv td:first-child { color: var(--navy-900); font-weight: 600; }
.inv td:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv tfoot td {
  border-bottom: 0;
  border-top: 2px solid var(--navy-800);
  padding-top: 14px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--navy-900);
}

.done-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 760px) { .done-grid { grid-template-columns: 1fr; } }

/* ---------- PRINT ----------
   The visitor's own copy of the order. Everything that only makes
   sense on screen comes off. */
@media print {
  .hdr, .drawer, .ft, .wa-float, .chat-fab, .toast,
  .action-alert .btn, .no-print, .scroll-bar { display: none !important; }
  body::before, body::after { display: none !important; }
  .sec { padding-block: 0 !important; }
  .card, .lead-card, .action-alert {
    box-shadow: none !important;
    backdrop-filter: none !important;
    background: #fff !important;
    break-inside: avoid;
  }
  .action-alert { border: 2px solid #000 !important; }
  .action-alert__top { background: #000 !important; }
}
