/* ThanhToanGon — Checkout shared styles (chung cho mọi trang checkout-form).
   CSS riêng từng trang (multi-email, textarea, lightbox, plan-card override…) nằm inline trong <style> của trang đó. */

* { box-sizing: border-box; margin: 0; padding: 0; }
*::before { box-sizing: border-box; margin: 0; padding: 0; }
*::after { box-sizing: border-box; margin: 0; padding: 0; }
:root { --blue-dark: #1B4F72; --blue-mid: #2980B9; --blue-light: #EBF5FB; --teal: #148F77; --gray-text: #4A5568; --gray-light: #F7FAFC; --border: #CBD5E0; --red: #C53030; }
body { font-family: "Segoe UI", Arial, sans-serif; background: #F0F4F8; min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 40px 16px 60px; color: #2D3748; }
.header { text-align: center; margin-bottom: 28px; max-width: 520px; }
.header .badge { display: inline-block; background: var(--blue-mid); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 4px 14px; border-radius: 20px; margin-bottom: 12px; }
#brandName.badge { font-size: 18px; font-weight: 700; letter-spacing: .02em; text-transform: none; padding: 6px 20px; border-radius: 24px; margin-bottom: 14px; }
.header h1 { font-size: 24px; font-weight: 700; color: var(--blue-dark); line-height: 1.3; margin-bottom: 8px; }
.header p { font-size: 14px; color: var(--gray-text); line-height: 1.6; }
.layout { display: flex; gap: 24px; width: 100%; max-width: 900px; align-items: flex-start; }
@media (max-width: 680px) {
  .layout { flex-direction: column; }
}
.card { background: #fff; border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,.08); padding: 32px; flex: 1; }
@media (max-width: 600px) {
  .card { padding: 24px 18px; }
}
.section-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-mid); margin: 22px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--blue-light); }
.section-label:first-of-type { margin-top: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: #2D3748; margin-bottom: 6px; }
.field label .req { color: var(--red); margin-left: 2px; }
.field label .hint { display: block; font-size: 11.5px; font-weight: 400; color: #718096; margin-top: 2px; }
input { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; color: #2D3748; background: #fff; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none; }
select { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; color: #2D3748; background: #fff; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none; }
input:focus { outline: none; border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(41,128,185,.12); }
select:focus { outline: none; border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(41,128,185,.12); }
input.error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(197,48,48,.1); }
select.error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(197,48,48,.1); }
.error-msg { font-size: 12px; color: var(--red); margin-top: 5px; display: none; }
.error-msg.show { display: block; }
.select-wrap { position: relative; }
.select-wrap::after { content: "▾"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: #718096; font-size: 13px; }
.select-wrap select { padding-right: 34px; }
.btn-submit { width: 100%; padding: 13px; background: var(--blue-dark); color: #fff; font-size: 15px; font-weight: 700; border: none; border-radius: 10px; cursor: pointer; margin-top: 8px; transition: background .15s, transform .1s; }
.btn-submit:hover:not(:disabled) { background: #1a3f5c; }
.btn-submit:active:not(:disabled) { transform: scale(.99); }
.btn-submit:disabled { background: #A0AEC0; cursor: not-allowed; }
.btn-submit .btn-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; margin-right: 8px; }
.qr-card { background: #fff; border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,.08); padding: 28px 24px; width: 450px; flex-shrink: 0; text-align: center; }
@media (max-width: 680px) {
  .qr-card { width: 100% !important; }
}
.qr-title { font-size: 13px; font-weight: 700; color: var(--blue-dark); margin-bottom: 14px; }
.qr-wrap { position: relative; width: 240px; height: 240px; margin: 0 auto 14px; border-radius: 10px; overflow: hidden; background: #EDF2F7; }
.qr-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; opacity: 0; transition: opacity .25s; }
.qr-wrap img.loaded { opacity: 1; }
.qr-skeleton { position: absolute; inset: 0; background: linear-gradient(90deg, #EDF2F7 25%, #E2E8F0 50%, #EDF2F7 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; }
.qr-skeleton.hidden { display: none; }
.qr-skeleton.waiting { animation: none; background: #EDF2F7; }
.qr-skeleton.waiting .qr-spinner { display: none; }
.qr-skeleton-hint { font-size: 12px; font-weight: 500; color: #4A5568; text-align: center; line-height: 1.6; display: none; }
.qr-skeleton.waiting .qr-skeleton-hint { display: block; }
@keyframes shimmer {
  to { background-position: -200% 0; }
}
.qr-spinner { width: 32px; height: 32px; border: 3px solid rgba(41,128,185,.2); border-top-color: var(--blue-mid); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin {
  to { transform: rotate(360deg); }
}
.qr-note { font-size: 11.5px; color: #718096; line-height: 1.55; margin-bottom: 16px; }
.transfer-label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--blue-mid); margin-bottom: 10px; text-align: left; }
.info-row { display: flex; justify-content: space-between; align-items: flex-start; font-size: 12.5px; padding: 7px 0; border-bottom: 1px solid #EDF2F7; text-align: left; gap: 8px; }
.info-row:last-child { border-bottom: none; }
.info-key { color: #718096; flex-shrink: 0; width: 90px; line-height: 1.5; }
.info-val { font-weight: 600; color: #2D3748; word-break: break-all; line-height: 1.5; flex: 1; }
.info-val.accent { color: var(--blue-dark); }
.btn-inline-copy { flex-shrink: 0; padding: 3px 10px; font-size: 11px; font-weight: 600; background: var(--blue-light); color: var(--blue-dark); border: 1px solid #BEE3F8; border-radius: 5px; cursor: pointer; white-space: nowrap; transition: background .15s; align-self: center; }
.btn-inline-copy:hover { background: #BEE3F8; }
.btn-inline-copy.copied { background: #C6F6D5; color: var(--teal); border-color: #9AE6B4; }
.warning-note { display: flex; gap: 8px; background: #FFFBEB; border: 1.5px solid #F6E05E; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #744210; line-height: 1.55; text-align: left; margin-top: 14px; }
.warning-note .icon { flex-shrink: 0; }
.success-note { background: #F0FFF4; border: 1.5px solid #9AE6B4; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #276749; line-height: 1.55; text-align: left; margin-top: 12px; }
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15, 30, 50, 0.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 999; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,.15); padding: 32px 28px 24px; max-width: 380px; width: 100%; text-align: center; animation: popIn .2s ease-out; }
@keyframes popIn {
  from { transform: scale(.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-icon { width: 56px; height: 56px; background: #F0FFF4; border: 2px solid #9AE6B4; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 26px; }
.modal h3 { font-size: 17px; font-weight: 700; color: var(--blue-dark); margin-bottom: 10px; }
.modal p { font-size: 14px; color: var(--gray-text); line-height: 1.65; margin-bottom: 24px; }
.btn-modal-close { width: 100%; padding: 11px; background: var(--blue-dark); color: #fff; font-size: 14px; font-weight: 700; border: none; border-radius: 10px; cursor: pointer; transition: background .15s; }
.btn-modal-close:hover { background: #1a3f5c; }
.page-state { text-align: center; padding: 60px 20px; color: var(--gray-text); font-size: 15px; max-width: 400px; }
.page-state .big-spinner { width: 48px; height: 48px; border: 4px solid rgba(41,128,185,.2); border-top-color: var(--blue-mid); border-radius: 50%; animation: spin .75s linear infinite; margin: 0 auto 20px; }
.page-state.error-state { color: var(--red); }
.product-desc { width: 100%; max-width: 900px; margin-bottom: 28px; }
.product-desc-header { background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 100%); border-radius: 16px 16px 0 0; padding: 28px 32px 24px; color: #fff; }
.product-desc-header .series-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .8; margin-bottom: 8px; }
.product-desc-header h2 { font-size: 20px; font-weight: 800; line-height: 1.3; margin-bottom: 10px; }
.product-desc-header .tagline { font-size: 13.5px; opacity: .9; line-height: 1.6; }
.product-desc-body { background: #fff; border: 1.5px solid #E2E8F0; border-top: none; border-radius: 0 0 16px 16px; padding: 24px 32px; }
.product-target { background: var(--blue-light); border-left: 4px solid var(--blue-mid); border-radius: 0 8px 8px 0; padding: 14px 18px; margin-bottom: 24px; font-size: 13.5px; line-height: 1.8; color: #2D3748; }
.product-target strong { color: var(--blue-dark); }
@media (max-width: 680px) {
  .product-desc-header { padding-left: 20px; padding-right: 20px; }
  .product-desc-body { padding-left: 20px; padding-right: 20px; }
}
.plan-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 10px; border-radius: 20px; margin-bottom: 10px; }
.plan-card .plan-topic { font-size: 16px; font-weight: 800; color: var(--blue-dark); margin-bottom: 14px; line-height: 1.5; padding-bottom: 12px; border-bottom: 2px solid #E2E8F0; }
.plan-bullets { list-style: none; font-size: 13px; color: #4A5568; line-height: 1.7; }
.plan-bullets li::before { content: "✦ "; color: var(--blue-mid); font-size: 10px; }
.product-footer { background: #FFFBEB; border: 1.5px solid #F6E05E; border-radius: 10px; padding: 12px 18px; font-size: 13px; color: #744210; line-height: 1.6; display: flex; gap: 10px; align-items: flex-start; }
.version-tag { margin-top: 16px; font-size: 11px; color: #A0AEC0; font-family: "Courier New", monospace; letter-spacing: .04em; }
#tsOverlay { position: fixed; inset: 0; z-index: 9999; background: rgba(240, 244, 248, 0.97); backdrop-filter: blur(6px); display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity .5s ease; }
.ts-card { background: #fff; border: 1.5px solid #CBD5E0; border-radius: 16px; box-shadow: 0 8px 40px rgba(41, 128, 185, .15); padding: 36px 40px 32px; display: flex; flex-direction: column; align-items: center; gap: 20px; max-width: 340px; width: 100%; }
.ts-logo { display: flex; align-items: center; gap: 10px; }
.ts-logo img { width: 36px; height: 36px; border-radius: 8px; }
.ts-logo-text { font-family: "Segoe UI", Arial, sans-serif; font-size: 15px; font-weight: 700; color: #1B4F72; letter-spacing: .01em; }
.ts-title { font-family: "Segoe UI", Arial, sans-serif; font-size: 14px; color: #4A5568; text-align: center; line-height: 1.6; }
.ts-title strong { color: #1B4F72; }
@keyframes shimmer {
  0% { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.skeleton-page { width: 100%; max-width: 900px; display: flex; flex-direction: column; align-items: center; }
.skel { background: linear-gradient(90deg, #e2e8f0 25%, #f0f4f8 50%, #e2e8f0 75%); background-size: 600px 100%; animation: shimmer 1.5s ease-in-out infinite; border-radius: 6px; }
.skel-header-block { width: 100%; max-width: 520px; text-align: center; margin-bottom: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.skel-badge { width: 130px; height: 22px; border-radius: 20px; }
.skel-h1 { width: 280px; height: 30px; border-radius: 8px; margin: 2px 0; }
.skel-text { height: 14px; border-radius: 4px; }
.skel-text.w90 { width: 90%; }
.skel-text.w60 { width: 60%; }
.skel-layout { width: 100%; display: flex; gap: 24px; align-items: flex-start; }
.skel-card { flex: 1; background: #fff; border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,.08); padding: 32px; display: flex; flex-direction: column; gap: 0; }
.skel-section-label { height: 11px; width: 120px; border-radius: 4px; margin-bottom: 14px; }
.skel-field { margin-bottom: 18px; }
.skel-field-label { height: 12px; width: 80px; border-radius: 4px; margin-bottom: 6px; }
.skel-input { height: 42px; width: 100%; border-radius: 8px; }
.skel-select { height: 42px; width: 100%; border-radius: 8px; }
.skel-divider { height: 1px; background: var(--border); margin: 8px 0 20px; border-radius: 0; animation: none; }
.skel-captcha { height: 65px; width: 300px; border-radius: 6px; margin: 0 auto 20px; }
.skel-btn { height: 48px; width: 100%; border-radius: 10px; }
.skel-qr-panel { width: 450px; flex-shrink: 0; background: #fff; border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,.08); padding: 28px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.skel-qr-title { height: 14px; width: 180px; border-radius: 4px; }
.skel-qr-img { height: 220px; width: 220px; border-radius: 8px; }
.skel-qr-line { height: 12px; border-radius: 4px; }
.skel-qr-line.w80 { width: 80%; }
.skel-qr-line.w60 { width: 60%; }
@media (max-width: 680px) {
  .skel-layout { flex-direction: column; }
  .skel-qr-panel { width: 100%; }
}
@media (max-width: 600px) {
  .skel-card { padding: 24px 18px; }
}
textarea { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; color: #2D3748; background: #fff; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none; }
textarea { resize: vertical; }
textarea:focus { outline: none; border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(41,128,185,.12); }
textarea.error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(197,48,48,.1); }

.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-option { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.radio-option input[type="radio"] { appearance: auto; -webkit-appearance: auto; width: 16px; height: 16px; min-width: 16px; padding: 0; border: none; border-radius: 50%; box-shadow: none; position: relative; top: 3px; flex-shrink: 0; accent-color: var(--blue-mid); cursor: pointer; }
.radio-option span { font-size: 13.5px; font-weight: 400; color: #2D3748; line-height: 1.5; }
input[type="date"] { color: #2D3748; }

input:disabled { background: #F7FAFC; color: #718096; cursor: not-allowed; }
select:disabled { background: #F7FAFC; color: #718096; cursor: not-allowed; }

/* Lightbox styles (dùng chung cho mọi trang có lightbox, như multi-email, plan-card override…) */
.img-zoomable { cursor: zoom-in; transition: opacity .15s; }
.img-zoomable:hover { opacity: .88; }
.lightbox-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .88); z-index: 1000; overflow: hidden; touch-action: none; }
.lightbox-overlay.show { display: block; }
.lightbox-viewport { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lightbox-viewport img { max-width: 90vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 8px 48px rgba(0,0,0,.5); object-fit: contain; transform-origin: center center; transition: transform .15s ease; user-select: none; -webkit-user-drag: none; }
.lightbox-viewport img.is-dragging { transition: none; }
.lightbox-close { position: fixed; top: 16px; right: 20px; width: 36px; height: 36px; background: rgba(101, 101, 101, 0.85); border: none; border-radius: 50%; color: #fff; font-size: 20px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; z-index: 1001; box-shadow: 0 2px 8px rgba(0,0,0,.5), 0 0 0 1.5px rgba(255,255,255,.2); }
.lightbox-close:hover { background: rgba(151, 151, 151, 0.65); }
.lightbox-zoom-badge { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.5); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 14px; border-radius: 20px; pointer-events: none; opacity: 0; transition: opacity .25s; z-index: 1001; }
.lightbox-zoom-badge.visible { opacity: 1; }
.lightbox-hint { position: absolute; bottom: 16px; left: 0; right: 0; color: rgba(255,255,255,.75); font-size: 12px; text-align: center; pointer-events: none; }

/* ── Voucher (mã ưu đãi) — dùng chung, UI do checkout-voucher.js chèn ── */
.voucher-row { display: flex; gap: 8px; align-items: stretch; }
.voucher-input-wrap { position: relative; flex: 1; display: flex; align-items: stretch; }
.voucher-input-wrap input { flex: 1; padding-right: 32px; }
.btn-clear-voucher { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: none; align-items: center; justify-content: center; width: 22px; height: 22px; border: none; background: #E2E8F0; color: #4A5568; border-radius: 50%; font-size: 15px; line-height: 1; cursor: pointer; transition: background .15s, color .15s; }
.btn-clear-voucher:hover { background: #CBD5E0; color: #1A202C; }
.voucher-row input { flex: 1; }
.btn-apply-voucher { flex-shrink: 0; padding: 0 18px; background: var(--blue-light); color: var(--blue-dark); border: 1.5px solid #BEE3F8; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .15s; display: inline-flex; align-items: center; justify-content: center; min-width: 84px; }
.btn-apply-voucher:hover:not(:disabled) { background: #BEE3F8; }
.btn-apply-voucher:disabled { opacity: .6; cursor: not-allowed; }
.btn-apply-voucher .btn-spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(27,79,114,.3); border-top-color: var(--blue-dark); border-radius: 50%; animation: spin .7s linear infinite; }
.voucher-result { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding: 10px 14px; background: #F0FFF4; border: 1.5px solid #9AE6B4; border-radius: 8px; font-size: 13px; }
.voucher-result .vr-label { font-weight: 600; color: var(--teal); }
.voucher-result .vr-original { color: #718096; text-decoration: line-through; }
.voucher-result .vr-final { font-weight: 800; color: var(--blue-dark); font-size: 15px; }
.voucher-result .vr-tag { margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--teal); background: #C6F6D5; padding: 3px 9px; border-radius: 12px; }
