/* Trà Sâm Trường Nhân — hệ thiết kế
   Bố cục: nền trắng, dải xanh teal của thương hiệu làm điểm nhấn, gạch vàng ngắn dưới tiêu đề như website Trường Nhân. */
:root {
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --hdr: rgba(255, 255, 255, .94);
  --surface: #F5F8F6;
  --mint: #E7F1EA;
  --mint-2: #CFE3D5;
  --teal: #3E6B69;
  --teal-d: #2C5250;
  --gold: #E0A43A;
  --gold-t: #A86E14;
  --ink: #1E2B2A;
  --muted: #5B6B68;
  --line: #E1EAE6;
  --tea: #C98A2B;
  --danger: #B42318;
  --ok: #1E7B4E;
  --shadow: 0 18px 40px -24px rgba(30, 60, 58, .35);
  --r: 18px;
  --f: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-script: "Dancing Script", "Brush Script MT", cursive;
  --gl: max(16px, env(safe-area-inset-left, 0px));
  --gr: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box }
html { scroll-behavior: smooth }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--f); -webkit-font-smoothing: antialiased }
img { max-width: 100%; display: block }
a { color: inherit }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; text-wrap: balance; font-weight: 700 }
p { margin: 0 }
button, input, select, textarea { font: inherit; color: inherit }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px }
[hidden] { display: none !important }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: var(--gl); padding-right: var(--gr) }
.section { padding-block: 88px }
.section.tight { padding-block: 56px }
.section.surface { background: var(--surface) }
.section.teal { background: var(--teal); color: #fff }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-t) }
.teal .eyebrow { color: #F3C979 }
.title { font-size: clamp(1.9rem, 3.6vw, 2.9rem); text-transform: uppercase; color: var(--teal); letter-spacing: .01em }
.teal .title { color: #fff }
.title-bar::after { content: ""; display: block; width: 64px; height: 3px; background: var(--gold); border-radius: 2px; margin-top: 18px }
.center { text-align: center }
.center.title-bar::after, .center .title-bar::after { margin-left: auto; margin-right: auto }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 40em }
.teal .lead { color: #DCE9E4 }
.head { display: grid; gap: 12px; margin-bottom: 40px }
.head.center { justify-items: center }
.script { font-family: var(--f-script); font-weight: 600; color: var(--gold-t); font-size: 1.9rem; line-height: 1 }
.muted { color: var(--muted) }
.small { font-size: .85rem }
.note { font-size: .8rem; color: var(--muted) }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55em; padding: .9em 1.5em; border-radius: 999px; border: 1.5px solid var(--teal); background: var(--teal); color: #fff; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .25s cubic-bezier(.22, 1, .36, 1), background .2s, box-shadow .25s; line-height: 1.1 }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -14px rgba(44, 82, 80, .8) }
.btn.ghost { background: transparent; color: var(--teal) }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #2A1E05 }
.btn.light { background: #fff; border-color: #fff; color: var(--teal) }
.btn.small { padding: .6em 1.05em; font-size: .9rem }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none }
.link { color: var(--teal); font-weight: 600; text-decoration: none; border-bottom: 1.5px solid var(--gold) }

/* header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--hdr); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line) }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg) }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 76px }
.logo { display: flex; align-items: center; text-decoration: none; flex: none }
.logo img { height: 54px; width: auto }
.nav { display: flex; gap: 6px; margin-left: auto }
.nav a { text-decoration: none; font-weight: 500; padding: 10px 12px; border-radius: 10px; position: relative; color: var(--ink) }
.nav a:hover { color: var(--teal) }
.nav a[aria-current="page"] { color: var(--teal); font-weight: 600 }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2.5px; background: var(--teal); border-radius: 2px }
.tools { display: flex; align-items: center; gap: 8px }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; text-decoration: none; color: var(--teal); cursor: pointer }
.icon-btn.solid { background: var(--teal); border-color: var(--teal); color: #fff }
.icon-btn svg { width: 22px; height: 22px }
.badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--gold); color: #2A1E05; font-size: .72rem; font-weight: 700; display: grid; place-items: center }
.user-chip { font-size: .85rem; font-weight: 600; color: var(--teal); max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.menu-btn { display: none }
@media (max-width: 1000px) {
  .nav { position: fixed; inset: 76px 0 auto 0; flex-direction: column; background: var(--card); border-bottom: 1px solid var(--line); padding: 8px var(--gr) 16px var(--gl); gap: 0; transform: translateY(-120%); transition: transform .35s cubic-bezier(.22, 1, .36, 1); box-shadow: var(--shadow) }
  .nav.open { transform: none }
  .nav a { padding: 14px 4px; border-bottom: 1px solid var(--line) }
  .nav a[aria-current="page"]::after { display: none }
  .menu-btn { display: grid }
  .tools { margin-left: auto }
  .user-chip { display: none }
}
@media (max-width: 420px) { .logo img { height: 44px } .site-header .wrap { gap: 10px } .icon-btn { width: 40px; height: 40px } }

/* footer */
.site-footer { background: var(--teal-d); color: #E4EEEA; padding-block: 56px 32px; margin-top: 0 }
.site-footer .cols { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px }
.site-footer h4 { color: #fff; font-size: 1.05rem; margin-bottom: 14px }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px }
.site-footer li::before { content: "•"; color: var(--gold); margin-right: 8px }
.site-footer a { text-decoration: none }
.site-footer a:hover { color: #fff; text-decoration: underline }
.site-footer .flogo { height: 70px; width: auto; filter: brightness(0) invert(1); margin-bottom: 14px }
.site-footer .legal { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 36px; padding-top: 20px; font-size: .8rem; color: #B9CEC7; display: grid; gap: 6px }
@media (max-width: 860px) { .site-footer .cols { grid-template-columns: 1fr } }

/* hero */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, #fff 0%, var(--mint) 100%) }
.hero .wrap { display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: center; padding-block: 64px 72px }
.hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.4rem); color: var(--teal); text-transform: uppercase; letter-spacing: -.005em }
.hero h1 span { color: var(--ink) }
.hero .copy { display: grid; gap: 22px; min-width: 0 }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 12px }
.hero-media { position: relative; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 16 / 10 }
.hero-media img, .hero-media video { width: 100%; height: 100%; object-fit: cover }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--card); color: var(--teal); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: .85rem; font-weight: 600 }
.hero-media .chip { position: absolute; left: 16px; bottom: 16px; box-shadow: var(--shadow) }
.mountains { position: absolute; inset: auto 0 0 0; height: 140px; pointer-events: none; opacity: .5 }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; padding-block: 36px 48px; gap: 28px } }

