/* Bảng màu thương hiệu bắt buộc */
:root {
  --brand-dark: #084B55;     /* tiêu đề, chữ chính, nút chính, nền logo */
  --brand-deep: #063C44;     /* đáy gradient của dải logo */
  --brand-primary: #35B4C2;  /* điểm nhấn, viền */
  --brand-mint: #8DE0E2;     /* nền phụ, sao đã chọn */
  --brand-ice: #E7F8F9;      /* nền trang, nền thẻ */
  --surface: #FFFFFF;
  --page: #F3FAFB;
  --text: #084B55;
  --text-soft: #2F6770;      /* 6,37:1 trên trắng */
  --line: #4F949C;           /* viền ô nhập: 3,47:1 (WCAG 1.4.11) */
  --hair: #DCEFF1;
  --error: #A3262A;
  --ok: #0B6B4F;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(8, 75, 85, .05), 0 10px 30px rgba(8, 75, 85, .08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.55; color: var(--text); background: var(--page); overflow-x: hidden; }
img, svg { max-width: 100%; }
a { color: var(--brand-dark); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--brand-primary); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .4em; color: var(--brand-dark); letter-spacing: -.01em; }
h1 { font-size: 1.32rem; }
h2 { font-size: 1.18rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .7em; }
.wrap { max-width: 520px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--text-soft); }
.small { font-size: .9rem; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.demo-bar { background: #FFF6E0; color: #5A3E00; text-align: center; font-size: .85rem; font-weight: 600; padding: 7px 16px; }
.inapp-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--brand-ice); color: var(--brand-dark); font-size: .85rem; padding: 8px 16px; }

/* Dải logo: logo chính thức là bản chữ trắng nên đặt trên nền màu thương hiệu */
.hero {
  color: #fff; text-align: center;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 0 74px;
  background:
    radial-gradient(120% 80% at 85% -10%, rgba(53, 180, 194, .45) 0%, rgba(53, 180, 194, 0) 60%),
    radial-gradient(90% 70% at -10% 110%, rgba(141, 224, 226, .18) 0%, rgba(141, 224, 226, 0) 60%),
    linear-gradient(165deg, var(--brand-dark) 0%, var(--brand-deep) 100%);
  border-radius: 0 0 32px 32px;
}
.hero-logo { display: inline-block; width: min(88%, 360px); }
.hero-logo img { display: block; width: 100%; height: auto; }
.slogan { margin: 18px 0 0; font-size: 1.55rem; font-weight: 700; letter-spacing: .01em; color: #fff; }

.main { margin-top: -50px; padding-bottom: 8px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--hair); padding: 22px 18px; margin-bottom: 16px; }

