/* Giao diện chép từ trang soi da nội bộ (soida-baotran.pages.dev) để đồng bộ thương hiệu Bảo Trân.
   Chủ đề sáng duy nhất (giống trang cũ). Hồng Bảo Trân chỉ dùng cho logo. */
:root {
  --bg: #f4f9fc; --bg-2: #e8f4f9;
  --glass: rgba(255, 255, 255, 0.72); --glass-strong: rgba(255, 255, 255, 0.92);
  --edge: rgba(60, 200, 232, 0.38); --edge-soft: rgba(60, 200, 232, 0.2);
  --ink: #0f2a3d; --ink-2: #2c4a5e; --ink-3: #4f6b7d;
  --cyan: #3cc8e8; --cyan-2: #5ad6e6; --cyan-deep: #0e8fb0; --blue-soft: #cfe9f7; --track: #dcecf4;
  --ok: #0f7a5a; --bad: #b3263e;
  --logo: #b23a6e;
  --glow: 0 0 0 1px rgba(60, 200, 232, 0.35), 0 0 18px rgba(60, 200, 232, 0.28);
  --shadow: 0 6px 24px rgba(15, 42, 61, 0.06);
  --font-ui: "Be Vietnam Pro", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-num: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --font-logo: "Lora", Georgia, serif;
  --r: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  color: var(--ink); font: 16px/1.55 var(--font-ui); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(60% 30% at 15% 0%, rgba(90, 214, 230, 0.16), transparent 70%),
    radial-gradient(50% 25% at 90% 8%, rgba(207, 233, 247, 0.9), transparent 70%),
    linear-gradient(180deg, #f7fbfd 0%, var(--bg) 40%, var(--bg-2) 100%);
  background-color: var(--bg);
}
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
p { margin: 0; }
a { color: var(--cyan-deep); }

.wrap { max-width: 560px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* đầu trang */
header.top { position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,.86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--edge-soft); padding-top: env(safe-area-inset-top, 0px); }
.brandrow { display: flex; align-items: center; gap: 10px; padding-block: 10px; }
.brand { font: italic 600 24px/1 var(--font-logo); color: var(--logo); }
.brand small { display: block; font: 600 11px/1.4 var(--font-ui); letter-spacing: .14em; color: var(--ink-2); font-style: normal; margin-top: 4px; }
.brandrow .sp { flex: 1; }
.progress { font: 600 13px/1 var(--font-ui); color: var(--ink-2); white-space: nowrap; }
.progress b { font-family: var(--font-num); color: var(--cyan-deep); }
.bar { height: 3px; background: var(--track); }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan-2), var(--cyan)); transition: width .25s; }

main { padding-block: 18px calc(28px + env(safe-area-inset-bottom, 0px)); }
.screen { display: grid; gap: 16px; }
.screen:focus { outline: none; }

h1 { font-size: 24px; line-height: 1.25; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0; display: flex; align-items: center; gap: 8px; }
h2::before { content: ""; width: 12px; height: 13px; flex: none; background: var(--cyan); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); opacity: .85; }
.lead { color: var(--ink-2); }

/* tấm kính */
.card { background: var(--glass); border: 1px solid var(--edge); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 14px; min-width: 0; }

