/* B7B SIM · Web tìm SIM. Màu và bố cục theo bộ mẫu đã duyệt (MAU_BO_CUC_DA_DUYET.zip · style.css).
   Mức tối thiểu của B7B UX/UI Pro: chữ thân 16px, vùng chạm 44×44 cách 8, tương phản 4,5:1 (chữ lớn 3:1), có focus,
   tôn trọng giảm chuyển động. Mọi kích thước chữ dùng rem để phóng 200% không vỡ. */
:root {
  --bg: #e8ecf1; --card: #f8fafc; --white: #ffffff; --navy: #112747; --blue: #1e3a8a; --gold: #946006; --gold-bright: #f3c65e;
  --line: #bdcbdc; --field: #71819a; --muted: #475569; --green: #166534; --red: #991b1b;
  --tint: #eef3f9; --warn-bg: #fff7e4; --warn-line: #d6bc7c; --warn-ink: #684406; --good-bg: #edf6ef; --good-line: #a9c6b4; --good-ink: #185932; --err-bg: #fff0f0; --err-line: #dba9a9;
  --focus: #a16207;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--navy); font: 1rem/1.5 'Be Vietnam Pro', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; overflow-wrap: break-word; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, textarea, select, summary, label { touch-action: manipulation; }
a { color: var(--blue); text-underline-offset: 3px; }
img, svg { max-width: 100%; }
h1, h2, h3, p, dl, dd, ol, ul, fieldset, legend { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.brand :focus-visible { outline-color: var(--gold-bright); }
main:focus, h1:focus, h2:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--white); color: var(--blue); padding: 10px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 8px; }
.icon { flex: none; width: 1.375rem; height: 1.375rem; }

