/* Zouk Da Nang — order page
   Rules: sans-serif only, ONE font weight (400) everywhere, hierarchy via size/spacing/colour.
   Mobile-first; dark poster theme — the tokens below are the contract in plans/THEME.md.
   Text ON the gradient is always --bg (near-black): white on --accent-2 fails at 2.77:1.
   Small accent-coloured TEXT uses --accent-2 (7.2:1 on --bg, ~6.5:1 on --surface).
   --accent-1 is 4.78:1 on --bg but only ~4.3:1 on --surface, so it is used for links
   on --bg, focus rings, borders and strokes. */

:root {
  --bg:        #0B0809;  /* near-black, warm */
  --surface:   #1A1517;  /* cards, form panels, tab panels */
  --surface-2: #241C20;  /* raised / hover */
  --line:      #332A2E;  /* hairline borders */
  --text:      #F5F2F4;  /* off-white body + headings */
  --muted:     #B8B0B7;  /* secondary text */
  --accent-1:  #5B6CFF;  /* blue-violet, left end of the gradient */
  --accent-2:  #FF5FB8;  /* hot pink, right end of the gradient */
  --glow:      #7A3A78;  /* magenta radial, hero only */
  --grad: linear-gradient(90deg, #5B6CFF, #FF5FB8);

  --radius: 14px;
  --radius-sm: 10px;
  --pad: 20px;
  --gap: 12px;
  --maxw: 560px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
* { font-weight: 400 !important; } /* equal weights, no exceptions */

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 68px; background: var(--bg); color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, figure, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent-1); text-decoration: none; }
strong { color: var(--text); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; border-radius: 6px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 var(--pad); gap: 12px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease);
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar__brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 15px; letter-spacing: .01em; min-width: 0; }
.topbar__brand img { height: 38px; width: auto; flex: none; }
.topbar__cta {
  padding: 8px 16px; border-radius: 999px;
  background: var(--grad); color: var(--bg); font-size: 14px;
  transition: filter .2s var(--ease), transform .15s var(--ease);
}
.topbar__cta:hover { filter: brightness(1.1); }
.topbar__cta:active { transform: scale(.96); }
.topbar__cta:focus-visible { outline-color: var(--text); }

main, .footer { max-width: var(--maxw); margin: 0 auto; }

/* ---------- Hero ---------- */
.hero {
  padding: 40px var(--pad) 8px; text-align: center;
  /* soft magenta glow: peaks behind the hero photo, fades to nothing before the box edges */
  background: radial-gradient(closest-side at 50% 52%, color-mix(in srgb, var(--glow) 32%, transparent), transparent);
}
.eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.wordmark {
  margin-top: 12px;
  font-size: clamp(40px, 12vw, 64px);
  line-height: 1.02;
  letter-spacing: -.035em;
}
.tagline { margin-top: 8px; font-size: 18px; letter-spacing: .02em; color: var(--accent-2); }
.pitch { margin: 24px auto 0; max-width: 32ch; font-size: 17px; color: var(--muted); }
.hero .btn { margin-top: 24px; }

/* ---------- Asset slots (with placeholder fallback) ---------- */
/* Photos are white-on-white and are never tinted/filtered; the hairline frame
   makes them read as deliberate cards on the dark page. */
