/* pay.27biggroup.com — trang thanh toán chung. Màu thương hiệu lấy từ logo 27BigGroup (giống art.27biggroup.com). */
:root {
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ink: #1d1a1b;
  --muted: #6c6568;
  --faint: #9a9295;
  --line: #ece5e7;
  --bg: #f7f4f5;
  --card: #fff;
  --brand: #fd4762;
  --brand-2: #fc2552;
  --brand-ink: #d81b45;
  --brand-soft: #fff0f3;
  --ok: #17804b;
  --ok-soft: #e8f6ee;
  --warn-soft: #fff5e0;
  --err: #b42318;
  --err-soft: #fdecea;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(29, 26, 27, .04), 0 6px 20px rgba(29, 26, 27, .05);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: var(--brand-ink); }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }

/* ── Khung trang ─────────────────────────────────────────────── */
.p-top { background: #fff; border-bottom: 1px solid var(--line); }
.p-top__in { max-width: 980px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; }
.p-brand img { height: 36px; width: auto; }
.p-top__label { padding-left: 14px; border-left: 1px solid var(--line); font-weight: 600; color: var(--muted); }
.p-top__secure { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.p-top__secure svg { width: 16px; height: 16px; color: var(--ok); }
.p-wrap { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 32px 20px 56px; }
.p-foot { padding: 18px 20px 28px; text-align: center; font-size: 13px; color: var(--faint); }
.p-foot p { margin: 0; }

/* ── Chọn dịch vụ ────────────────────────────────────────────── */
.p-intro h1, .p-head h1 { font-size: clamp(24px, 4.2vw, 32px); font-weight: 700; }
.p-lead { margin: 6px 0 24px; font-size: 16px; color: var(--muted); }
.p-services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.p-service {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.p-service:hover { border-color: #f6b1bf; transform: translateY(-1px); box-shadow: 0 10px 28px rgba(216, 27, 69, .08); }
.p-service:focus-visible { outline: 3px solid #fdb3c1; outline-offset: 2px; }
.p-service__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.p-service__txt strong { font-size: 16px; font-weight: 600; }
.p-service__txt span { font-size: 14px; color: var(--muted); }
.p-service__go { flex: none; margin-left: auto; color: #cbbfc3; }
.p-service__go svg { width: 20px; height: 20px; }
.p-ico { flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.p-ico svg { width: 23px; height: 23px; }
.p-ico--lg { width: 56px; height: 56px; border-radius: 16px; }
.p-ico--lg svg { width: 28px; height: 28px; }
.p-steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.p-steps li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--muted); }
.p-steps svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--brand-ink); }

/* ── Trang dịch vụ ───────────────────────────────────────────── */
.p-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; font-size: 14px; color: var(--muted); text-decoration: none; }
.p-back:hover { color: var(--ink); }
.p-back svg { width: 16px; height: 16px; }
.p-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.p-eyebrow { margin: 0 0 2px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink); }
.p-card { margin-bottom: 16px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.p-loading { color: var(--muted); }
.p-section { margin: 26px 0 12px; font-size: 18px; font-weight: 600; }
.p-hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.p-err { margin: 8px 0 0; font-size: 14px; font-weight: 500; color: var(--err); }
.p-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.p-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 20px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s ease, transform .1s ease;
}
.p-btn:hover { filter: brightness(1.05); }
.p-btn:active { transform: translateY(1px); }
.p-btn:focus-visible { outline: 3px solid #fdb3c1; outline-offset: 2px; }
.p-btn[disabled] { opacity: .5; cursor: not-allowed; filter: none; transform: none; }
.p-btn--ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.p-btn--ghost:hover { border-color: #d9ced2; filter: none; }
.p-btn--sm { min-height: 38px; padding: 7px 14px; font-size: 14px; }

.p-notice { margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; font-size: 14px; background: #f3eff1; }
.p-notice a { font-weight: 600; white-space: nowrap; }
.p-notice--ok { background: var(--ok-soft); color: #0f5132; }
.p-notice--warn { background: var(--warn-soft); color: #6b3f00; }
.p-notice--error { background: var(--err-soft); color: #7a1b12; }
.p-notice--info { background: #eef2fb; color: #1e3a6b; }

/* Cần đăng nhập */
.p-auth { display: flex; align-items: flex-start; gap: 16px; }
.p-auth__ico { flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: #eef2fb; color: #2f55a4; }
.p-auth__ico svg { width: 22px; height: 22px; }
.p-auth h2 { margin-bottom: 4px; font-size: 18px; }
.p-auth p { margin: 0; color: var(--muted); }
.p-auth .p-hint { margin-top: 12px; }

/* Ô nhập mã thẻ / link video */
.p-find { display: grid; gap: 4px; }
.p-field { display: grid; gap: 6px; }
.p-field span { font-weight: 600; }
.p-field input { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid #ddd3d6; border-radius: 12px; background: #fff; font-size: 16px; }
.p-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(253, 71, 98, .18); }
.p-field input[aria-invalid="true"] { border-color: var(--err); }
.p-find .p-btn { justify-self: start; margin-top: 12px; }

/* Tài khoản / video / thẻ đang chọn */
.p-account { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.p-rows { flex: 1; min-width: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 24px; }
.p-rows div { min-width: 0; }
.p-rows dt { font-size: 13px; color: var(--muted); }
.p-rows dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }

/* Các gói */
.p-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.p-opt { display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.p-opt h3 { font-size: 17px; font-weight: 600; }
.p-opt__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.p-opt__price strong { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.p-opt__price s { font-size: 15px; color: var(--faint); }
.p-opt__price small { font-size: 14px; color: var(--muted); }
.p-badge { display: inline-block; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-ink); font-size: 12px; font-weight: 600; }
.p-promo { margin: 0; font-size: 13px; color: var(--brand-ink); }
.p-promo b { font-variant-numeric: tabular-nums; }
.p-opt__desc { margin: 0; font-size: 14px; color: var(--muted); }
.p-opt__meta { margin: 0; font-size: 14px; font-weight: 500; }
.p-opt__warn { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--warn-soft); color: #6b3f00; font-size: 13px; }
.p-qty { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--line); }
.p-qty > span { font-size: 14px; color: var(--muted); }
.p-qty__ctl { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.p-qty__ctl button { width: 40px; height: 40px; border: 0; background: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.p-qty__ctl button:hover { background: #faf6f7; }
.p-qty__ctl button[disabled] { color: #cfc6c9; background: #fff; cursor: not-allowed; }
.p-qty__ctl output { min-width: 36px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.p-qty small { font-size: 13px; color: var(--muted); }
.p-opt > .p-btn { margin-top: auto; }
.p-opt__spacer { flex: 1; }

/* ── Thanh toán ──────────────────────────────────────────────── */
.p-paycard { padding: 0; overflow: hidden; }
.p-paycard__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.p-paycard__head h2 { font-size: 18px; }
.p-link { appearance: none; padding: 4px 0; border: 0; background: none; color: var(--brand-ink); font-weight: 600; white-space: nowrap; cursor: pointer; }
.p-timer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px 8px; font-size: 14px; color: var(--muted); }
.p-timer b { font-size: 18px; color: var(--ok); font-variant-numeric: tabular-nums; }
.p-timer.is-warn b { color: #c26a00; }
.p-timer.is-danger b { color: var(--err); }
.p-bar { height: 5px; margin: 0 20px; border-radius: 99px; background: #f0e9eb; overflow: hidden; }
.p-bar i { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--ok); transition: width 1s linear, background-color .3s ease; }
.p-timer.is-warn + .p-bar i { background: #e08a00; }
.p-timer.is-danger + .p-bar i { background: var(--err); }
.p-pay { display: grid; grid-template-columns: minmax(220px, 280px) 1fr; align-items: start; gap: 24px; padding: 20px; }
.p-qr { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: center; }
.p-qr img { width: 100%; height: auto; min-height: 220px; object-fit: contain; }
.p-qr figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.p-kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.p-kv__k { flex: none; font-size: 14px; color: var(--muted); }
.p-kv__v { display: flex; align-items: center; gap: 8px; min-width: 0; text-align: right; }
.p-kv__v b { font-weight: 600; overflow-wrap: anywhere; }
.p-kv--amount .p-kv__v b { font-size: 20px; color: var(--brand-ink); }
.p-kv--content .p-kv__v b, .p-mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .02em; }
.p-copy { flex: none; appearance: none; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; cursor: pointer; }
.p-copy:hover { border-color: #d9ced2; }
.p-copy.is-done { border-color: #b9e3cb; background: var(--ok-soft); color: var(--ok); }
.p-bank { margin-top: 6px; }
.p-waiting { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-weight: 500; }
.p-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); animation: p-pulse 1.4s ease-in-out infinite; }
@keyframes p-pulse {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1); }
}
.p-notify { margin-top: 14px; }
.p-sent { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; color: var(--ok); }
.p-sent svg { flex: none; width: 18px; height: 18px; }

.p-result { padding: 34px 20px 30px; text-align: center; }
.p-result__ico { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.p-result__ico svg { width: 32px; height: 32px; }
.p-result__ico--warn { background: var(--warn-soft); color: #c26a00; }
.p-result h2 { margin-bottom: 6px; font-size: 22px; }
.p-result p { max-width: 460px; margin: 0 auto; color: var(--muted); }
.p-result .p-hint { margin-top: 14px; }
.p-result .p-notify { display: flex; justify-content: center; }
.p-result .p-actions { justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .p-dot { animation: none; }
  .p-service, .p-btn, .p-bar i { transition: none; }
}

@media (max-width: 720px) {
  .p-wrap { padding: 22px 16px 40px; }
  .p-top__in { padding: 10px 16px; }
  .p-top__secure span { display: none; }
  .p-services, .p-steps { grid-template-columns: 1fr; }
  .p-auth { flex-direction: column; }
  .p-find .p-btn { justify-self: stretch; }
  .p-paycard__head { padding: 16px; }
  .p-timer { padding: 12px 16px 8px; }
  .p-bar { margin: 0 16px; }
  .p-pay { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
  .p-qr { width: 100%; max-width: 300px; margin: 0 auto; }
  /* Nội dung chuyển khoản không được bẻ giữa mã đơn (khách gõ tay sẽ sai) → nhãn 1 dòng, mã + nút 1 dòng */
  .p-kv--content { flex-wrap: wrap; gap: 6px 12px; }
  .p-kv--content .p-kv__v { width: 100%; justify-content: space-between; }
  .p-kv--content .p-kv__v b { white-space: nowrap; overflow-wrap: normal; }
}