/* nút */
.btn { appearance: none; border: 1px solid var(--cyan); border-radius: 12px; padding: 14px 18px; font-weight: 700; font-size: 16px; cursor: pointer; width: 100%; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px;
  background: linear-gradient(180deg, #5ad6e6, #3cc8e8); color: var(--ink); box-shadow: 0 0 20px rgba(60,200,232,.35); -webkit-tap-highlight-color: transparent; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn.sec { background: #fff; box-shadow: none; }
.btn-ghost { white-space: nowrap; background: var(--glass); border: 1px solid var(--edge); border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink); }
.btn-link { background: none; border: 0; padding: 6px 0; color: var(--cyan-deep); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.actions { display: grid; gap: 10px; }
.back { justify-self: start; display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 4px 0; font-weight: 600; color: var(--ink-2); cursor: pointer; font-size: 15px; }
.back::before { content: "‹"; font-size: 22px; line-height: 1; margin-top: -2px; }

/* ô nhập */
.field { display: grid; gap: 6px; }
.field > label, .field > .lbl { font-weight: 600; font-size: 16px; }
.req { color: var(--bad); margin-left: 2px; }
.hint { font-size: 14px; color: var(--ink-2); }
input[type=text], input[type=tel], input[type=number], select, textarea { width: 100%; border: 1px solid var(--edge); background: var(--glass-strong); border-radius: 10px; padding: 12px; font-size: 16px; min-height: 48px; }
textarea { min-height: 76px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, .chip:focus-within { outline: 2px solid var(--cyan-deep); outline-offset: 2px; }
.field.has-err input, .field.has-err select, .field.has-err textarea { border-color: var(--bad); background: #fff7f8; }
.err { color: var(--bad); font-size: 14.5px; font-weight: 600; display: flex; gap: 6px; align-items: flex-start; }
.err::before { content: "!"; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--bad); color: #fff; font: 700 12px/18px var(--font-ui); text-align: center; margin-top: 2px; }
.err:empty { display: none; }
.group-title { font: 700 12.5px/1.3 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--cyan-deep); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-block; border: 1px solid var(--edge); border-radius: 999px; padding: 9px 15px; font-size: 15px; background: var(--glass-strong); }
.chip input:checked + span { background: #fff; border-color: var(--cyan); box-shadow: var(--glow); font-weight: 700; }
.chip input:checked + span::before { content: "✓ "; color: var(--cyan-deep); }

.consent { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: rgba(207,233,247,.55); border: 1px solid var(--edge-soft); cursor: pointer; }
.consent input { width: 24px; height: 24px; accent-color: var(--cyan-deep); flex: none; margin: 1px 0 0; }
.consent.has-err { border-color: var(--bad); background: #fff7f8; }

.disc { font-size: 13.5px; color: var(--ink-3); text-align: center; padding-top: 4px; }

/* màn mở đầu */
.hero { display: grid; gap: 10px; text-align: center; padding-top: 6px; }
.hero h1 { font-size: 27px; }
.steps3 { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.steps3 li { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; background: var(--glass); border: 1px solid var(--edge); border-radius: var(--r); padding: 12px; }
.steps3 .ic { width: 52px; height: 52px; border-radius: 14px; background: #fff; border: 1px solid var(--edge); display: grid; place-items: center; position: relative; color: var(--cyan-deep); }
.steps3 .ic svg { width: 28px; height: 28px; }
.steps3 .ic::after { counter-increment: s; content: counter(s); position: absolute; top: -7px; left: -7px; width: 22px; height: 22px; border-radius: 50%; background: var(--cyan); color: var(--ink); font: 700 12px/22px var(--font-num); text-align: center; }
.steps3 b { display: block; font-size: 16px; }
.steps3 span { font-size: 14px; color: var(--ink-2); }
.small-note { text-align: center; font-size: 14px; color: var(--ink-2); }

/* hướng dẫn chụp */
.tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.tips li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; font-size: 15.5px; }
.tips li::before { content: "✓"; width: 24px; height: 24px; border-radius: 50%; background: var(--blue-soft); color: var(--cyan-deep); font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.samples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sample { display: grid; gap: 6px; text-align: center; }
.sample .pic { aspect-ratio: 3/4; border-radius: 12px; background: linear-gradient(180deg, #ffffff, #eaf5fa); border: 1px solid var(--edge); display: grid; place-items: center; overflow: hidden; }
.sample .pic svg { width: 86%; height: auto; }
.sample b { font-size: 14px; }
.sample span { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }

/* chọn ảnh */
.slots { display: grid; gap: 12px; }
.slot { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; background: var(--glass); border: 1px solid var(--edge); border-radius: var(--r); padding: 10px; }
.slot.has-err { border-color: var(--bad); background: #fff7f8; }
.slot .thumb { width: 96px; aspect-ratio: 3/4; border-radius: 10px; background: #fff; border: 1px dashed var(--edge); display: grid; place-items: center; overflow: hidden; position: relative; }
.slot .thumb img { width: 100%; height: 100%; object-fit: cover; }
.slot .thumb svg { width: 70%; opacity: .55; }
.slot .thumb .spin { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.75); font-size: 12px; color: var(--ink-2); text-align: center; padding: 4px; }
.slot.filled .thumb { border-style: solid; border-color: var(--cyan); }
.slot .info { display: grid; gap: 6px; min-width: 0; }
.slot .ttl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.tag { font: 700 11.5px/1 var(--font-ui); padding: 4px 8px; border-radius: 999px; background: var(--blue-soft); color: var(--cyan-deep); }
.tag.must { background: rgba(179,38,62,.1); color: var(--bad); }
.slot .sub { font-size: 13.5px; color: var(--ink-2); }
.slot .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--cyan); background: #fff; color: var(--ink); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14px; cursor: pointer; min-height: 40px; }
.pill input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.pill.rm { border-color: rgba(179,38,62,.4); color: var(--bad); }
.pill svg { width: 16px; height: 16px; }

/* xem lại */
.review { display: grid; gap: 10px; }
.review-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-bottom: 1px dashed var(--edge-soft); padding-bottom: 8px; }
.review-row:last-child { border-bottom: 0; padding-bottom: 0; }
.review-row .k { color: var(--ink-2); font-size: 14.5px; flex: none; }
.review-row .v { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.review-thumbs { display: flex; gap: 6px; }
.review-thumbs img { width: 44px; height: 58px; object-fit: cover; border-radius: 6px; border: 1px solid var(--edge); }

/* cảm ơn */
.done { text-align: center; display: grid; gap: 14px; justify-items: center; padding-top: 10px; }
.done .ok { width: 76px; height: 76px; border-radius: 50%; background: #fff; border: 2px solid var(--cyan); box-shadow: var(--glow); display: grid; place-items: center; color: var(--cyan-deep); }
.done .ok svg { width: 40px; height: 40px; }
.ticket { font: 700 22px/1.2 var(--font-num); letter-spacing: .06em; color: var(--ink); background: #fff; border: 1px dashed var(--cyan); border-radius: 10px; padding: 8px 16px; }

.alert { border-radius: 12px; padding: 12px 14px; background: #fff7f8; border: 1px solid rgba(179,38,62,.35); color: var(--bad); font-weight: 600; font-size: 15px; }
.turnstile-box { min-height: 0; display: flex; justify-content: center; }
.turnstile-box:not(:empty) { min-height: 65px; }

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

/* chỉnh sau lần chụp thử đầu */
.slot { grid-template-columns: 84px 1fr; }
.slot .thumb { width: 84px; }
.slot .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot .btns .pill { justify-content: center; padding: 8px 6px; }
.slot .btns .pill.rm { grid-column: 1 / -1; }
#khoi-ma { display: grid; justify-items: center; gap: 6px; }
.review-row { align-items: center; }
.slot .btns .pill { white-space: nowrap; gap: 5px; padding: 8px 4px; font-size: 14px; }
.slot .btns .pill svg { width: 15px; height: 15px; flex: none; }
@media (max-width: 370px) { .slot { grid-template-columns: 72px 1fr; gap: 10px; } .slot .thumb { width: 72px; } }

/* ---------- luồng mới: đăng nhập, kết quả ---------- */
a.brand { text-decoration: none; }
.top-nav { display: flex; gap: 6px; }
.btn-ghost.solid { background: linear-gradient(180deg, #5ad6e6, #3cc8e8); border-color: var(--cyan); }
.ok-note, .warn-note { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; font-weight: 600; margin: 0; }
.ok-note { color: var(--ok); }
.ok-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.warn-note { color: #8a5a00; background: rgba(255, 244, 214, .85); border: 1px solid rgba(214, 160, 40, .45); border-radius: 8px; padding: 6px 8px; font-weight: 500; }
.spin-ring { border-color: var(--track) !important; border-top-color: var(--cyan) !important; border-width: 5px !important; animation: quay 1s linear infinite; }
@keyframes quay { to { transform: rotate(360deg); } }
.locked { position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--edge); background: #fff; }
.locked-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; filter: blur(6px) saturate(.9); transform: scale(1.04); }
.locked-grid img { width: 100%; border-radius: 8px; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.locked-cover { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; background: rgba(244, 249, 252, .45); color: var(--ink); padding: 16px; }
.locked-cover svg { width: 46px; height: 46px; color: var(--cyan-deep); background: #fff; border-radius: 50%; padding: 10px; box-shadow: var(--glow); }
.locked-cover b { font-size: 18px; background: rgba(255,255,255,.85); padding: 4px 12px; border-radius: 999px; }
.pw { position: relative; }
.pw input { padding-right: 64px; }
.pw-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--cyan-deep); font-weight: 600; padding: 8px; cursor: pointer; }
details.more { border: 1px dashed var(--edge); border-radius: 12px; padding: 10px 12px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--cyan-deep); }
details.more .more-in { display: grid; gap: 14px; margin-top: 12px; }
.pages { display: grid; gap: 12px; }
.pages figure { margin: 0; }
.pages img { width: 100%; border-radius: 12px; border: 1px solid var(--edge); box-shadow: var(--shadow); }
.actions.two { grid-template-columns: 1fr 1fr; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.history li { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--glass); border: 1px solid var(--edge); border-radius: 12px; padding: 10px 12px; }
.history li > div { display: grid; }
.history a.pill { text-decoration: none; }
.small-note .btn-link { font-size: inherit; }
@media (max-width: 370px) { .top-nav .btn-ghost { padding: 6px 10px; font-size: 13px; } .brand { font-size: 21px; } }
input[type=password] { width: 100%; border: 1px solid var(--edge); background: var(--glass-strong); border-radius: 10px; padding: 12px; font-size: 16px; min-height: 48px; }
.field.has-err input[type=password] { border-color: var(--bad); background: #fff7f8; }
#kq-noi-dung, #tk-noi-dung { display: grid; gap: 16px; }
