:root {
  --butter: #FFE79A;
  --butter-hi: #FFF4C9;
  --paper: #FFFCF3;
  --ink: #2B1D10;
  --ink-2: #6A5842;
  --line: #E6D6A6;
  --gold-a: #FFC93C;
  --gold-b: #FF9A1F;
  --ok: #14804F;
  --err: #B8312B;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--butter);
  background-image: radial-gradient(1100px 560px at 10% -8%, var(--butter-hi), transparent 62%);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: inherit; }
:focus-visible { outline: 3px solid #6B3E00; outline-offset: 2px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px 48px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Header */
.top { display: flex; justify-content: space-between; align-items: center; padding: 22px 0 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; text-decoration: none; }
.brand-ring { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(from 210deg, #FFE27A, var(--gold-b), #FFF0AE, var(--gold-a), #FFE27A); box-shadow: inset 0 0 0 6px var(--butter); outline: 2px solid var(--ink); outline-offset: -2px; }
.top nav a { font-weight: 600; font-size: .95rem; text-decoration: none; padding: 8px 2px; border-bottom: 2px solid transparent; }
.top nav a:hover { border-bottom-color: var(--ink); }

/* Type */
h1 { margin: 0 0 16px; font-size: clamp(2.5rem, 6.4vw, 4.4rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 800; text-wrap: balance; }
.h1-sm { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 10px; }
h2 { margin: 0 0 20px; font-size: 1.5rem; letter-spacing: -0.02em; font-weight: 700; }
h3 { margin: 0 0 6px; font-size: 1rem; }
.lede { font-size: 1.125rem; color: var(--ink-2); max-width: 46ch; margin: 0 0 28px; }
.fine { font-size: .85rem; color: var(--ink-2); margin: 8px 0 0; }
.hint { font-size: .9rem; color: var(--ink-2); margin: 10px 0 0; max-width: 62ch; }
.opt { font-weight: 400; color: var(--ink-2); }
.section { padding: 28px 0; }
.narrow { max-width: 640px; }
.back { margin: 18px 0 0; font-size: .9rem; }

/* Hero */
.hero > * { min-width: 0; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; padding: 32px 0 40px; }
label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 8px; }
.field { display: flex; align-items: center; gap: 6px; background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; padding: 6px 6px 6px 16px; }
.field .at { font-weight: 800; font-size: 1.2rem; color: var(--ink-2); }
.field input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1.1rem; padding: 12px 6px; color: var(--ink); }
.field input:focus-visible { outline: none; }
.field:focus-within { box-shadow: 0 0 0 4px rgba(43, 29, 16, .18); }
.field button, .cta { appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 700; background: var(--ink); color: var(--butter); padding: 13px 22px; border-radius: 11px; text-decoration: none; display: inline-block; text-align: center; }
.field button:hover, .cta:hover { background: #46301b; }
.field button:disabled, .cta:disabled { opacity: .45; cursor: not-allowed; }
input.plain { width: 100%; font: inherit; font-size: 1rem; padding: 13px 14px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); color: var(--ink); }

/* Vòng avatar Gold: điểm nhấn chính của trang */
.ring-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ring { position: relative; width: min(300px, 70vw); aspect-ratio: 1; border-radius: 50%; }
.ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 210deg, #FFE27A, var(--gold-b), #FFF0AE, var(--gold-a), #FFE27A); opacity: 0; }
.ring.is-idle { border: 3px dashed #B79B5A; }
.ring.is-live::before { opacity: 1; animation: sweep .9s cubic-bezier(.2, .8, .2, 1); }
.ring-core { position: absolute; inset: 10px; border-radius: 50%; background: var(--paper); overflow: hidden; display: grid; place-items: center; }
.ring.is-idle .ring-core { inset: 0; background: transparent; }
.ring-core img { width: 100%; height: 100%; object-fit: cover; }
.ring-ph { font-size: 5.5rem; font-weight: 800; color: #B79B5A; line-height: 1; }
.ring.is-live .ring-ph { color: var(--ink); font-size: 4.5rem; }
.ring-name { margin: 0; min-height: 3em; text-align: center; font-weight: 700; font-size: 1.1rem; line-height: 1.3; }
.ring-name small { display: block; font-weight: 500; color: var(--ink-2); font-size: .95rem; }
@keyframes sweep { from { transform: rotate(-200deg); opacity: 0; } to { transform: rotate(0); opacity: 1; } }

/* Gói: như những tấm ảnh in */
.prints { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 26px 22px; padding: 6px 4px; }
.print { position: relative; display: block; margin: 0; cursor: pointer; background: var(--paper); padding: 12px 12px 16px; border-radius: 6px; box-shadow: 0 1px 0 rgba(43, 29, 16, .08), 0 18px 28px -20px rgba(43, 29, 16, .6); transform: rotate(-1deg); transition: transform .18s ease, box-shadow .18s ease; font-weight: 400; }
.print:nth-child(even) { transform: rotate(.8deg); }
.print input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.print:has(input:checked) { transform: rotate(0) translateY(-6px); box-shadow: 0 0 0 3px var(--ink), 0 22px 32px -18px rgba(43, 29, 16, .7); }
.print:has(input:focus-visible) { outline: 3px solid #6B3E00; outline-offset: 4px; }
.print-photo { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; position: relative; aspect-ratio: 4 / 3; padding: 14px 16px; border-radius: 3px; background: linear-gradient(155deg, #FFD866, var(--gold-b)); }
.print-num { font-size: 3.6rem; font-weight: 800; letter-spacing: -0.05em; line-height: .95; }
.print-unit { font-weight: 700; font-size: 1.05rem; }
.print-badge { position: absolute; top: 10px; right: 10px; background: var(--ink); color: var(--butter); font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.print-cap { display: block; padding: 14px 4px 0; }
.print-name { display: block; font-weight: 700; }
.print-feat { display: block; margin: 6px 0 0; font-size: .875rem; color: var(--ink-2); }
.print-feat span { display: block; padding-left: 14px; position: relative; }
.print-feat span::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-b); }
.print-price { display: block; margin-top: 12px; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; }
.print-out { display: block; font-size: .85rem; color: var(--err); font-weight: 600; }
.print.is-out { opacity: .55; cursor: not-allowed; }
.print.is-out input { cursor: not-allowed; }
.empty { color: var(--ink-2); }

/* Thanh toán, tóm tắt */
.checkout { max-width: 640px; background: var(--paper); border: 2px solid var(--ink); border-radius: 20px; padding: 24px; display: grid; gap: 18px; }
.sum { margin: 0; display: grid; gap: 8px; }
.sum > div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.sum dt { color: var(--ink-2); }
.sum dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.sum .total { border-bottom: 0; padding-bottom: 0; font-size: 1.2rem; }
.sum .total dd { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; }
.cta { font-size: 1.05rem; padding: 15px 26px; }
.checkout .cta { width: 100%; }

/* Thông báo */
.msg { margin: 16px 0; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--ink); background: var(--paper); font-weight: 500; }
.msg.err { border-color: var(--err); color: #7d1f1a; background: #FFF0EC; }
.msg.ok { border-color: var(--ok); color: #0c5a37; background: #ECF8F1; }
.msg.wait { display: flex; gap: 12px; align-items: center; }
.hint.err { color: var(--err); font-weight: 600; }
.hint.ok { color: var(--ok); font-weight: 600; }
.spin { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--ink); border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Trang đơn */
.card { background: var(--paper); border: 2px solid var(--ink); border-radius: 18px; padding: 20px; margin: 18px 0; }
.pill { display: inline-block; margin: 0 0 4px; padding: 4px 14px; border-radius: 99px; font-weight: 700; font-size: .9rem; border: 2px solid var(--ink); background: var(--paper); }
.pill-completed { background: #ECF8F1; border-color: var(--ok); color: var(--ok); }
.pill-failed, .pill-cancelled { background: #FFF0EC; border-color: var(--err); color: var(--err); }
.pill-paid, .pill-processing { background: #FFF4C9; }
.pay { display: grid; grid-template-columns: 250px 1fr; gap: 26px; align-items: start; }
.pay-qr img { display: block; width: 100%; max-width: 250px; height: auto; border-radius: 10px; background: #fff; }
.kv { margin: 0; display: grid; gap: 10px; }
.kv > div { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.kv dt { font-size: .85rem; color: var(--ink-2); }
.kv dd { margin: 2px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
.kv .must dd .code { font-size: 1.4rem; letter-spacing: .08em; font-weight: 800; }
.kv .must { border-bottom: 0; background: var(--butter-hi); border-radius: 10px; padding: 10px 12px; }
.copy { appearance: none; border: 2px solid var(--ink); background: transparent; color: var(--ink); font: inherit; font-weight: 600; font-size: .85rem; padding: 5px 12px; border-radius: 99px; cursor: pointer; flex: none; }
.copy:hover { background: var(--butter); }
.copy.lg { font-size: 1rem; padding: 13px 22px; border-radius: 11px; }
.copy.is-done { background: var(--ok); border-color: var(--ok); color: #fff; }
.done h2 { margin-bottom: 8px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
.guide { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.guide p { margin: 0; color: var(--ink-2); }

/* FAQ */
.faq { max-width: 720px; }
.faq details { border-top: 1px solid var(--ink); padding: 14px 0; }
.faq details:last-child { border-bottom: 1px solid var(--ink); }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 8px 0 0; color: var(--ink-2); max-width: 60ch; }

.foot { margin-top: 36px; padding-top: 20px; border-top: 2px solid var(--ink); }
.foot p { margin: 0 0 6px; }
.foot a { font-weight: 700; }

@media (max-width: 760px) {
  .print-photo { aspect-ratio: 16 / 7; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 12px; }
  .ring-stage { order: -1; align-items: flex-start; flex-direction: row; gap: 16px; }
  .ring { width: 120px; flex: none; }
  .ring-ph { font-size: 2.6rem; }
  .ring.is-live .ring-ph { font-size: 2.2rem; }
  .ring-core { inset: 6px; }
  .ring-name { text-align: left; align-self: center; min-height: 0; }
  .pay { grid-template-columns: 1fr; }
  .pay-qr img { margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .ring.is-live::before, .spin { animation: none; }
  .print { transition: none; }
}
