/* Booking-page-only visual system (modules/booking/views/book.ejs).
   Deliberately NOT Tailwind utility classes, unlike every other view in
   this app — adapted from UI-UX-Audits/booking-page-platform-branded.html,
   a from-scratch design system built to fix the problems documented in
   UI-UX-Audits/booking-page-Audit.md. See book.ejs's own top comment for
   the full list of adaptations made from that prototype to the real app
   (real branding data, real attendee-collection form, dark mode, no
   simulated-phone chrome, etc).

   Dark-mode variants of these custom properties live right here under
   html.dark, rather than in the shared public/theme.css — that file's job
   is overriding shared Tailwind class names used across many pages; these
   properties are used nowhere else, so keeping both palettes together in
   one file keeps each file cohesive. */

:root{
  --ink:#131A2E;
  --page-bg:#F5F6FA;
  --surface:#FFFFFF;
  --border:#E4E7F0;
  --border-strong:#D6DAE8;
  --text-primary:#131A2E;
  --text-secondary:#5B6478;
  --text-tertiary:#9AA1B4;
  --accent-1:#3352E1;
  --accent-2:#2540B8;
  --accent-glow:rgba(51,82,225,.45);
  --accent-grad:linear-gradient(135deg,var(--accent-1),var(--accent-2));
  --accent-tint:#EEF1FD;
  --gold:#E8A33D;
  --gold-soft:#FDF3E3;
  --gold-border:#EFCB8E;
  --error:#E14B4B;
  --error-tint:#FDECEC;
  --error-glow:rgba(225,75,75,.12);
  --radius-sm:10px;
  --radius-md:16px;
  --radius-lg:26px;
  --shadow-card:0 1px 2px rgba(19,26,46,.05), 0 1px 1px rgba(19,26,46,.03);
  --shadow-float:0 -8px 24px rgba(19,26,46,.08);
}

html.dark{
  --ink:#0B0F1D;
  --page-bg:#0F1420;
  --surface:#1A2036;
  --border:#2A3150;
  --border-strong:#3A4368;
  --text-primary:#F1F3FB;
  --text-secondary:#A9B1C9;
  --text-tertiary:#6B7593;
  --accent-1:#5C7CF0;
  --accent-2:#3352E1;
  --accent-glow:rgba(92,124,240,.55);
  --accent-tint:rgba(92,124,240,.16);
  --gold:#F0B655;
  --gold-soft:rgba(240,182,85,.12);
  --gold-border:rgba(240,182,85,.35);
  --error:#F0685F;
  --error-tint:rgba(240,104,95,.14);
  --error-glow:rgba(240,104,95,.16);
  --shadow-card:0 1px 2px rgba(0,0,0,.35), 0 1px 1px rgba(0,0,0,.25);
  --shadow-float:0 -8px 24px rgba(0,0,0,.45);
}

body.book-page{
  margin:0;
  background:var(--page-bg);
  color:var(--text-primary);
}
.page-shell *, .page-shell *::before, .page-shell *::after{ box-sizing:border-box; }
.page-shell button{ font-family:inherit; cursor:pointer; }
.page-shell input{ font-family:inherit; }

.page-shell{
  min-height:100vh;
  max-width:560px;
  margin:0 auto;
  background:var(--page-bg);
  color:var(--text-primary);
  font-family:'Inter',sans-serif;
  -webkit-font-smoothing:antialiased;
}