/* ---------- đầu trang: một cụm B7B vàng / SIM trắng trên nền navy, logo PNG gốc ---------- */
.brand { background: var(--navy); color: var(--white); }
.brand-inner { max-width: 1160px; margin: 0 auto; padding: 9px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand-home { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; min-height: 48px; }
.brand-home img { width: 45px; height: 48px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; }
.wordmark { font-size: 1.4375rem; line-height: 1.15; font-weight: 700; letter-spacing: .02em; }
.wordmark b { color: var(--gold-bright); }
.brand-sub { font-size: 1rem; color: #d7e2f3; }
.menu-btn { margin-left: auto; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid #5b7096; border-radius: 10px; background: transparent; color: var(--white); cursor: pointer; }
#nav { display: none; flex-basis: 100%; flex-direction: column; gap: 8px; padding: 8px 0 6px; }
#nav.open { display: flex; }
#nav a { color: var(--white); min-height: 44px; display: flex; align-items: center; padding: 6px 10px; text-decoration: none; border: 1px solid #2b426b; border-radius: 10px; }
#nav a[aria-current=page] { color: var(--gold-bright); font-weight: 700; }
.demo-band { text-align: center; font-size: 1rem; font-weight: 600; padding: 7px 12px; background: #fff1ca; color: var(--warn-ink); border-bottom: 1px solid #d9bb72; }

main { max-width: 1120px; margin: 14px auto 0; padding: 0 12px 28px; }
.loading { padding: 40px 0; text-align: center; color: var(--muted); }
.outside { text-align: center; color: var(--muted); padding: 4px 16px 24px; }
.linkbar { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; }
.linkbar a, .inline-link { min-height: 44px; display: inline-flex; align-items: center; }

h1 { font-size: 1.625rem; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; line-height: 1.3; }
h3 { font-size: 1.0625rem; }
.eyebrow { font-weight: 700; color: var(--gold); margin-bottom: 4px; }
.lead, .subtle, .small { color: var(--muted); }
.stack > * + * { margin-top: 14px; }

/* ---------- thẻ, hàng tiền, thông báo ---------- */
.shell { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 32px #1127470b; }
.shell-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.shell-title { display: flex; align-items: center; gap: 12px; }
.layout { display: flex; flex-direction: column; gap: 20px; padding: 16px; }
.main-content { min-width: 0; }
.aside { border-top: 1px solid var(--line); padding-top: 16px; min-width: 0; }
.aside.only-wide { display: none; }
.panel { padding: 14px; background: var(--tint); border: 1px solid #c7d2e1; border-radius: 14px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.badge { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 1rem; font-weight: 600; color: var(--muted); background: #edf2f7; }
.sim-card .badge, .sim-table .badge { white-space: nowrap; }
.bullets { padding-left: 1.25rem; }
.badge.warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.sim-number { font-size: 1.875rem; line-height: 1.15; font-weight: 750; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.price { color: var(--gold); font-size: 1.5rem; font-weight: 700; }
.rows { display: grid; }
.row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid #dce3ed; }
.row:last-child { border-bottom: 0; }
.row dt { color: var(--muted); flex: 1 1 7rem; }
.row dd { text-align: right; font-weight: 600; flex: 1 1 7rem; min-width: 0; }
.row.total { font-size: 1.125rem; font-weight: 700; }
.row.total dt { color: var(--navy); }
.row.total dd { color: var(--gold); }
.notice { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 12px; color: var(--warn-ink); }
.notice.good { border-color: var(--good-line); background: var(--good-bg); color: var(--good-ink); }
.notice.error { border-color: var(--err-line); background: var(--err-bg); color: var(--red); }
.notice.neutral { border-color: var(--line); background: var(--tint); color: var(--navy); }
.notice strong { display: block; }

/* ---------- nút ---------- */
.btn { min-height: 48px; padding: 11px 18px; border-radius: 12px; border: 1px solid var(--blue); font-weight: 700; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--blue); background: var(--white); cursor: pointer; }
.btn.primary { color: var(--white); background: var(--blue); }
.btn.secondary { background: var(--tint); }
.btn.danger { color: var(--red); border-color: #c49999; }
.btn[aria-disabled=true], .btn:disabled { background: #dce2ed; color: #52627b; border-color: #b3becf; cursor: not-allowed; }
.text-btn { min-height: 44px; border: 0; background: transparent; color: var(--blue); font-weight: 600; cursor: pointer; padding: 6px 8px; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; gap: 6px; }
.actions { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.actions .btn { width: 100%; }
.actions-inline { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- biểu mẫu ---------- */
.fields { display: grid; gap: 14px; }
.field label, .field .label { display: block; font-weight: 650; margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; min-height: 48px; border: 1px solid var(--field); border-radius: 10px; padding: 10px 12px; background: var(--white); min-width: 0; }
.field textarea { resize: vertical; min-height: 76px; }
.field input::placeholder, .field textarea::placeholder { color: #5b6574; opacity: 1; }
.field [aria-invalid=true] { border: 2px solid var(--red); }
.field-error { margin-top: 6px; color: var(--red); display: flex; gap: 6px; align-items: flex-start; }
.hint { margin-top: 6px; color: var(--muted); }
.optional, .required { font-weight: 400; color: var(--muted); }
.pair { display: grid; gap: 14px; }
details.more { border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--white); }
details.more > summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 600; }
details.more[open] { padding-bottom: 12px; }
.choice-group { border: 0; }
.choice-group legend { font-weight: 700; margin-bottom: 8px; }
.choices { display: grid; gap: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid #8fa4c1; border-radius: 12px; padding: 12px; background: var(--white); cursor: pointer; min-height: 64px; }
.choice:has(input:checked) { border: 2px solid var(--blue); background: #edf2ff; padding: 11px; }
.choice input { margin: 4px 0 0; width: 20px; height: 20px; accent-color: var(--blue); flex: none; }
.choice strong, .choice small { display: block; }
.choice small { color: var(--muted); font-size: 1rem; }
.checkline { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; min-height: 44px; cursor: pointer; }
.checkline input { width: 22px; height: 22px; flex: none; accent-color: var(--blue); margin-top: 2px; }
.progress-label { font-weight: 700; color: #526580; }

/* ---------- tìm SIM ---------- */
.hero h1 { margin-bottom: 12px; }
.search-box { border: 2px solid #e3c477; background: var(--white); border-radius: 16px; padding: 14px; }
.search-row { display: grid; gap: 10px; }
.search-input { position: relative; }
.search-input input { padding-left: 44px; font-size: 1.125rem; }
.search-input .icon { position: absolute; left: 12px; top: 13px; color: var(--muted); }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.quick .btn { flex-direction: column; min-height: 72px; gap: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--navy); border-radius: 999px; padding: 0 4px 0 14px; min-height: 44px; }
.chip button { min-width: 44px; min-height: 44px; border: 0; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; color: var(--navy); }
.result-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sim-list { list-style: none; display: grid; gap: 10px; }
.sim-card { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; color: var(--navy); text-decoration: none; min-height: 72px; }
.sim-card .num { font-size: 1.375rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.sim-card .cost { color: var(--gold); font-weight: 700; font-size: 1.125rem; }
.sim-card .go { grid-column: 1 / -1; color: var(--blue); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.sim-card .carrier { justify-self: end; }
.sim-table { display: none; }
/* L-8: khổ hẹp, số SIM một dòng riêng; nhà mạng và giá xuống dòng dưới, không vỡ số. */
@media (max-width: 400px) {
  .sim-card .num { grid-column: 1 / -1; white-space: nowrap; }
  .sim-card .carrier { justify-self: start; }
}
.layout-home { display: grid; gap: 18px; }
.steps3 { list-style: none; display: grid; gap: 10px; }
.steps3 li { display: flex; gap: 10px; align-items: flex-start; }
.dot { flex: none; width: 28px; height: 28px; border: 1px solid #7891b3; border-radius: 50%; display: grid; place-items: center; background: #ecf2fa; font-weight: 700; font-size: 1rem; }
.dot.done { background: var(--blue); color: var(--white); border-color: var(--blue); }
.steps3 small { display: block; color: var(--muted); font-size: 1rem; }
.howto { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
.howto li { display: flex; align-items: center; gap: 8px; font-weight: 600; }

/* ---------- tìm nâng cao: bảng dưới trên điện thoại, hộp bên phải trên web ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: #11274780; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; overflow: hidden; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sheet-body { overflow-y: auto; padding: 16px; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 10px; align-items: center; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.sheet-foot .btn { flex: 1; }
.icon-btn { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.numbered { display: flex; gap: 10px; align-items: center; font-weight: 700; margin-bottom: 8px; }
.numbered .n { width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: var(--white); display: grid; place-items: center; font-size: 1rem; flex: none; }
.digits { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.digit { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 60px; min-width: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); cursor: pointer; font-weight: 700; font-size: 1.125rem; }
.digit:has(input:checked) { border: 2px solid var(--blue); background: #edf2ff; }
.digit input { width: 22px; height: 22px; accent-color: var(--blue); }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- trang trạng thái đơn ---------- */
.status-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none; background: #e4edff; border: 1px solid #9bafd4; color: var(--blue); }
.status-icon.good { background: #e5f2e8; color: var(--green); border-color: #9dbfa8; }
.status-icon.warn { background: #fff0cc; color: #855800; border-color: #d0b77b; }
.status-icon .icon { width: 28px; height: 28px; }
.order-id { display: flex; justify-content: space-between; align-items: center; background: #edf2f9; border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 14px; gap: 8px; flex-wrap: wrap; }
.order-id code, .rows code { font-family: inherit; font-weight: 700; font-size: 1.125rem; letter-spacing: .03em; }
.status-lines { display: grid; gap: 8px; }
.status-line { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; border: 1px solid var(--line); background: var(--white); border-radius: 12px; padding: 11px 12px; }
.status-line .k { color: var(--muted); display: flex; gap: 8px; align-items: center; }
.status-line b { grid-column: 1 / -1; }
.bank-card { background: #edf2fa; border: 1px solid #b4c6dd; border-radius: 14px; padding: 6px 14px; }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: 10px; }
.compare > div { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--white); min-width: 0; }
.compare .new { border-color: #e3c477; background: var(--warn-bg); }
.compare strong { display: block; font-size: 1.25rem; color: var(--gold); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.cta .btn.primary { flex: 1 1 100%; min-height: 52px; font-size: 1.125rem; }
.cta .btn.secondary { flex: 1 1 9rem; }
.compare .old strong { color: var(--muted); text-decoration: line-through; }
pre.doc { white-space: pre-wrap; font: inherit; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px; overflow-wrap: anywhere; }
.pending-tag { display: inline-block; background: #fff1ca; color: var(--warn-ink); border: 1px dashed #b98a1e; border-radius: 6px; padding: 0 6px; font-weight: 600; }

/* ---------- từ 600px: chữ số một hàng, hai cột ô nhập ---------- */
@media (min-width: 600px) {
  .digits { grid-template-columns: repeat(10, 1fr); }
  .pair { grid-template-columns: 1fr 1fr; }
  .choices { grid-template-columns: 1fr 1fr; }
  .actions { flex-direction: row-reverse; justify-content: flex-start; flex-wrap: wrap; }
  .actions .btn { width: auto; min-width: 180px; }
  .actions .left { margin-right: auto; }
  .status-line { grid-template-columns: 11rem 1fr; }
  .status-line b { grid-column: auto; }
}
/* ---------- từ 768px: thẻ hai cột, tìm nâng cao thành hộp bên phải ---------- */
@media (min-width: 768px) {
  .brand-inner { padding: 12px 28px; flex-wrap: nowrap; gap: 14px; }
  .brand-home img { width: 62px; height: 66px; }
  .wordmark { font-size: 1.8125rem; }
  .brand-sub { font-size: 1rem; }
  .menu-btn { display: none; }
  #nav, #nav.open { display: flex; flex-direction: row; flex-basis: auto; margin-left: auto; gap: 22px; padding: 0; }
  #nav a { border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 6px 4px; }
  #nav a[aria-current=page] { border-bottom-color: var(--gold-bright); color: var(--white); }
  main { margin-top: 24px; padding: 0 24px 40px; }
  h1 { font-size: 1.875rem; }
  .shell { border-radius: 22px; }
  .shell-head { padding: 22px 26px 14px; }
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 28px; padding: 24px 26px; }
  .layout.single { grid-template-columns: minmax(0, 1fr); max-width: 820px; margin: 0 auto; }
  .aside { border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 26px; }
  .aside.only-wide { display: block; }
  .only-narrow { display: none; }
  .actions { padding: 16px 26px 20px; }
  .search-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .quick { display: none; }
  .sheet-backdrop { align-items: stretch; justify-content: flex-end; }
  .sheet { width: 560px; max-height: none; border-radius: 0; }
}
/* ---------- từ 1024px: bảng kết quả và thẻ Ba Lớp bên cạnh ---------- */
@media (min-width: 1024px) {
  .layout-home { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .sim-list.as-table { display: none; }
  .sim-table { display: table; width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
  .sim-table th { text-align: left; font-weight: 700; color: var(--muted); padding: 10px 14px; background: #edf2f7; }
  .sim-table td { padding: 8px 14px; border-top: 1px solid #dce3ed; vertical-align: middle; }
  .sim-table .num { font-size: 1.25rem; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .sim-table .cost { color: var(--gold); font-weight: 700; font-size: 1.125rem; white-space: nowrap; }
  .sim-table .btn { min-height: 44px; padding: 8px 14px; white-space: nowrap; }
}
@media (max-width: 767.98px) { .only-wide-inline { display: none; } }
@media (prefers-reduced-motion: no-preference) {
  .btn, .choice, .digit, .sim-card { transition: background-color .15s ease, border-color .15s ease; }
  .sheet { animation: rise .18s ease-out; }
  @keyframes rise { from { transform: translateY(16px); opacity: .6; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media (hover: hover) { .btn.primary:hover { background: #18306f; } .btn:not(.primary):hover { background: #e3ebf7; } .sim-card:hover { border-color: var(--blue); } }

/* ---------- bàn trực giả lập (chỉ có ở bộ tiếp hợp giả) ---------- */
.ops main { max-width: 1160px; }
.ops-order > summary { cursor: pointer; min-height: 48px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ops-order[open] > summary { margin-bottom: 8px; }
.ops-bells { display: grid; gap: 14px; }
.ops-bell { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--white); margin-top: 8px; }
.ops-bell.done { background: var(--tint); color: var(--muted); }
.ops label input { display: block; width: 100%; min-height: 44px; border: 1px solid var(--field); border-radius: 10px; padding: 8px 10px; margin-top: 4px; background: var(--white); }
@media (min-width: 900px) { .ops-bells { grid-template-columns: repeat(4, 1fr); } }
