/*
 * shop.css — giao diện 3 trang bán app: /mua · /don-hang/<token> · /tai
 * Cùng tông tối với trang donate public/i.html (nền #0b1020, card #131a2e, viền #25304d).
 * Tự chứa 100%: không font/CDN ngoài, không @import.
 */

:root {
  color-scheme: dark;
  --bg: #0b1020;
  --card: #131a2e;
  --card2: #0f1628;
  --line: #25304d;
  --txt: #e7ecf7;
  --dim: #93a1bd;
  --gold: #fbbf24;
  --ok: #22c55e;
  --ok2: #4ade80;
  --bad: #f87171;
  --brand: #5b83ff;
  --brand2: #3b6df6;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--txt);
  background: radial-gradient(1100px 520px at 50% -12%, #1e2a52 0%, #0b1020 62%) fixed, var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  padding: 14px 14px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.wrap { width: min(100%, 34rem); display: flex; flex-direction: column; gap: 12px; }

.card {
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 16px 40px rgb(0 0 0 / .38);
}

/* ------------------------------ Tiêu đề / đầu trang ------------------------------ */
.top { display: flex; align-items: flex-start; gap: 10px; }
.top > div { min-width: 0; }
h1 { font-size: 1.35rem; margin: 0 0 4px; letter-spacing: .2px; }
h2 { font-size: .95rem; margin: 0 0 10px; color: #cbd5e1; text-transform: uppercase; letter-spacing: .6px; }
.dim { color: var(--dim); font-size: .85rem; }
a { color: var(--brand); }
.back {
  margin-left: auto; flex: 0 0 auto; text-decoration: none; white-space: nowrap;
  font-size: .82rem; color: var(--txt); background: #1b2440; border: 1px solid var(--line);
  padding: 7px 11px; border-radius: 10px;
}
.hidden { display: none !important; }

/* ---------------------- Nút / chip tài khoản (acct.js) ----------------------
   acct.js đổ nội dung vào #acctSlot trong .top: chưa đăng nhập -> nút "Đăng nhập",
   đã đăng nhập -> chip avatar + tên (link /tai-khoan). Slot rỗng thì ẩn hẳn. */
.acct { display: flex; align-items: center; flex-shrink: 0; }
.acct:empty { display: none; }
/* Có chip thì chip đẩy sang phải; chưa có thì .back tự đẩy như trước */
.acct:not(:empty) { margin-left: auto; }
.acct:not(:empty) ~ .back { margin-left: 8px; }
.acct-login {
  display: inline-flex; align-items: center; height: 34px; padding: 0 13px;
  border: 1px solid rgb(91 131 255 / .55); border-radius: 999px;
  color: var(--txt); background: rgb(91 131 255 / .14);
  font-size: .82rem; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
.acct-login:hover { background: rgb(91 131 255 / .28); border-color: var(--brand); text-decoration: none; }
.acct-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 34px;
  padding: 0 11px 0 3px; max-width: 200px; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: 999px; background: #151d33;
  color: var(--txt); font-size: .82rem; font-weight: 700;
}
.acct-chip:hover { border-color: var(--brand); text-decoration: none; }
.acct-av, .acct-av-txt { width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; }
.acct-av { display: block; object-fit: cover; background: #1b2440; }
.acct-av-txt {
  display: grid; place-items: center; font-size: .78rem; font-weight: 900; color: #0b1020;
  background: linear-gradient(145deg, var(--brand), #8fb0ff);
}
.acct-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 559px) {
  .acct-name { display: none; }
  .acct-chip { padding: 0 3px; }
}

/* ---------------------------------- Gói bán ---------------------------------- */
.plans { display: grid; gap: 9px; }
.plan {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px;
  width: 100%; text-align: left; font: inherit; color: var(--txt); cursor: pointer;
  background: #151d33; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 13px; transition: border-color .15s, background .15s, transform .1s;
}
.plan:active { transform: scale(.99); }
.plan-name { font-weight: 700; font-size: .97rem; }
.plan-price { font-weight: 800; color: var(--gold); font-size: .97rem; white-space: nowrap; }
.plan-note { grid-column: 1 / -1; font-size: .78rem; color: var(--dim); }
.plan-tag {
  grid-column: 1 / -1; justify-self: start; margin-top: 5px;
  font-size: .74rem; color: #d8c8ff; background: rgb(148 108 255 / .14);
  border: 1px solid rgb(148 108 255 / .35); padding: 3px 8px; border-radius: 999px;
}
.plan.sel { border-color: var(--brand); background: linear-gradient(180deg, #22305a, #1a2444); }
.plan.sel .plan-name::before { content: "✓ "; color: var(--ok2); }

/* ---------------------------------- Form ---------------------------------- */
.field { display: block; margin: 12px 0 6px; font-size: .85rem; color: #cbd5e1; font-weight: 600; }
.inp, input.inp, textarea.inp {
  width: 100%; padding: 12px 13px; border-radius: 13px; border: 1px solid var(--line);
  background: #0e152a; color: var(--txt); font: inherit; font-size: 1rem;
}
.inp:focus { outline: none; border-color: var(--brand); }
.inp::placeholder { color: #64748b; }
.hint { margin-top: 6px; font-size: .8rem; color: var(--dim); }
.hint b { color: #dbe4f7; }

.go {
  width: 100%; margin-top: 14px; font: inherit; font-size: 1.02rem; font-weight: 800;
  background: linear-gradient(180deg, #22c55e, #16a34a); border: 1px solid #34d399;
  color: #04210f; padding: 14px; border-radius: 14px; cursor: pointer;
}
.go:disabled { opacity: .55; cursor: default; }
.btn {
  width: 100%; margin-top: 10px; font: inherit; font-size: .95rem; font-weight: 700;
  background: #1b2440; color: var(--txt); border: 1px solid var(--line);
  padding: 12px; border-radius: 13px; cursor: pointer; text-decoration: none; text-align: center;
  display: block;
}
.btn.primary { background: linear-gradient(180deg, var(--brand), var(--brand2)); border-color: #7d9dff; color: #fff; }
.btn:active { transform: scale(.995); }
.btn[disabled], .btn.disabled { opacity: .5; cursor: default; pointer-events: none; }

.notice {
  margin-top: 12px; padding: 10px 12px; border-radius: 12px; font-size: .86rem;
  background: #3a1414; color: #fca5a5; border: 1px solid rgb(248 113 113 / .35);
}
.notice.warn { background: #3a2f10; color: var(--gold); border-color: rgb(251 191 36 / .35); }
.notice.ok { background: #0d2f1c; color: var(--ok2); border-color: rgb(34 197 94 / .35); }

/* ---------------------------------- QR / trả tiền ---------------------------------- */
.qr { display: grid; place-items: center; gap: 8px; margin: 4px 0 12px; }
.qr img { width: min(100%, 15rem); border-radius: 14px; background: #fff; padding: 8px; display: block; }
.qr .dim { text-align: center; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; font-size: .88rem; margin: 0; }
dt { color: var(--dim); }
dd { margin: 0; text-align: right; font-weight: 600; word-break: break-word; }
dd.amount { color: var(--gold); font-weight: 800; font-size: 1.05rem; }

.paybox {
  margin-top: 12px; padding: 12px; border-radius: 14px; text-align: center;
  background: #0a1024; border: 1px dashed rgb(251 191 36 / .55);
}
.paybox .lbl { font-size: .78rem; color: var(--dim); text-transform: uppercase; letter-spacing: .6px; }
.content {
  font-size: 1.5rem; font-weight: 900; letter-spacing: 2px; color: var(--gold);
  margin: 6px 0 8px; word-break: break-all; font-variant-numeric: tabular-nums;
}
.copy {
  font: inherit; font-size: .82rem; padding: 7px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: #1b2440; color: var(--txt);
}
.copy:active { transform: scale(.98); }
.expire { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; font-size: .85rem; color: var(--dim); }
#count, .count { color: var(--txt); font-variant-numeric: tabular-nums; font-weight: 700; }

.status { margin-top: 12px; padding: 11px; border-radius: 12px; text-align: center; font-weight: 700; font-size: .92rem; }
.status.wait { background: #3a2f10; color: var(--gold); }
.status.ok { background: #0d2f1c; color: var(--ok2); }
.status.bad { background: #3a1414; color: #fca5a5; }

/* ---------------------------------- Key bản quyền ---------------------------------- */
/*
 * Key thật dài 200–265 ký tự (IDOLFX.<payload base64>.<chữ ký base64>).
 * Trước đây chỉ có word-break nên key xuống 5–8 dòng, hộp xanh phình to phá khung.
 * Cách chữa: cho phép ngắt ở mọi ký tự (kể cả khi chuỗi không có khoảng trắng),
 * chặn chiều cao và cho cuộn bên trong, và bấm một lần là chọn được cả key.
 */
.keyCard { border-color: rgb(34 197 94 / .5); }
.key, .keyval {
  word-break: break-all;
  overflow-wrap: anywhere;
  -webkit-user-select: all;
  user-select: all;
  font-variant-ligatures: none;
  scrollbar-width: thin;
  scrollbar-color: #3a4a6b #0b1020;
}
.key::-webkit-scrollbar, .keyval::-webkit-scrollbar { width: 8px; }
.key::-webkit-scrollbar-thumb, .keyval::-webkit-scrollbar-thumb { background: #3a4a6b; border-radius: 8px; }
.key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92rem; line-height: 1.5;
  background: #081a12; border: 1px dashed var(--ok); border-radius: 12px;
  padding: 12px; color: var(--ok2); margin: 6px 0 10px;
  max-height: 116px; overflow-y: auto;
}
.notice, .status { overflow-wrap: anywhere; }
.steps { margin: 10px 0 0; padding-left: 20px; }
.steps li { font-size: .86rem; color: #cfd9ee; margin: 5px 0; }
.steps b { color: #fff; }

/* ---------------------------------- Tải app ---------------------------------- */
.dl { display: grid; gap: 10px; }
.dlrow {
  display: flex; align-items: center; gap: 12px;
  background: #151d33; border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px;
}
.dlrow .ic { font-size: 1.5rem; }
.dlrow .nm { font-weight: 700; font-size: .95rem; }
.dlrow .sub { font-size: .78rem; color: var(--dim); }
.dlrow .act { margin-left: auto; flex: 0 0 auto; }
.dlrow .act .copy, .dlrow .act .btn { margin: 0; width: auto; }
.dlrow.off { opacity: .6; }
.pill { font-size: .74rem; color: var(--gold); border: 1px solid rgb(251 191 36 / .4); background: rgb(251 191 36 / .1); padding: 3px 8px; border-radius: 999px; }
.pill.ok { color: var(--ok2); border-color: rgb(34 197 94 / .4); background: rgb(34 197 94 / .1); }

.foot { text-align: center; font-size: .76rem; color: #64748b; padding: 2px 0 6px; }
.foot a { color: #8aa4d6; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Khối KEY (dùng thử + đơn đã trả tiền) ---------- */
.keybox { margin-top: 12px; padding: 14px; border: 1px solid #2a3752; border-radius: 12px; background: #101a2e; }
.keylabel { font-size: 12px; letter-spacing: .4px; color: #8fa0c0; margin-bottom: 6px; }
.keyval { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5;
  background: #0b1020; border: 1px solid #2a3752; border-radius: 8px; padding: 10px; color: #cdd9ff;
  max-height: 98px; overflow-y: auto; }
.keybox .copy { margin-top: 10px; }
.keybox .steps { margin: 10px 0 0; padding-left: 20px; font-size: 13px; color: #cbd5e1; }
.keybox .steps li { margin: 4px 0; }
.go.alt { background: linear-gradient(180deg, #22c55e, #16a34a); }

/* ==========================================================================
 * TÀI KHOẢN KHÁCH HÀNG — /tai-khoan · /lien-ket-thiet-bi
 * Dùng lại tông tối ở trên; accent tím #c58cff cho khớp trang chủ idolhub.net.
 * ========================================================================== */

.gbtn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 12px; padding: 13px 16px; border-radius: 14px; text-decoration: none;
  background: #fff; color: #1f2430; font-weight: 700; font-size: 1rem;
  border: 1px solid #d7dced; cursor: pointer;
}
.gbtn:active { transform: scale(.995); }

.benefits { margin: 14px 0 0; padding-left: 20px; }
.benefits li { font-size: .88rem; color: #cfd9ee; margin: 6px 0; }
.benefits b { color: #fff; }

.acct { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: 0 0 auto; object-fit: cover;
  background: #1b2440; border: 1px solid var(--line);
}
.acctInfo { min-width: 0; }
.acctName { font-weight: 800; font-size: 1.02rem; overflow-wrap: anywhere; }
.acct .copy { margin-left: auto; flex: 0 0 auto; }

.plan3 { display: grid; gap: 8px; padding: 13px; border-radius: 14px; background: #0f1628; border: 1px solid var(--line); }
.plan3.ok { border-color: rgb(34 197 94 / .45); }
.plan3.bad { border-color: rgb(248 113 113 / .35); }
.plan3row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .9rem; }
.plan3row > b { text-align: right; word-break: break-word; }

.badge {
  font-size: .72rem; font-weight: 800; letter-spacing: .3px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid rgb(197 140 255 / .45); background: rgb(197 140 255 / .14); color: #e2ccff;
  white-space: nowrap;
}
.badge.ok { border-color: rgb(34 197 94 / .45); background: rgb(34 197 94 / .12); color: var(--ok2); }
.badge.bad { border-color: rgb(248 113 113 / .45); background: rgb(248 113 113 / .12); color: #fca5a5; }
.badge.wait { border-color: rgb(251 191 36 / .45); background: rgb(251 191 36 / .12); color: var(--gold); }

.devs, .orders { display: grid; gap: 10px; }
.dev, .order { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: #151d33; border: 1px solid var(--line); }
.devTop, .orderTop { display: flex; align-items: center; gap: 9px; }
.orderTop { justify-content: space-between; }
.fp { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; color: #dbe4f7; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.devMeta { font-size: .82rem; color: #b9c6e0; }
.devMeta b { color: #fff; }
.devAct { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.devAct .inp { flex: 1 1 12rem; padding: 9px 11px; font-size: .88rem; border-radius: 11px; }
.devAct .copy { margin: 0; }
.dev .keyval, .order .keyval { max-height: 98px; overflow-y: auto; }

/* Nút "Lưu đơn này vào tài khoản" ở trang /don-hang/<token> */
.savebox { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.savebox .hint { margin-top: 8px; font-size: .84rem; }