.slot {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.slot > img, .slot > video { width: 100%; height: 100%; object-fit: cover; }
.slot.is-missing { background: var(--surface-2); }
.slot.is-missing > img, .slot.is-missing > video { display: none; }
.slot.is-missing::before {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 40px; height: 34px; margin: -28px 0 0 -20px;
  /* minimal tee glyph */
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 34'%3E%3Cpath d='M13 0l-13 7 4 9 5-2v20h22V14l5 2 4-9-13-7c-1 3-4 5-7 5s-6-2-7-5z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 34'%3E%3Cpath d='M13 0l-13 7 4 9 5-2v20h22V14l5 2 4-9-13-7c-1 3-4 5-7 5s-6-2-7-5z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.slot.is-missing::after {
  content: attr(data-label);
  position: absolute; left: 12px; right: 12px; top: 50%; margin-top: 16px;
  text-align: center; font-size: 13px; color: var(--muted);
}
.slot--hero  { margin-top: 28px; aspect-ratio: 4 / 5; }
.slot--photo { aspect-ratio: 4 / 5; }
/* single frame: the .slot's own --line border + --radius; the video fills and is clipped by it */
.slot--video { aspect-ratio: 9 / 16; background: var(--surface); }
.slot--video.is-missing { background: var(--surface-2); }
/* QR: the image file is untouched. It is a 655×1280 bank screenshot; the window below
   shows only its light "ticket" (x108–547, y262–906: QR + account name/number), inset
   2px per edge (x110–545, y264–904 = 435×640) so the anti-aliased ticket edge, which
   blends into the violet frame, never shows. The QR (white x≈160–495, y≈340–673) and the
   account text (y≈780–870) sit well inside that window, quiet zone included.
   --qr-r (the clip radius) is >= the ticket's own corner (~40 source px ≈ 31px at the
   340px max width), so no violet shows in the corners; the card radius is concentric. */
.slot--qr {
  width: 100%; aspect-ratio: 435 / 640; flex: none;
  border: 0; border-radius: var(--qr-r); background: #fff;
}
.slot--qr > img {
  position: absolute; max-width: none;
  width: calc(655 / 435 * 100%); height: auto;
  left: calc(-110 / 435 * 100%); top: calc(-264 / 640 * 100%);
}
.slot--qr.is-missing { background: var(--surface-2); border: 1px solid var(--line); }
.slot--logo  { aspect-ratio: 944 / 830; background: transparent; border: 0; }
.slot--logo > img { object-fit: contain; }

/* ---------- Sections ---------- */
.section { padding: 40px var(--pad) 0; }
.section__title {
  display: flex; align-items: center; gap: 10px;
  font-size: 22px; line-height: 1.25; letter-spacing: -.01em;
  margin-bottom: 16px;
}
.subhead { margin: 32px 0 12px; font-size: 17px; color: var(--text); }
.step {
  display: inline-grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--grad); color: var(--bg); font-size: 14px; /* near-black on gradient, as buttons: 5.03–7.58:1 */
}
.note { margin-top: 12px; font-size: 15px; color: var(--muted); }
.note--muted { font-size: 14px; color: var(--muted); }
.accent { color: var(--accent-2); }

/* ---------- Tabs ---------- */
.tabs {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 4px; margin-bottom: 16px;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
}
.tabs__tab {
  position: relative; z-index: 1;
  min-height: 44px; border: 0; background: none; cursor: pointer;
  border-radius: 999px; color: var(--muted); font-size: 15px;
  transition: color .2s var(--ease);
}
.tabs__tab[aria-selected="true"] { color: var(--text); }
.tabs__ink {
  position: absolute; top: 4px; bottom: 4px; left: 4px;
  width: calc((100% - 8px) / 3);
  background: var(--surface-2); border: 2px solid var(--accent-1); border-radius: 999px;
  /* selected: raised fill + violet border + soft halo; inactive tabs have no fill */
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-1) 22%, transparent);
  transition: transform .35s var(--ease);
}
.tabpanel {
  display: grid; gap: var(--gap); padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 8px);
  animation: fade-in .35s var(--ease);
}
.tabpanel[hidden] { display: none; }
.tabpanel > .note { margin: 4px 8px 8px; }

.print-card {
  padding: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.print-card__label { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.print-card__front { display: grid; gap: 4px; padding: 20px 8px; text-align: center; }
.print-card__name { font-size: 28px; letter-spacing: -.02em; }
.print-card__tag  { font-size: 15px; color: var(--accent-2); letter-spacing: .02em; }
.print-card .slot--logo { max-width: 260px; margin: 0 auto; }

/* ---------- Video strip ---------- */
.video-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: 62%;
  gap: var(--gap);
  margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad) 8px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--pad);
  scrollbar-width: none;
}
.video-strip::-webkit-scrollbar { display: none; }
/* scroll cue: the next card peeks in and fades out at the right edge; app.js adds
   .is-end once scrolled to the last card so the fade lifts */
.video-strip {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 64px), transparent);
          mask-image: linear-gradient(90deg, #000 calc(100% - 64px), transparent);
}
.video-strip.is-end { -webkit-mask-image: none; mask-image: none; }
.video-card { scroll-snap-align: start; min-width: 0; }
.video-card figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }

/* ---------- Segmented size control ---------- */
.seg {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  margin: 0; padding: 0; border: 0; min-width: 0;
}
.seg__opt { position: relative; display: block; }
.seg__opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg__opt span {
  display: grid; place-items: center;
  min-height: 56px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 16px; color: var(--text);
  transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease), transform .25s var(--ease-pop);
  pointer-events: none;
}
.seg__opt:hover span { border-color: var(--accent-1); }
.seg__opt input:checked + span {
  border-color: transparent; background: var(--grad); color: var(--bg);
  animation: pop .3s var(--ease-pop);
}
.seg__opt input:focus-visible + span { outline: 2px solid var(--accent-1); outline-offset: 2px; }
/* the palette has no error red: hot pink (7.2:1 on --bg) carries error states */
.seg.is-invalid .seg__opt span { border-color: var(--accent-2); }
.field-error { margin-top: 8px; font-size: 14px; color: var(--accent-2); }

@media (min-width: 480px) {
  .seg { grid-template-columns: repeat(3, 1fr); } /* 6 sizes: 2×3 on mobile, 3×2 here — never an orphan */
  .seg__opt span { padding: 0 4px; font-size: 15px; }
}