/* grids & cards */
.grid { display: grid; gap: 24px }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)) }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)) }
@media (max-width: 960px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 26px; display: grid; gap: 10px; align-content: start; min-width: 0 }
.card.shadow { box-shadow: var(--shadow); border-color: transparent }
.card h3 { font-size: 1.15rem; color: var(--teal) }
.card p { color: var(--muted) }
.ico { width: 52px; height: 52px; border-radius: 50%; background: var(--gold); color: #fff; display: grid; place-items: center; flex: none }
.ico svg { width: 26px; height: 26px }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center }
.split > * { min-width: 0 }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 32px } }
.media { border-radius: 24px; overflow: hidden; box-shadow: var(--shadow) }
.media img { width: 100%; height: 100%; object-fit: cover }
.ratio-1 { aspect-ratio: 1 } .ratio-43 { aspect-ratio: 4 / 3 } .ratio-34 { aspect-ratio: 3 / 4 } .ratio-169 { aspect-ratio: 16 / 9 }
.list-check { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px }
.list-check li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start }
.list-check li::before { content: ""; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233E6B69' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat }

/* campaign timeline */
.phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; position: relative }
.phase { padding: 28px 26px 28px 0; display: grid; gap: 10px; align-content: start; border-top: 3px solid var(--mint-2); position: relative }
.phase::before { content: ""; position: absolute; top: -9px; left: 0; width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 3px solid var(--gold) }
.phase .when { font-weight: 700; color: var(--gold-t); font-size: .9rem; font-variant-numeric: tabular-nums }
.phase h3 { font-size: 1.35rem; color: var(--teal); text-transform: uppercase }
.phase p { color: var(--muted) }
.phase .tag { justify-self: start; background: var(--mint); color: var(--teal); border-radius: 999px; padding: 4px 12px; font-size: .8rem; font-weight: 600 }
@media (max-width: 860px) { .phases { grid-template-columns: 1fr } .phase { padding-left: 26px; border-top: 0; border-left: 3px solid var(--mint-2) } .phase::before { top: 30px; left: -9px } }

/* stat strip */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card) }
.stats > div { padding: 22px; border-left: 1px solid var(--line); display: grid; gap: 4px }
.stats > div:first-child { border-left: 0 }
.stats b { font-size: 1.7rem; color: var(--teal); line-height: 1.1; font-variant-numeric: tabular-nums }
.stats span { color: var(--muted); font-size: .9rem }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr } .stats > div:nth-child(3) { border-left: 0 } .stats > div:nth-child(n+3) { border-top: 1px solid var(--line) } }