/* Nút */
.btn {
  appearance: none; border: 0; background: var(--brand-dark); color: #fff;
  font: inherit; font-weight: 700; font-size: 1.05rem; line-height: 1.2;
  min-height: 56px; padding: 14px 22px; border-radius: 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: transform .12s ease, background .15s ease, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn.block { width: 100%; }
.chip { appearance: none; font: inherit; font-size: .85rem; font-weight: 600; color: var(--brand-dark); background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 14px; min-height: 36px; cursor: pointer; }

/* Đánh giá sao */
.rate-card { text-align: center; padding: 26px 18px 22px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.stars { display: flex; justify-content: center; gap: 6px; margin: 18px 0 4px; }
.star { position: relative; width: 58px; height: 58px; display: grid; place-items: center; cursor: pointer; border-radius: 16px; transition: transform .12s ease; }
.star input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.star svg { width: 46px; height: 46px; }
.star svg path { fill: #fff; stroke: var(--line); stroke-width: 1.4; transition: fill .12s, stroke .12s; }
.star.on svg path { fill: var(--brand-primary); stroke: var(--brand-dark); }
.star:has(input:focus-visible) { outline: 3px solid var(--brand-primary); }
.star:active { transform: scale(.92); }
.rate-label { min-height: 1.6em; font-weight: 700; font-size: 1.05rem; margin: 6px 0 16px; }
.done { text-align: center; padding: 8px 0 4px; }
.done-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--brand-ice); border: 2px solid var(--brand-mint); margin-bottom: 10px; }
.done-icon::after { content: ""; width: 22px; height: 12px; border-left: 4px solid var(--brand-dark); border-bottom: 4px solid var(--brand-dark); transform: rotate(-45deg) translate(2px, -2px); }
.link-more { display: inline-block; margin-top: 6px; font-weight: 700; text-decoration: none; padding: 10px 14px; }

/* Danh sách kết nối */
.section-title { font-size: 1.1rem; margin: 22px 4px 10px; }
.link-list { padding: 6px; }
.link-row { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 12px; border-radius: 16px; text-decoration: none; color: var(--brand-dark); }
.link-row + .link-row { border-top: 1px solid var(--hair); }
.link-row:active { background: var(--brand-ice); }
.link-icon { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-ice); color: var(--brand-dark); }
.link-icon svg { width: 24px; height: 24px; }
.link-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.link-title { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.link-sub { font-size: .86rem; color: var(--text-soft); line-height: 1.35; }
.link-go { flex: none; color: var(--brand-primary); }
.link-go svg { width: 20px; height: 20px; }
.opened { font-size: .78rem; font-weight: 700; color: var(--ok); }

/* Mã & quà */
.code-row { display: flex; gap: 8px; }
input[type=text] { width: 100%; font: inherit; color: var(--text); background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; min-height: 56px; }
.code-input { font-size: 1.2rem; letter-spacing: .14em; text-transform: uppercase; text-align: center; font-weight: 700; }
.msg { border-radius: var(--radius-sm); padding: 12px 14px; margin: 12px 0 0; font-size: .95rem; text-align: left; }
.msg.ok { background: #E3F6EF; color: var(--ok); }
.msg.err { background: #FBECEC; color: var(--error); }
.msg.info { background: var(--brand-ice); color: var(--brand-dark); }
.wheel-box { position: relative; width: min(100%, 320px); margin: 8px auto 6px; aspect-ratio: 1; }
.wheel { width: 100%; height: 100%; transition: transform 2.6s cubic-bezier(.17, .67, .21, 1); will-change: transform; }
.wheel-pointer { position: absolute; left: 50%; top: -4px; transform: translateX(-50%); width: 34px; height: 40px; z-index: 2; }
.remaining { text-align: center; font-size: 1.1rem; font-weight: 700; margin: 4px 0 10px; }
.legend { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.legend .sw { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--brand-primary); flex: none; }
.legend .sw svg { width: 20px; height: 20px; }
.legend .share { margin-left: auto; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.gift { border: 2px solid var(--brand-primary); border-radius: var(--radius); padding: 16px; }
.gift + .gift { margin-top: 12px; }
.gift-top { display: flex; gap: 12px; align-items: center; }
.icon-circle { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--brand-ice); display: grid; place-items: center; }
.icon-circle svg { width: 24px; height: 24px; }
.gift-name { font-weight: 800; font-size: 1.05rem; }
.claim-code { font-size: 1.6rem; font-weight: 800; letter-spacing: .14em; font-variant-numeric: tabular-nums; margin: 6px 0; }
.status { display: inline-block; font-size: .82rem; font-weight: 700; border-radius: 999px; padding: 3px 12px; background: var(--brand-ice); }
.status.delivered { background: #E3F6EF; color: var(--ok); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 10px 0 0; font-size: .92rem; }
dl.kv dt { color: var(--text-soft); }
dl.kv dd { margin: 0; }

/* Chân trang */
.footer { padding: 18px 0 calc(28px + var(--safe-b)); text-align: center; color: var(--text-soft); }
.foot-links { display: flex; justify-content: center; gap: 6px 20px; flex-wrap: wrap; margin-bottom: 6px; }
.foot-links a { font-size: .9rem; padding: 8px 2px; color: var(--text-soft); }

/* Trang văn bản */
.doc-hero { padding-bottom: 40px; }
.doc { margin-top: -26px; }
.doc .card h2 { margin-top: 1.2em; }
.doc .card h2:first-child { margin-top: 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.doc th, .doc td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.doc ul { padding-left: 1.2em; }

@media (max-width: 360px) {
  .star { width: 52px; height: 52px; }
  .star svg { width: 42px; height: 42px; }
  .stars { gap: 2px; }
  .slogan { font-size: 1.4rem; }
}
@media (min-width: 600px) {
  .hero { border-radius: 0 0 40px 40px; }
  .card { padding: 26px 26px; }
}
h1, h2, .slogan { text-wrap: balance; }
.code-row .btn { flex: none; white-space: nowrap; padding: 0 20px; }
.code-row input { flex: 1; min-width: 0; }