/* ---------- App bar ---------- */
.app-bar{
  position:sticky;
  top:0;
  z-index:30;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:calc(env(safe-area-inset-top,0px) + 14px) 14px 12px;
  background:transparent;
  transition:background-color .25s ease, box-shadow .25s ease;
}
.app-bar.is-scrolled{
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(10px);
  box-shadow:0 1px 0 var(--border);
}
html.dark .app-bar.is-scrolled{ background:rgba(15,20,32,.92); }
.app-bar__icon-btn{
  width:38px; height:38px;
  display:flex; align-items:center; justify-content:center;
  border-radius:50%;
  border:none;
  background:rgba(19,26,46,.35);
  color:#fff;
  transition:background-color .25s ease, color .25s ease;
  flex-shrink:0;
}
.app-bar.is-scrolled .app-bar__icon-btn{
  background:transparent;
  color:var(--text-primary);
}
.app-bar__actions{ display:flex; gap:8px; }
.app-bar__title{
  font-family:'Manrope',sans-serif;
  font-size:15px;
  font-weight:600;
  color:var(--text-primary);
  opacity:0;
  transition:opacity .25s ease;
  max-width:190px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.app-bar.is-scrolled .app-bar__title{ opacity:1; }

/* ---------- Hero ---------- */
.hero{
  position:relative;
  margin-top:-56px;
  padding-top:56px;
  height:230px;
  background:
    radial-gradient(120% 90% at 15% 0%, #1D2748 0%, transparent 55%),
    radial-gradient(120% 90% at 100% 100%, #16203D 0%, transparent 55%),
    var(--ink);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border-radius:0 0 32px 32px;
}
.hero__bg-image{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:cover;
  z-index:0;
}
.hero__scrim{
  position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(11,15,25,.1) 0%, rgba(11,15,25,.6) 100%);
  z-index:1;
}
.hero__mark{
  position:relative; z-index:2;
  text-align:center;
  color:#fff;
  transition:opacity .2s ease;
}
.hero__ticket-icon{ display:block; }

/* ---------- Layout helpers ---------- */
main{ padding:0 18px 0; }
.section-heading{
  font-family:'Manrope',sans-serif;
  font-size:13px;
  font-weight:600;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--text-secondary);
  margin:0 0 12px;
}

/* ---------- State messages (loading / not found / sold out / ended) ---------- */
.state-message{
  background:var(--surface);
  border:1.5px solid var(--border);
  border-radius:var(--radius-md);
  box-shadow:var(--shadow-card);
  padding:32px 20px;
  text-align:center;
  color:var(--text-secondary);
  font-size:14px;
  margin:0 0 18px;
}
.state-message--standalone{ margin:40px 18px; }

.error-banner{
  margin:0 0 16px;
  padding:14px 16px;
  border-radius:var(--radius-sm);
  background:var(--error-tint);
  border:1px solid var(--gold-border);
  border-color:rgba(225,75,75,.3);
  color:var(--error);
  font-size:13px;
}

/* ---------- Event card ---------- */
.event-card{ padding:18px 0 6px; }
.event-card__host{
  display:flex; align-items:center; gap:10px; margin-bottom:14px;
}
.avatar{
  width:34px; height:34px; border-radius:50%;
  background:var(--accent-grad);
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-family:'Manrope',sans-serif; font-weight:600; font-size:13px;
  flex-shrink:0;
  overflow:hidden;
}
.avatar img{ width:100%; height:100%; object-fit:cover; }
.event-card__host-text{ font-size:13px; color:var(--text-secondary); }
.event-card__host-text strong{ color:var(--text-primary); font-weight:600; }

.event-title{
  font-family:'Manrope',sans-serif;
  font-weight:600;
  font-size:25px;
  line-height:1.22;
  letter-spacing:-.01em;
  margin:0 0 14px;
}

.event-meta{ display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }
.event-meta__row{
  display:flex; align-items:center; gap:9px;
  font-size:13.5px; color:var(--text-secondary);
}
.event-meta__row svg{ color:var(--accent-1); flex-shrink:0; }

.event-actions{ display:flex; gap:8px; margin-bottom:18px; flex-wrap:wrap; }
.pill-btn{
  display:flex; align-items:center; gap:6px;
  padding:8px 14px;
  border-radius:999px;
  border:1px solid var(--border-strong);
  background:var(--surface);
  font-size:12.5px; font-weight:600; color:var(--text-primary);
  transition:border-color .15s ease, background-color .15s ease;
}
.pill-btn:hover{ border-color:var(--accent-1); background:var(--accent-tint); }
.pill-btn svg{ color:var(--accent-1); }

.event-desc{
  font-size:14px; line-height:1.6; color:var(--text-secondary);
  margin:0 0 4px;
}
.event-desc.is-clamped p{
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
  margin:0;
}
.event-desc.is-expanded p{ margin:0; }
.desc-toggle{
  border:none; background:none; padding:0; margin:6px 0 22px;
  font-size:13px; font-weight:700; color:var(--accent-1);
  display:block;
}

/* ---------- Progress stepper ---------- */
.stepper-nav{
  display:flex; align-items:flex-start; justify-content:space-between;
  padding:6px 6px 26px;
  margin-bottom:6px;
}
.stepper-nav__item{ display:flex; flex-direction:column; align-items:center; gap:7px; flex:1; }
.stepper-nav__line{ flex:1.2; height:2px; background:var(--border-strong); margin-top:13px; }
.stepper-nav__dot{
  width:26px; height:26px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700;
  border:1.5px solid var(--border-strong);
  background:var(--surface); color:var(--text-tertiary);
}
.stepper-nav__item.is-active .stepper-nav__dot{
  background:var(--accent-grad); border-color:transparent; color:#fff;
  box-shadow:0 4px 10px -2px var(--accent-glow);
}
.stepper-nav__label{ font-size:11px; font-weight:600; color:var(--text-tertiary); }
.stepper-nav__item.is-active .stepper-nav__label{ color:var(--text-primary); }

/* ---------- Ticket cards ---------- */
.tickets-section{ margin-bottom:22px; }
.ticket-list{ display:flex; flex-direction:column; gap:10px; }

.ticket-card{
  background:var(--surface);
  border:1.5px solid var(--border);
  border-radius:var(--radius-md);
  padding:14px 15px 13px;
  box-shadow:var(--shadow-card);
  transition:border-color .18s ease, background-color .18s ease;
}
.ticket-card.is-selected{
  border-color:var(--accent-1); background:var(--accent-tint);
}
.ticket-card__top{ display:flex; justify-content:space-between; gap:10px; margin-bottom:4px; }
.ticket-card__name{ font-size:15px; font-weight:700; margin:0; line-height:1.3; }
.ticket-card__price{ font-size:15px; font-weight:700; white-space:nowrap; font-variant-numeric:tabular-nums; }
.ticket-card__desc{ font-size:12.5px; line-height:1.5; color:var(--text-secondary); margin:6px 0 12px; }

.ticket-card__bottom{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.availability-tag{ font-size:11.5px; font-weight:600; color:var(--text-tertiary); }

.stepper{ display:flex; align-items:center; gap:10px; }
.qty-btn{
  width:30px; height:30px; border-radius:50%;
  border:1.5px solid var(--border-strong);
  background:var(--surface);
  display:flex; align-items:center; justify-content:center;
  font-size:16px; font-weight:600; line-height:1; color:var(--text-primary);
  transition:all .15s ease;
}
.qty-btn:disabled{ opacity:.35; cursor:not-allowed; }
.qty-btn:not(:disabled):active{ transform:scale(.92); }
.ticket-card.is-selected .qty-btn--plus{ background:var(--accent-grad); border-color:transparent; color:#fff; }
.qty-value{ min-width:16px; text-align:center; font-size:14px; font-weight:700; font-variant-numeric:tabular-nums; }

.ticket-card__subtotal{
  margin-top:10px; padding-top:10px; border-top:1px dashed var(--border-strong);
  font-size:12px; color:var(--text-secondary); text-align:right;
}
.ticket-card__subtotal strong{ color:var(--text-primary); }

/* ---------- Per-attendee detail rows (inside a selected ticket card) ---------- */
.attendee-rows{ display:flex; flex-direction:column; gap:8px; }
.attendee-rows:not(:empty){ margin-top:12px; padding-top:12px; border-top:1px dashed var(--border-strong); }
.attendee-row__grid{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; }
.attendee-row input{
  width:100%;
  border:1.5px solid var(--border-strong);
  border-radius:8px;
  background:var(--surface);
  padding:8px 10px;
  font-size:13px;
  color:var(--text-primary);
  outline:none;
  transition:border-color .15s ease;
}
.attendee-row input:focus{ border-color:var(--accent-1); }
.attendee-row input::placeholder{ color:var(--text-tertiary); }
@media (max-width:420px){
  .attendee-row__grid{ grid-template-columns:1fr; }
}

/* ---------- Details form ---------- */
.details-section{ margin-top:6px; margin-bottom:22px; }
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.field{ margin-bottom:14px; }
.field.field--full{ grid-column:1 / -1; }
.field label{
  display:block; font-size:12px; font-weight:600; color:var(--text-secondary);
  margin-bottom:6px;
}
.input-wrap{
  display:flex; align-items:center; gap:8px;
  border:1.5px solid var(--border-strong);
  border-radius:var(--radius-sm);
  background:var(--surface);
  padding:0 13px;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.input-wrap svg{ color:var(--text-tertiary); flex-shrink:0; }
.input-wrap:focus-within{ border-color:var(--accent-1); box-shadow:0 0 0 3px var(--accent-tint); }
.field.has-error .input-wrap{ border-color:var(--error); }
.field.has-error .input-wrap:focus-within{ box-shadow:0 0 0 3px var(--error-glow); }
.input-wrap input{
  border:none; outline:none; background:transparent;
  padding:12px 0; width:100%; font-size:14.5px; color:var(--text-primary);
}
.input-wrap input::placeholder{ color:var(--text-tertiary); }
.prefix{ font-size:14.5px; font-weight:600; color:var(--text-secondary); }
.field-error{
  display:block; min-height:16px; font-size:11.5px; font-weight:500; color:var(--error);
  margin-top:5px;
}

/* ---------- Confirm-email safety banner ---------- */
.confirm-banner{
  margin:0 0 22px;
  padding:14px 16px;
  border-radius:var(--radius-md);
  background:var(--gold-soft);
  border:1px solid var(--gold-border);
  color:var(--text-primary);
  font-size:13.5px;
}
.confirm-banner p{ margin:0 0 10px; }
.confirm-banner__actions{ display:flex; align-items:center; gap:16px; }
.confirm-banner__edit{
  border:none; background:none; padding:0;
  font-size:13px; font-weight:700; color:var(--text-primary);
  text-decoration:underline;
}
.cta-button--compact{ width:auto; padding:10px 20px; box-shadow:none; }

/* ---------- Spacer so content clears the fixed summary bar ----------
   The bar is position:fixed (reserves no document-flow space at all), so
   this needs to be tall enough that the form's last content (particularly
   the confirm-email banner) isn't left sitting behind it once the bar
   slides in — sized for the bar's typical collapsed height. */
.bottom-spacer{ height:150px; }

/* ---------- Summary / CTA bar ----------
   position:fixed, not sticky — this bar must stay pinned to the viewport's
   bottom edge and slide in/out via transform regardless of page length or
   scroll position. (position:sticky was tried first, matching the
   prototype, but sticky's "stuck" offset is computed independently of any
   transform applied to the same element — a translateY meant to hide the
   bar below the viewport doesn't reliably do so once the element is
   already in its stuck position, most visible on short pages. fixed +
   left:50% + translateX(-50%) for centering, combined with translateY for
   the slide, avoids that interaction entirely.) */
.summary-bar{
  position:fixed; left:50%; bottom:0; z-index:30;
  width:100%; max-width:560px;
  background:var(--surface);
  border-top:1px solid var(--border);
  border-radius:20px 20px 0 0;
  box-shadow:var(--shadow-float);
  padding-bottom:env(safe-area-inset-bottom,0px);
  transform:translateX(-50%) translateY(101%);
  transition:transform .32s cubic-bezier(.32,.72,0,1);
}
.summary-bar.is-visible{ transform:translateX(-50%) translateY(0); }

.summary-toggle{
  width:100%; border:none; background:none;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px 10px;
  color:var(--text-primary);
}
.summary-toggle__left{ display:flex; align-items:center; gap:7px; }
.summary-toggle__left svg{ color:var(--text-tertiary); transition:transform .2s ease; }
.summary-bar.is-expanded .summary-toggle__left svg{ transform:rotate(180deg); }
.summary-toggle__count{ font-size:13px; font-weight:600; color:var(--text-secondary); }
.summary-toggle__total{ font-size:17px; font-weight:800; font-variant-numeric:tabular-nums; }

.summary-itemized{
  max-height:0; overflow:hidden;
  transition:max-height .3s ease;
  padding:0 18px;
}
.summary-bar.is-expanded .summary-itemized{ max-height:220px; overflow-y:auto; }
.summary-item{
  display:flex; justify-content:space-between; gap:10px;
  font-size:12.5px; color:var(--text-secondary);
  padding:7px 0; border-bottom:1px solid var(--border);
}
.summary-item:last-child{ border-bottom:none; }
.summary-item strong{ color:var(--text-primary); font-weight:600; }

.summary-footer{ padding:12px 18px 16px; }
.cta-button{
  width:100%;
  display:flex; align-items:center; justify-content:center; gap:8px;
  padding:15px; border:none; border-radius:var(--radius-sm);
  background:var(--accent-grad);
  color:#fff; font-size:15px; font-weight:700;
  box-shadow:0 10px 22px -8px var(--accent-glow);
  transition:transform .12s ease, opacity .2s ease;
}
.cta-button:active{ transform:scale(.98); }
.cta-button:disabled{ opacity:.65; cursor:progress; }
.trust-row{
  display:flex; align-items:center; justify-content:center; gap:6px;
  margin-top:11px; font-size:11.5px; color:var(--text-tertiary);
}
.trust-row svg{ color:var(--text-tertiary); flex-shrink:0; }
.trust-row .trust-brand{ color:var(--text-secondary); font-weight:700; }
.terms-link{
  display:block; width:100%; text-align:center;
  border:none; background:none; padding:0; margin-top:8px;
  font-size:11.5px; font-weight:700; color:var(--text-tertiary);
  text-decoration:underline;
}

/* ---------- Terms & Conditions modal ---------- */
.terms-modal{
  position:fixed; inset:0; z-index:60;
  display:flex; align-items:center; justify-content:center;
  padding:20px;
  background:rgba(19,26,46,.55);
}
.terms-modal__panel{
  position:relative;
  width:100%; max-width:480px; max-height:80vh; overflow-y:auto;
  background:var(--surface);
  border-radius:var(--radius-md);
  box-shadow:var(--shadow-card);
  padding:28px 24px 24px;
  color:var(--text-primary);
}
.terms-modal__panel h2{
  margin:0 0 14px; padding-right:28px;
  font-size:16px; font-weight:800;
}
.terms-modal__close{
  position:absolute; top:14px; right:14px;
  display:flex; align-items:center; justify-content:center;
  width:28px; height:28px; border:none; border-radius:50%;
  background:var(--border); color:var(--text-secondary);
}
.terms-modal__list{
  margin:0; padding-left:20px;
  font-size:13.5px; line-height:1.6; color:var(--text-secondary);
}
.terms-modal__list li{ margin-bottom:10px; }
.terms-modal__footnote{
  margin:16px 0 0; font-size:12.5px; font-weight:600;
  color:var(--text-primary);
}

/* ---------- Toast ---------- */
.toast{
  position:fixed; left:50%; bottom:24px;
  transform:translate(-50%,12px);
  background:var(--ink); color:#fff;
  font-size:13px; font-weight:500;
  padding:12px 18px; border-radius:12px;
  max-width:88%; text-align:center;
  box-shadow:0 12px 30px -8px rgba(0,0,0,.4);
  opacity:0; pointer-events:none;
  transition:opacity .25s ease, transform .25s ease;
  z-index:50;
}
.toast.is-visible{ opacity:1; transform:translate(-50%,0); }

/* ---------- Motion & accessibility ---------- */
.page-shell :focus-visible{ outline:2px solid var(--accent-1); outline-offset:2px; }
@media (prefers-reduced-motion:reduce){
  .page-shell *{ animation-duration:.01ms !important; transition-duration:.01ms !important; }
}
@media (max-width:360px){
  .event-title{ font-size:22px; }
  .form-grid{ grid-template-columns:1fr; }
}

/* ---------- Laptop / desktop layout ----------
   1024px matches this app's own Tailwind `lg` breakpoint convention
   (there's no tailwind.config.js — Tailwind's default scale — even though
   this page's own component styles are hand-written CSS, not Tailwind
   utilities). Below this, everything above is the mobile layout: full-width
   single column, summary bar as a fixed bottom sheet. At and above it,
   #content becomes a two-column grid — ticket selection/details on the
   left, an always-visible sticky order-summary sidebar on the right,
   replacing the bottom sheet — so a laptop-width visitor gets a page
   actually laid out for that width, not a centered phone view. */
@media (min-width:1024px){
  .page-shell{ max-width:1120px; }

  .app-bar__title{ max-width:400px; }

  #content:not(.hidden){
    display:grid;
    grid-template-columns:1fr 380px;
    column-gap:32px;
    align-items:start;
    padding:0 24px;
  }
  .hero{ grid-column:1 / -1; height:280px; border-radius:24px; }
  .event-title{ font-size:34px; }

  main{ grid-column:1; padding:0; }

  /* Same #summaryBar element as the mobile bottom sheet — here it drops
     the fixed-position/slide-in-transform treatment entirely (a sidebar
     card has no "hidden" state to slide out of; it's just always present,
     including showing "0 tickets selected" before anything's picked) and
     becomes a normal, always-expanded sticky card instead. */
  .summary-bar{
    position:sticky; top:80px;
    grid-column:2;
    left:auto; bottom:auto;
    width:auto; max-width:none;
    border-top:none;
    border:1px solid var(--border);
    border-radius:20px;
    box-shadow:var(--shadow-card);
    padding-bottom:0;
    transform:none !important;
  }
  .summary-itemized{
    max-height:none !important;
    overflow:visible;
    padding:0 18px;
  }
  .summary-toggle{ pointer-events:none; cursor:default; }
  .summary-toggle__left svg{ display:none; }

  /* No fixed bottom sheet to clear anymore — the sidebar sits beside the
     form, not over it. */
  .bottom-spacer{ display:none; }
}