/* video band */
.band { position: relative; overflow: hidden; color: #fff; background: #1F3D33 }
.band video, .band > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover }
.band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 45, 42, .86), rgba(20, 45, 42, .35) 70%, rgba(20, 45, 42, .1)) }
.band .wrap { position: relative; z-index: 1; padding-block: 110px; display: grid; gap: 18px }
.band .title { color: #fff; max-width: 14em }
.band p { max-width: 36em; color: #E3EEE9 }
.band .vtoggle { position: absolute; z-index: 2; right: var(--gr); bottom: 16px; background: rgba(255, 255, 255, .92); color: var(--teal); border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: .8rem; cursor: pointer }

/* product */
.price { font-size: 2rem; font-weight: 700; color: var(--teal); font-variant-numeric: tabular-nums }
.price s { font-size: 1rem; color: var(--muted); font-weight: 400; margin-left: 10px }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden }
.qty button { width: 44px; height: 44px; border: 0; background: var(--card); cursor: pointer; font-size: 1.2rem; color: var(--teal) }
.qty input { width: 52px; height: 44px; border: 0; text-align: center; font-weight: 600; -moz-appearance: textfield }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none }
.spec { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; margin: 0 }
.spec dt { color: var(--muted) }
.spec dd { margin: 0; font-weight: 600 }
.bars { display: grid; gap: 12px }
.bar { display: grid; grid-template-columns: 10em 1fr 3em; gap: 12px; align-items: center; font-size: .95rem }
.bar .track { height: 12px; border-radius: 8px; background: var(--mint); overflow: hidden }
.bar .fill { height: 100%; width: 100%; border-radius: 8px; background: var(--teal); transform-origin: left; transform: scaleX(var(--v)); transition: transform 1.2s cubic-bezier(.22, 1, .36, 1) }
.bar.key { color: var(--gold-t); font-weight: 700 }
.bar.key .fill { background: var(--gold) }
.bar .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums }
.pre .bar .fill { transform: scaleX(0) }
@media (max-width: 520px) { .bar { grid-template-columns: 7.5em 1fr 2.6em } }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap }
.thumbs button { width: 76px; height: 76px; padding: 0; border-radius: 12px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: var(--surface) }
.thumbs button[aria-pressed="true"] { border-color: var(--teal) }
.thumbs img { width: 100%; height: 100%; object-fit: cover }

/* forms */
.form { display: grid; gap: 16px }
.field { display: grid; gap: 6px }
.field label { font-weight: 600; font-size: .92rem }
.field input, .field textarea, .field select { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); transition: border-color .2s }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(62, 107, 105, .15) }
.field textarea { min-height: 140px; resize: vertical }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--muted) }
.check input { margin-top: 4px; accent-color: var(--teal) }
.msg { padding: 12px 14px; border-radius: 12px; font-size: .92rem }
.msg.err { background: #FDECEA; color: var(--danger) }
.msg.ok { background: #E7F5EE; color: var(--ok) }
.tabs { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 4px; gap: 4px }
.tabs button { border: 0; background: transparent; padding: .7em 1.3em; border-radius: 999px; font-weight: 600; cursor: pointer; color: var(--muted) }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--teal); box-shadow: 0 2px 8px rgba(0, 0, 0, .06) }
.otp { letter-spacing: .6em; font-size: 1.5rem; text-align: center; font-weight: 700 }

/* table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card) }
table { width: 100%; border-collapse: collapse; font-size: .92rem }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap }
th { background: var(--surface); font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums }
tr:last-child td { border-bottom: 0 }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600 }
.pill.ok { background: #E7F5EE; color: var(--ok) }
.pill.warn { background: #FFF4E0; color: #8A5A00 }
.pill.bad { background: #FDECEA; color: var(--danger) }
.pill.info { background: var(--mint); color: var(--teal) }

/* toast & cookie */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 140%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 100; transition: transform .35s cubic-bezier(.22, 1, .36, 1); max-width: calc(100% - 32px); font-size: .92rem }
.toast.show { transform: translate(-50%, 0) }
.cookie { position: fixed; left: var(--gl); right: var(--gr); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 90; max-width: 560px; margin-left: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 16px 18px; display: flex; gap: 14px; align-items: center; font-size: .86rem; color: var(--muted) }

/* reveal (chỉ áp cho phần nằm dưới màn hình đầu tiên) */
.pre { opacity: 0; transform: translateY(28px) }
.reveal { transition: opacity .9s cubic-bezier(.22, 1, .36, 1), transform .9s cubic-bezier(.22, 1, .36, 1) }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important }
  .pre { opacity: 1; transform: none }
}
.cart-split { grid-template-columns: 1.3fr 1fr }
@media (max-width: 900px) { .cart-split { grid-template-columns: 1fr } .cart-split aside { position: static !important } }

