/* Booking page, landing, privacy and login components. Colours come from themes.css. */

/* ---------- base ---------- */
:root { --radius: 16px; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background: var(--bg-glow) fixed, var(--bg); background-color: var(--bg);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .12s ease, background-color .2s, border-color .2s, box-shadow .2s; }
button:active:not(:disabled) { transform: scale(.97); }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.appear { animation: fadeUp .45s cubic-bezier(.2, .8, .2, 1) both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 7; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 640px; margin: 0 auto; padding: 12px 16px 10px; display: flex; align-items: center; gap: 10px; }
.shop { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.shop > div { min-width: 0; }
.shop h1, .brand-title {
  font-family: var(--font-display); font-size: 18px; line-height: 1.2; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--brand-fill); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.shop p { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-logo { height: 30px; max-width: 64px; object-fit: contain; flex: none; }
.back { border: 1px solid var(--card-border); background: var(--card); width: 40px; height: 40px; border-radius: 50%; font-size: 24px; line-height: 1; flex: none; color: var(--ink); }
.lang { display: inline-flex; border: 1px solid var(--card-border); border-radius: 999px; overflow: hidden; flex: none; background: var(--card); }
.lang button { border: 0; background: transparent; padding: 6px 11px; font-size: 13px; font-weight: 700; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

main { max-width: 640px; margin: 0 auto; padding: 16px; }
.loading { color: var(--muted); text-align: center; padding: 48px 0; }
h2 { font-size: 18px; margin: 0 0 12px; }
.hint { color: var(--muted); font-size: 14px; margin: -6px 0 12px; }

/* ---------- hero ---------- */
.hero-card {
  position: relative; overflow: hidden; display: flex; gap: 16px; align-items: center;
  border-radius: 22px; padding: 20px 18px; margin: 4px 0 16px; color: var(--hero-ink);
  background: var(--hero-bg); border: 1px solid var(--hero-border); box-shadow: var(--shadow);
}
.hero-card .hero-logo { width: 84px; height: 64px; object-fit: contain; flex: none; }
.monogram {
  flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: .02em;
  background: var(--accent-grad); color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft);
}
.hero-card h1 {
  font-family: var(--font-display); font-size: 26px; line-height: 1.15; letter-spacing: .03em;
  background: var(--title-fill); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-card .tagline { font-style: italic; color: var(--hero-sub); margin-top: 4px; font-size: 14px; }
.hero-card .lead { color: var(--hero-sub); margin-top: 6px; }
.hero-card .chip {
  display: inline-flex; gap: 6px; align-items: center; margin-top: 12px; padding: 6px 12px; border-radius: 999px;
  background: var(--hero-chip-bg); color: var(--hero-chip-ink); font-size: 13px; font-weight: 600; border: 1px solid var(--hero-chip-bg);
}

/* ---------- step tracker ---------- */
.stepper { position: sticky; top: 61px; z-index: 6; display: flex; gap: 6px; margin: 0 -16px 10px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); }
.stepper button { flex: 1; border: 0; background: none; padding: 0; text-align: left; color: var(--muted); font-size: 11px; font-weight: 700; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper button i { display: block; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 5px; overflow: hidden; position: relative; }
.stepper button i::after { content: ""; position: absolute; inset: 0; background: var(--accent-grad); transform: scaleX(0); transform-origin: left; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.stepper button.done { color: var(--ink); }
.stepper button.done i::after, .stepper button.now i::after { transform: scaleX(1); }
.stepper button.now { color: var(--accent); }
.stepper button:disabled { cursor: default; }

/* ---------- cards & choices ---------- */
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.flow .card { margin-bottom: 14px; scroll-margin-top: 120px; }
.card > h2 { font-size: 16px; }
.choice-list { display: grid; gap: 8px; }
.choice {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; min-height: 60px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink);
}
.choice:hover { border-color: var(--accent); }
.choice .ic {
  flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  border: 1.5px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 18px;
}
.choice .ic svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.choice .ic.round { border-radius: 50%; }
.choice .mid { flex: 1; min-width: 0; }
.choice .n { font-weight: 700; }
.choice .d { color: var(--muted); font-size: 13px; }
.choice .p { font-weight: 800; white-space: nowrap; }
.choice .tick { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-ink); color: var(--accent); display: none; place-items: center; font-size: 12px; font-weight: 900; }
.choice[aria-pressed="true"] { background: var(--accent-grad); color: var(--accent-ink); border-color: var(--accent); }
.choice[aria-pressed="true"] .d { color: inherit; opacity: .85; }
.choice[aria-pressed="true"] .ic { border-color: var(--accent-ink); background: rgba(255, 255, 255, .18); color: var(--accent-ink); }
.choice[aria-pressed="true"] .tick { display: grid; animation: pop .3s both; }
.choice[aria-pressed="true"] .p { margin-right: 18px; }

.datehead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.datehead h2 { margin: 0; }
.datehead .mo { font-weight: 800; font-size: 15px; }
.nav2 { display: flex; gap: 6px; align-items: center; }
.nav2 button { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-weight: 800; }
.dates { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 -2px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.date {
  flex: 0 0 auto; width: 70px; padding: 8px 0; text-align: center; border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--card); color: var(--ink); scroll-snap-align: start;
}
.date .tag { display: block; font-size: 9px; font-weight: 800; text-transform: uppercase; opacity: .85; min-height: 1.2em; }
.date .dow { display: block; font-size: 12px; opacity: .8; }
.date .day { display: block; font-size: 21px; font-weight: 800; line-height: 1.2; }
.date .mon { display: block; font-size: 11px; opacity: .8; }
.date:not(:disabled):hover { border-color: var(--accent); transform: translateY(-2px); }
.date[aria-pressed="true"] { background: var(--accent-grad); color: var(--accent-ink); border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.date:disabled { opacity: .35; cursor: default; background: transparent; }

.period { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 8px; }
.period:first-child { margin-top: 0; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot {
  padding: 11px 6px; min-height: 46px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font-weight: 700;
  opacity: 0; animation: fadeUp .35s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(var(--i, 0) * 22ms);
}
.slot:hover { border-color: var(--accent); }
.slot[aria-pressed="true"] { background: var(--accent-grad); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.empty { color: var(--muted); border: 1.5px dashed var(--line); border-radius: 14px; padding: 18px; text-align: center; background: transparent; }
.skel { border-radius: 14px; min-height: 60px; background: linear-gradient(90deg, var(--line) 25%, var(--card) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }

/* ---------- forms ---------- */
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
label small { font-weight: 400; color: var(--muted); }
input, textarea, select {
  font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 12px; width: 100%; min-height: 46px;
}
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
textarea { min-height: 72px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--accent); }
.error { color: var(--danger); font-size: 14px; }
.error:empty { display: none; }

.phone-field { display: flex; align-items: stretch; }
.phone-prefix { display: flex; align-items: center; padding: 0 12px; background: var(--accent-soft); border: 1.5px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; font-weight: 700; color: var(--ink2); }
.phone-field input { border-radius: 0 12px 12px 0; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.phone-field-wrap { display: grid; gap: 4px; }
.field-error { color: var(--danger); font-weight: 400; font-size: 13px; }
.field-error:empty { display: none; }

/* ---------- buttons ---------- */
.primary, .btn-ok {
  border: 1px solid var(--accent); border-radius: 12px; padding: 13px 20px; font-weight: 800; min-height: 46px;
  background: var(--accent-grad); color: var(--accent-ink); text-decoration: none; text-align: center;
}
.primary:disabled, .btn-ok:disabled { opacity: .45; cursor: default; }
.secondary, .btn-plain {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 12px; padding: 11px 16px; font-weight: 700; min-height: 44px; text-decoration: none; text-align: center;
}
.btn-danger { border: 1.5px solid var(--line); background: var(--card); color: var(--danger); border-radius: 12px; padding: 11px 16px; font-weight: 700; min-height: 44px; }
.full { width: 100%; display: block; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 700; font-size: 14px; text-decoration: underline; }

/* ---------- bottom summary bar ---------- */
.bar-sum {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--card-border); box-shadow: 0 -8px 24px rgba(0, 0, 0, .12);
  transform: translateY(110%); transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.bar-sum.on { transform: none; }
.bar-sum .in { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.bar-sum .txt { flex: 1; min-width: 0; font-size: 13px; line-height: 1.3; color: var(--muted); }
.bar-sum .txt b { display: block; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-sum .primary { flex: none; }

/* ---------- confirmation ---------- */
.done { text-align: center; }
.done .tickmark { width: 60px; height: 60px; border-radius: 50%; background: var(--ok-soft); display: grid; place-items: center; margin: 4px auto 10px; animation: pop .45s both; }
.done .tickmark svg { width: 30px; height: 30px; stroke: var(--ok); fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .25s ease forwards; }
.done h2 { font-size: 20px; margin-bottom: 6px; }
.code { font: 800 26px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; background: var(--bg); border: 1.5px dashed var(--line); border-radius: 12px; padding: 12px; margin: 12px 0 6px; color: var(--ink); }
.ticket { position: relative; margin: 14px 0 0; padding-top: 6px; border-top: 2px dashed var(--line); text-align: left; }
.ticket::before, .ticket::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 1px solid var(--card-border); }
.ticket::before { left: -27px; } .ticket::after { right: -27px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { text-align: right; font-weight: 700; }
.ref { font-family: ui-monospace, Menlo, monospace; font-size: 22px; font-weight: 700; letter-spacing: .08em; }
.stack { display: grid; gap: 10px; margin-top: 14px; }
.row2b { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wa {
  display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none;
  background: var(--wa); color: #fff; font-weight: 800; border-radius: 12px; padding: 14px; min-height: 48px;
}
.wa svg { width: 22px; height: 22px; }
.badge { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.muted { background: color-mix(in srgb, var(--line) 60%, transparent); color: var(--muted); }
.qr { display: block; width: 100%; max-width: 260px; margin: 8px auto; border-radius: 12px; background: #fff; padding: 8px; }
.bank { display: flex; gap: 8px; align-items: center; justify-content: space-between; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 8px; font-size: 14px; text-align: left; }
.upload { display: grid; gap: 10px; margin-top: 12px; text-align: left; }
.upload input[type=file] { padding: 10px; }
.privacy-line { margin-top: 4px; font-size: 13px; color: var(--muted); }
.privacy-line a { color: var(--accent); }
.again { text-align: center; margin-top: 14px; }
.again a, .again button { color: var(--accent); font-weight: 700; }

/* ---------- find my booking ---------- */
.manage { margin-top: 6px; }
.searchrow { display: flex; gap: 8px; align-items: flex-start; }
.searchrow > :first-child { flex: 1; min-width: 0; }
.searchrow .primary { flex: none; padding-inline: 16px; }
.res { display: grid; gap: 10px; margin-top: 12px; }
.res .item { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; animation: fadeUp .35s both; display: grid; gap: 8px; }
.res .when { font-weight: 800; }

/* ---------- dialogs & toast ---------- */
dialog { border: 1px solid var(--card-border); border-radius: 18px; padding: 18px; width: min(92vw, 460px); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .45); animation: fadeUp .25s both; }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog h3 { margin-bottom: 4px; font-size: 18px; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.modal-actions > * { flex: 1 1 auto; }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); translate: -50% 0; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 50; max-width: 90vw; text-align: center; animation: fadeUp .25s both; }

.env-banner { background: #7c3aed; color: #fff; text-align: center; font-size: 12px; font-weight: 700; padding: 4px 8px; letter-spacing: .02em; }
dialog { max-height: 88vh; overflow-y: auto; }
/* Keep the confirm button visible while scrolling through times. */
.modal-actions.sticky { position: sticky; bottom: -18px; margin: 14px -18px -18px; padding: 12px 18px 18px; background: var(--card); border-top: 1px solid var(--line); }