/* ---------- Quantity + price ---------- */
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.stepper {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px;
  background: var(--surface);
}
.stepper__btn {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface-2); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
.stepper__btn:hover { border-color: var(--accent-1); }
.stepper__btn:active { transform: scale(.9); }
/* at the min/max the button stays legible (glyph --text on --surface-2); only the cursor + hover change */
.stepper__btn:disabled { cursor: default; transform: none; border-color: var(--line); }
.stepper__input {
  width: 48px; border: 0; background: none; color: var(--text); text-align: center; font-size: 18px;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.price { display: grid; text-align: right; }
.price__each { font-size: 14px; color: var(--muted); }
.price__total { font-size: 15px; color: var(--muted); }
.price__total strong { display: inline-block; font-size: 22px; color: var(--text); margin-left: 4px; }
.bump { animation: bump .3s var(--ease-pop); }

/* ---------- Fields ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 14px; color: var(--text); }
.optional { color: var(--muted); }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font-size: 16px; /* 16px stops iOS zoom */
  -webkit-appearance: none; appearance: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.field input:hover, .field textarea:hover { border-color: color-mix(in srgb, var(--line) 50%, var(--muted)); }
.field textarea { resize: vertical; min-height: 96px; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent-1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-1) 40%, transparent);
}
/* keep browser autofill from repainting the field light */
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 100px var(--surface-2) inset;
  caret-color: var(--text);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--accent-2); }

/* ---------- Payment ---------- */
.pay { display: grid; gap: 16px; }
.qr-card {
  --qr-pad: 8px; --qr-r: 36px;
  justify-self: center; display: grid; justify-items: center; gap: 10px;
  width: min(100%, 358px); /* 358 = 340 QR window + 2×8 padding + 2×1 border */
  padding: var(--qr-pad) var(--qr-pad) 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: calc(var(--qr-r) + var(--qr-pad)); /* outer = inner + padding: concentric */
}
.qr-card__caption { font-size: 13px; color: var(--muted); }
.pay__text { display: grid; gap: 8px; font-size: 15px; color: var(--muted); min-width: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px; border-radius: 999px; border: 1px solid transparent;
  font-size: 16px; cursor: pointer;
  transition: background .2s var(--ease), filter .2s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn--primary {
  background: var(--grad); color: var(--bg); /* near-black on gradient: 5.03–7.58:1 */
  box-shadow: none; /* no default glow; the ring is painted on :focus-visible only */
}
.btn--primary:hover { filter: brightness(1.1); }
.btn--primary:focus:not(:focus-visible) { outline: none; }
.btn--primary:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.btn--ghost { background: transparent; color: var(--accent-1); border-color: var(--accent-1); min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--block { width: 100%; }
/* Zalo / WhatsApp chat buttons: --text on --surface-2 (~14.9:1); Zalo blue only on the icon stroke (non-text) */
.chat { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.chat--center { justify-content: center; margin-top: 20px; }
.btn--chat {
  gap: 8px; min-height: 48px; padding: 0 20px; font-size: 15px;
  background: var(--surface-2); color: var(--text); border-color: var(--line); border-radius: var(--radius-sm);
}
.btn--chat:hover { border-color: var(--accent-1); }
.btn--chat:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; border-radius: var(--radius-sm); }
.btn--chat-sm { min-height: 44px; padding: 0 16px; font-size: 14px; }
.chat__icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.chat__icon--zalo { stroke: #0068FF; }
.chat__num { margin-top: 6px; font-size: 13px; color: var(--muted); }
.chat--center + .chat__num { text-align: center; }
.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }
.section--submit { padding-top: 32px; text-align: center; }

/* ---------- Confirmation ---------- */
.confirm { padding: 48px var(--pad) 8px; text-align: center; animation: rise .5s var(--ease); }
.confirm:focus { outline: none; }
.confirm .section__title { justify-content: center; margin: 16px 0 8px; }
.confirm > p { color: var(--muted); }
.confirm__ref {
  display: inline-block; margin: 8px 0 20px; padding: 10px 18px;
  border-radius: var(--radius-sm); background: var(--grad); color: var(--bg) !important;
  font-size: 22px; letter-spacing: .04em; font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.confirm__summary {
  display: grid; grid-template-columns: auto 1fr; gap: 8px 16px;
  max-width: 340px; margin: 0 auto; padding: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-align: left; font-size: 15px;
}
.confirm__summary dt { color: var(--muted); }
.confirm__summary dd { text-align: right; overflow-wrap: anywhere; }
.confirm__actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.confirm__tick { width: 64px; height: 64px; margin: 0 auto; }
.confirm__tick svg { width: 100%; height: 100%; fill: none; stroke: var(--accent-2); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.confirm__tick circle { stroke: var(--accent-1); stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .6s var(--ease) forwards; }
.confirm__tick path { stroke-dasharray: 36; stroke-dashoffset: 36; animation: draw .4s .45s var(--ease) forwards; }

/* ---------- Footer ---------- */
.footer {
  margin-top: 64px; padding: 40px var(--pad) calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); text-align: center;
}
.footer__logo { width: 56px; height: auto; margin: 0 auto 12px; }
.footer__brand { font-size: 17px; }
.footer__tag { font-size: 14px; color: var(--accent-2); }
.chat--footer { margin-top: 16px; }
.footer__small { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@keyframes pop   { 0% { transform: scale(1); } 45% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes bump  { 0% { transform: translateY(0); } 40% { transform: translateY(-3px); } 100% { transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes draw  { to { stroke-dashoffset: 0; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.shake { animation: shake .3s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