/* ---------- Trang tài khoản: hiệu ứng chào + khung đăng nhập hai cột ---------- */
.wl-lock { overflow: hidden }
.welcome { position: fixed; inset: 0; z-index: 300; background: #fff; display: grid; place-items: center; cursor: pointer }
.welcome.out { animation: wl-fade .5s ease .35s forwards }
.wl-brand { position: absolute; top: 22px; left: var(--gl); color: var(--teal); font-weight: 700; font-size: .95rem; animation: wl-show .5s ease both }
.wl-core { width: min(70vmin, 440px); aspect-ratio: 1; animation: wl-grow .9s cubic-bezier(.22, 1, .36, 1) both }
.welcome.out .wl-core { animation: wl-shrink .7s cubic-bezier(.55, 0, .45, 1) forwards }
.wl-orb { position: relative; width: 100%; height: 100%; filter: blur(clamp(26px, 6vmin, 44px)); animation: wl-spin 7s linear infinite }
.wl-orb i { position: absolute; width: 60%; aspect-ratio: 1; border-radius: 50% }
.wl-orb i:nth-child(1) { left: 8%; top: 4%; background: #F2B544; animation: wl-b1 3.2s ease-in-out infinite alternate }
.wl-orb i:nth-child(2) { left: 32%; top: 36%; background: #2C5250; animation: wl-b2 3s ease-in-out infinite alternate, wl-c2 2.4s ease forwards }
.wl-orb i:nth-child(3) { left: 38%; top: 8%; width: 52%; background: #94CDA3; animation: wl-b3 2.6s ease-in-out infinite alternate }
.wl-orb i:nth-child(4) { left: 26%; top: 26%; width: 44%; background: #F9E7BB; opacity: .8; animation: wl-b1 2.8s ease-in-out infinite alternate-reverse }
.wl-words { position: absolute; display: grid; justify-items: center; gap: 10px; padding: 0 var(--gr) 0 var(--gl); text-align: center }
.wl-text { margin: 0; color: #fff; font-weight: 700; font-size: clamp(2rem, 6vw, 3.2rem); letter-spacing: .01em; text-shadow: 0 2px 24px rgba(44, 82, 80, .5) }
.wl-text span { display: inline-block; animation: wl-letter-in .7s cubic-bezier(.22, 1, .36, 1) both; animation-delay: calc(.25s + var(--i) * 45ms) }
.wl-sub { margin: 0; color: var(--teal-d); font-weight: 600; font-size: clamp(.95rem, 2.4vw, 1.2rem); letter-spacing: .02em; background: rgba(255, 255, 255, .72); padding: 6px 16px; border-radius: 999px; animation: wl-sub-in .8s cubic-bezier(.22, 1, .36, 1) .75s both }
.welcome.out .wl-sub { animation: wl-letter-out .4s ease forwards }
@keyframes wl-sub-in { from { opacity: 0; transform: translateY(10px); letter-spacing: .2em } }
.welcome.out .wl-text span { animation: wl-letter-out .4s ease forwards; animation-delay: calc(var(--i) * 30ms) }
@keyframes wl-show { from { opacity: 0 } }
@keyframes wl-fade { to { opacity: 0; visibility: hidden } }
@keyframes wl-grow { from { transform: scale(.45); opacity: 0 } }
@keyframes wl-shrink { to { transform: scale(.35); opacity: 0 } }
@keyframes wl-spin { to { transform: rotate(360deg) } }
@keyframes wl-b1 { to { transform: translate(14%, 10%) scale(1.12) } }
@keyframes wl-b2 { to { transform: translate(-16%, -6%) scale(.92) } }
@keyframes wl-b3 { to { transform: translate(-8%, 18%) scale(1.15) } }
@keyframes wl-c2 { to { background: #6FB3AE } }
@keyframes wl-letter-in { from { opacity: 0; transform: translateY(.35em); filter: blur(6px) } }
@keyframes wl-letter-out { to { opacity: 0; transform: translateY(-.25em); filter: blur(8px) } }

.auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: #fff; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); min-height: 580px }
.auth-art { position: relative; isolation: isolate; color: #fff; padding: 28px; display: flex; flex-direction: column; gap: 16px; background: linear-gradient(160deg, #4E8580 0%, var(--teal) 45%, var(--teal-d) 100%); overflow: hidden }
.auth-art::before { content: ""; position: absolute; z-index: -1; width: 70%; aspect-ratio: 1; left: -15%; top: -20%; border-radius: 50%; background: radial-gradient(circle, rgba(242, 181, 68, .45), transparent 65%); animation: art-glow 9s ease-in-out infinite alternate }
.auth-art::after { content: ""; position: absolute; z-index: -1; width: 60%; aspect-ratio: 1; right: -18%; bottom: -10%; border-radius: 50%; background: radial-gradient(circle, rgba(148, 205, 163, .5), transparent 65%); animation: art-glow 11s ease-in-out infinite alternate-reverse }
.auth-logo { font-weight: 700; font-size: .95rem; letter-spacing: .02em }
.auth-stage { position: relative; flex: 1; display: grid; place-items: center; min-height: 270px }
.auth-photo { width: min(60%, 250px); aspect-ratio: 1; object-fit: cover; border-radius: 20px; border: 4px solid rgba(255, 255, 255, .92); box-shadow: 0 26px 40px -18px rgba(0, 0, 0, .5) }
.auth-bub { position: absolute; width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--teal); display: grid; place-items: center; box-shadow: 0 10px 20px -10px rgba(0, 0, 0, .45); animation: bub-float 4.2s ease-in-out infinite; animation-delay: var(--d, 0s) }
.auth-bub svg { width: 22px; height: 22px }
.auth-bub.gold { background: var(--gold); color: #fff; font-weight: 700; font-size: .9rem }
.auth-bub.b1 { left: 14%; top: 10% } .auth-bub.b2 { right: 16%; top: 4%; --d: .6s } .auth-bub.b3 { left: 6%; top: 50%; --d: 1.2s } .auth-bub.b4 { right: 6%; top: 44%; --d: .3s } .auth-bub.b5 { left: calc(50% - 23px); bottom: 2%; --d: .9s }
.auth-slides { min-height: 92px }
.auth-slides .eyebrow { color: #F9E7BB }
.auth-slides p { font-size: 1.12rem; font-weight: 600; line-height: 1.4; max-width: 30ch }
.auth-slides p:not(.on) { display: none }
.auth-slides p.on { animation: up .6s cubic-bezier(.22, 1, .36, 1) both }
.auth-dots { display: flex; gap: 6px; margin-top: 12px }
.auth-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; background: rgba(255, 255, 255, .45); cursor: pointer; transition: width .3s, background .3s }
.auth-dots button[aria-current="true"] { width: 22px; background: #fff }
.auth-form { padding: 40px clamp(20px, 4vw, 48px); display: grid; align-content: center; gap: 18px }
.auth-form .card.form { box-shadow: none; border: 0; padding: 0 }
.auth-form .head { margin: 0 }
.form.swap { animation: up .45s cubic-bezier(.22, 1, .36, 1) both }
@keyframes bub-float { 50% { transform: translateY(-8px) } }
@keyframes art-glow { to { transform: translate(18%, 14%) scale(1.15) } }
@keyframes up { from { opacity: 0; transform: translateY(16px) } }
@keyframes pop { from { opacity: 0; transform: scale(.55) } }
@keyframes art-in { from { filter: saturate(.25) brightness(1.6); opacity: .4 } }
@keyframes split-in { from { opacity: 0; transform: translateY(18px) scale(.985) } }
/* các phần hiện dần khi vào trang (sau hiệu ứng chào nếu có) */
.auth-in .auth-split { animation: split-in .7s cubic-bezier(.22, 1, .36, 1) both }
.auth-in .auth-art { animation: art-in 1.1s ease both }
.auth-in .auth-photo { animation: pop .8s cubic-bezier(.34, 1.56, .64, 1) .3s both }
.auth-in .auth-bub { animation: pop .6s cubic-bezier(.34, 1.56, .64, 1) both, bub-float 4.2s ease-in-out infinite; animation-delay: calc(.5s + var(--d, 0s)), calc(1.1s + var(--d, 0s)) }
.auth-in .auth-form > *, .auth-in .auth-form .field, .auth-in .auth-form .check, .auth-in .auth-form .btn { animation: up .6s cubic-bezier(.22, 1, .36, 1) both }
.auth-in .auth-form > :nth-child(2) { animation-delay: .1s } .auth-in .auth-form > :nth-child(3) { animation-delay: .18s }
.auth-in .auth-form .form > :nth-child(1) { animation-delay: .26s } .auth-in .auth-form .form > :nth-child(2) { animation-delay: .32s } .auth-in .auth-form .form > :nth-child(3) { animation-delay: .38s } .auth-in .auth-form .form > :nth-child(4) { animation-delay: .44s } .auth-in .auth-form .form > :nth-child(n+5) { animation-delay: .5s }
@media (max-width: 820px) {
  .auth-split { grid-template-columns: 1fr; min-height: 0; border-radius: 22px }
  .auth-art { padding: 22px }
  .auth-stage { min-height: 160px }
  .auth-photo { width: 128px }
  .auth-bub { width: 38px; height: 38px } .auth-bub svg { width: 18px; height: 18px }
  .auth-slides { min-height: 0 }
  .auth-form { padding: 28px 20px }
}

/* ---------- Trang sản phẩm theo dữ liệu admin + mã giảm giá ở giỏ hàng ---------- */
.preview-bar { position: sticky; top: 0; z-index: 30; background: var(--gold); color: #fff; font-weight: 600; text-align: center; padding: 10px 16px; font-size: .9rem }
.p-flags { display: flex; flex-wrap: wrap; gap: 8px }
.p-flags:empty { display: none }
.pflag { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 12px; font-size: .8rem; font-weight: 600; background: var(--mint); color: var(--teal) }
.pflag.sale { background: #FFF1DC; color: var(--gold-t) }
.pflag.low { background: #FFF1DC; color: var(--gold-t) }
.pflag.out { background: #FDECEA; color: var(--danger) }
.rich { display: grid; gap: 14px; font-size: 1.02rem; line-height: 1.7 }
.rich h3 { color: var(--teal); margin-top: 6px }
.pcard { text-decoration: none; gap: 8px }
.pcard img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--surface) }
.pc-price { font-weight: 700; color: var(--teal) }
.pc-price s { color: var(--muted); font-weight: 400; margin-left: 8px; font-size: .88rem }
.btn:disabled { opacity: .45; cursor: not-allowed }
.coupon { display: flex; gap: 8px }
.coupon input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; text-transform: uppercase }
.coupon[hidden] { display: none }

/* ---------- Danh sách sản phẩm (san-pham.html không có ?id) ---------- */
html.catalog #p-top, html.catalog #p-detail, html.catalog [data-only], html.catalog #p-more, html.catalog #p-preview { display: none !important }
html:not(.catalog) #p-cat { display: none }
.cat { padding-top: 48px }
.cat-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px }
.cat-chips button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: .88rem; cursor: pointer }
.cat-chips button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: var(--on-teal, #fff) }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 24px }
.cat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: grid; grid-template-rows: auto 1fr; min-width: 0; transition: box-shadow .3s, transform .3s cubic-bezier(.22, 1, .36, 1) }
.cat-card:hover { box-shadow: var(--shadow); transform: translateY(-3px) }
.cc-img { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--surface); overflow: hidden }
.cc-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.22, 1, .36, 1) }
.cat-card:hover .cc-img img { transform: scale(1.04) }
.cc-flags { position: absolute; left: 12px; top: 12px; display: flex; flex-wrap: wrap; gap: 6px }
.cc-body { padding: 18px 20px 20px; display: grid; gap: 6px; align-content: start }
.cc-cat { font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-t) }
.cc-body h2 { font-size: 1.2rem; line-height: 1.3 }
.cc-body h2 a { text-decoration: none }
.cc-body h2 a:hover { color: var(--teal) }
.cc-short { color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.cc-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line) }
.cc-foot .pc-price { font-size: 1.15rem }
.cc-acts { display: flex; gap: 8px; flex-wrap: wrap }
.cat-sk { height: 380px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface), var(--mint), var(--surface)); background-size: 200% 100%; animation: sk 1.4s linear infinite }
@keyframes sk { to { background-position: -200% 0 } }
.crumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .9rem; color: var(--muted); margin-bottom: 18px }
.crumb a { color: var(--teal); font-weight: 600; text-decoration: none }
.crumb a:hover { text-decoration: underline }

/* ---------- Nút sáng/tối và ngôn ngữ (trang có data-prefs) ---------- */
.pref-btn { width: auto; min-width: 44px; padding: 0 10px; font-weight: 700; font-size: .82rem; letter-spacing: .04em; gap: 6px; grid-auto-flow: column }
.pref-btn svg { width: 20px; height: 20px }
.pref-btn .moon, [data-theme="dark"] .pref-btn .sun { display: none }
[data-theme="dark"] .pref-btn .moon { display: block }
@media (max-width: 420px) { .pref-btn { min-width: 40px; padding: 0 8px } }
html.i18n-wait body { visibility: hidden }

/* ---------- Giao diện tối ---------- */
:root[data-theme="dark"] {
  --bg: #0F1716; --card: #16211F; --surface: #131D1B; --hdr: rgba(15, 23, 22, .9);
  --mint: #1E302C; --mint-2: #284039; --teal: #79BDB6; --teal-d: #0B1413; --on-teal: #0C1917;
  --gold: #E8B04A; --gold-t: #F0BF66; --ink: #E5EEEB; --muted: #A2B5B1; --line: #273634;
  --danger: #FF8E84; --ok: #6FD9A2; --shadow: 0 18px 40px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
[data-theme="dark"] .btn { color: var(--on-teal) }
[data-theme="dark"] .btn.ghost { color: var(--teal) }
[data-theme="dark"] .btn.gold { color: #241803 }
[data-theme="dark"] .icon-btn.solid { color: var(--on-teal) }
[data-theme="dark"] .toast { background: #E5EEEB; color: #0F1716 }
[data-theme="dark"] .pflag.sale, [data-theme="dark"] .pflag.low { background: #3A2C12; color: #F3C979 }
[data-theme="dark"] .pflag.out { background: #3B1C1A; color: #FF9E95 }
[data-theme="dark"] .pill.warn { background: #3A2C12; color: #F3C979 }
[data-theme="dark"] .site-footer { background: #0B1312; border-top: 1px solid var(--line) }
[data-theme="dark"] .logo img, [data-theme="dark"] .flogo { background: #F3F7F5; border-radius: 10px; padding: 4px }
[data-theme="dark"] .qty input { background: var(--card) }
[data-theme="dark"] .media, [data-theme="dark"] .cc-img img { filter: brightness(.92) }
[data-theme="dark"] .list-check li::before { filter: brightness(1.3) }
[data-theme="dark"] .preview-bar { color: #241803 }

/* ---------- Theo dõi đơn hàng (trang Tài khoản) ---------- */
.otrack { margin-top: 36px; display: grid; gap: 14px; scroll-margin-top: 96px }
.ot-head { display: flex; align-items: center; justify-content: space-between; gap: 12px }
.ot-head h2 { font-size: 1.3rem; color: var(--teal) }
.ot-list { display: grid; gap: 14px }
.ocard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: grid; gap: 16px; min-width: 0 }
.ocard > header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start }
.ocard > header div { display: grid; gap: 2px; min-width: 0 }
.ocard > header .pill { white-space: nowrap; flex: none }
.otl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; counter-reset: ot }
.otl li { counter-increment: ot; position: relative; display: grid; gap: 4px; justify-items: center; text-align: center; font-size: .8rem; color: var(--muted); line-height: 1.3 }
.otl li::before { content: counter(ot); position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); font-weight: 700; color: var(--muted) }
.otl li + li::after { content: ""; position: absolute; top: 14px; right: 50%; width: 100%; height: 3px; background: var(--line) }
.otl li.done::before, .otl li.cur::before { background: var(--teal); border-color: var(--teal); color: var(--on-teal, #fff) }
.otl li.done::before { content: "✓" }
.otl li.done::after, .otl li.cur::after { background: var(--teal) }
.otl li.cur::before { box-shadow: 0 0 0 5px var(--mint) }
.otl li b { font-weight: 600 }
.otl li.cur b { color: var(--ink) }
.otl li small { font-size: .7rem; color: var(--muted) }
.oship { display: flex; flex-wrap: wrap; gap: 10px 28px; background: var(--surface); border-radius: 14px; padding: 12px 16px; font-size: .86rem; color: var(--muted) }
.oship span { display: grid; gap: 2px }
.oship b { color: var(--ink); font-size: .95rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.ocopy { border: 1px solid var(--line); background: var(--card); color: var(--teal); border-radius: 999px; padding: 2px 10px; font-size: .74rem; font-weight: 600; cursor: pointer }
.oconfirm { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; border: 1.5px dashed var(--gold); border-radius: 14px; padding: 14px 16px; background: color-mix(in srgb, var(--gold) 8%, transparent) }
.oconfirm p { display: grid; gap: 2px }
.oc-acts { display: flex; gap: 8px; flex-wrap: wrap }
.okline { background: var(--mint); color: var(--teal); border-radius: 12px; padding: 10px 14px; font-size: .88rem; font-weight: 600 }
.odet summary { cursor: pointer; font-weight: 600; color: var(--teal); font-size: .9rem; padding: 2px 0 }
.odet[open] summary { margin-bottom: 12px }
.olines { display: grid; gap: 6px; font-size: .9rem; margin-bottom: 14px }
.olines div { display: flex; justify-content: space-between; gap: 12px }
.olines .ok-t { color: var(--ok) }
.olines .tot { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 700 }
@media (max-width: 560px) {
  .otl { grid-template-columns: 1fr; gap: 0; padding-left: 4px }
  .otl li { grid-template-columns: 30px 1fr; justify-items: start; text-align: left; column-gap: 12px; padding-bottom: 14px }
  .otl li::before { grid-row: span 2 }
  .otl li::after, .otl li + li::after { content: ""; position: absolute; left: 13.5px; top: 30px; bottom: 0; right: auto; width: 3px; height: auto; background: var(--line) }
  .otl li:last-child::after { display: none }
  .otl li.done::after { background: var(--teal) }
  .otl li.cur::after { background: var(--line) }
  .otl li b { align-self: center }
  .ocard { padding: 16px }
}
[data-theme="dark"] .msg.err { background: #3B1C1A; color: #FF9E95 }
[data-theme="dark"] .msg.ok { background: #183329; color: #7BE0AA }

/* Màn chào bản 04/11: "Trà Sâm Trường Nhân / RÕ SÂM, TRỌN NHỊP" + nhãn dán (thay cho "Welcome") */
.welcome { overflow: hidden; --s: 2.4s; --k: min(calc(1vw / 14.4), calc(1vh / 8.2)) }
.welcome .wl-core { width: min(78vmin, 520px) }
.wl-words { gap: 12px }
.wl-hello { position: absolute; z-index: 2; margin: 0; color: #fff; font-weight: 700; font-size: clamp(2.4rem, 8vw, 4.4rem); letter-spacing: .01em; text-shadow: 0 2px 28px rgba(44, 82, 80, .45); pointer-events: none }
.wl-hello span { display: inline-block; opacity: 0;
  animation: wl-hello-in .7s cubic-bezier(.22, 1, .36, 1) forwards, wl-letter-out .45s ease forwards;
  animation-delay: calc(.25s + var(--i) * 45ms), calc(var(--s) - .3s + var(--i) * 28ms) }
@keyframes wl-hello-in { from { opacity: 0; transform: translateY(.35em); filter: blur(6px) } to { opacity: 1; transform: none; filter: none } }
.wl-name { margin: 0; color: #fff; font-weight: 700; font-size: clamp(1.2rem, 4.2vw, 2.1rem); letter-spacing: .04em; text-shadow: 0 2px 22px rgba(44, 82, 80, .55) }
.wl-name span { display: inline-block; animation: wl-letter-in .8s cubic-bezier(.22, 1, .36, 1) both; animation-delay: calc(var(--s) + .1s + var(--i) * 30ms) }
.wl-slogan { margin: -.1em 0 0; font-weight: 700; line-height: 1.3; font-size: clamp(2.2rem, 9vw, 5.2rem); letter-spacing: .02em }
.wl-slogan span { display: inline-block; white-space: nowrap; padding: .12em .04em 0;
  background: linear-gradient(100deg, #fff 0%, #fff 30%, #F9E7BB 42%, #fff7d6 50%, #F9E7BB 58%, #fff 70%, #fff 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 18px rgba(44, 82, 80, .45));
  animation: wl-word 1.1s cubic-bezier(.22, 1, .36, 1) both, wl-shine 3s ease-in-out infinite; animation-delay: calc(var(--s) + .5s + var(--i) * 140ms), calc(var(--s) + 1.7s + var(--i) * 140ms) }
.wl-slogan span + span { margin-left: .22em }
.wl-line { width: 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #fff, transparent); animation: wl-line 1s cubic-bezier(.22, 1, .36, 1) calc(var(--s) + 1.2s) forwards }
.welcome.out .wl-name span, .welcome.out .wl-slogan span { animation: wl-letter-out .4s ease forwards }
.welcome.out .wl-line { opacity: 0; transition: opacity .3s }
.wl-stk { --x: var(--dx); --y: var(--dy); --w: var(--dw); position: absolute; left: 50%; top: 50%; z-index: 1; width: calc(var(--w) * var(--k));
  transform: translate(-50%, -50%) translate(calc(var(--x) * var(--k)), calc(var(--y) * var(--k))) rotate(var(--r));
  animation: wl-stk-in 1s cubic-bezier(.34, 1.56, .64, 1) calc(var(--s) + .5s + var(--d) * 40ms) both }
.wl-stk img { display: block; width: 100%; height: auto; user-select: none;
  filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(0 10px 16px rgba(44, 82, 80, .22));
  animation: wl-bob var(--t) ease-in-out calc(var(--s) + 1.5s + var(--d) * 90ms) infinite alternate }
.welcome.out .wl-stk { animation: wl-stk-out .5s ease forwards; animation-delay: calc(var(--d) * 20ms) }
.welcome.out .wl-core { animation-delay: .1s }
@keyframes wl-word { from { opacity: 0; transform: translateY(.4em) scale(.92); filter: blur(14px) drop-shadow(0 3px 18px rgba(44, 82, 80, .45)); letter-spacing: .25em }
                     to { opacity: 1; transform: none; filter: drop-shadow(0 3px 18px rgba(44, 82, 80, .45)) } }
@keyframes wl-shine { 0% { background-position: 100% 0 } 60%, 100% { background-position: -50% 0 } }
@keyframes wl-line { to { width: min(320px, 60vw) } }
@keyframes wl-stk-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.15) rotate(calc(var(--r) - 40deg)) } }
@keyframes wl-stk-out { to { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(0deg) } }
@keyframes wl-bob { from { transform: translateY(-6px) rotate(-2deg) } to { transform: translateY(6px) rotate(2deg) } }
@media (max-width: 640px) {
  .welcome { --k: min(1px, calc(1vh / 8.44)) }
  .wl-stk { --x: var(--mx); --y: var(--my); --w: var(--mw) }
  .wl-slogan { font-size: clamp(2.4rem, 12.5vw, 3.4rem); line-height: 1.15 }
  .wl-slogan span { display: block }
  .wl-slogan span + span { margin-left: 0 }
}
