/* =====================================================================
   VỎ CALCULATOR ĐỘC LẬP — hệ hiển thị chung các sản phẩm tương tác Soha
   Lấy nguyên từ lõi CSS khảo sát (HT9: thang chữ, lưới 4 px, màu WCAG AA,
   vùng chạm, tiêu điểm, giảm chuyển động; HT11 skin; HT5, HT5a dải cuối và
   logo; HT13 đọc thêm). Phần riêng của calculator ở cuối tệp.
   ===================================================================== */

:root {
    --bg:         transparent;
    --card:       #fff;
    --text:       #2a2d31;
    --text-head:  #16181a;
    --text-sub:   #6f6b63;   /* chữ phụ: 5,3:1 */
    --text-faint: #77736b;   /* chữ mờ nhất còn được phép: 4,6:1 */
    --text-muted: #6b7280;
    --text-mid:   #5a5d62;
    --brand:      #00c4b4;   /* nhấn mảnh: thanh, viền — không làm nền cho chữ */
    --brand-deep: #00796b;   /* nền tô đầy có chữ trắng */
    --brand-press:#00695c;
    --ink:        #16181a;
    --ok:         #16a34a;
    --bad:        #c81e1e;
    --border:     #e7e4dd;   /* đường chia, rãnh */
    --border-ctl: #d6d1c7;   /* viền khối bấm được: hàng lựa chọn, nút phụ */
    --light-gray: #ecebe7;
    --dark-gray:  #6f6b63;
    --bg-hover:   #f1faf8;
    --bg-soft:    #faf9f7;
    --focus:      #00796b;
    --brand-ink:  #0a6a60;   /* chữ trên nền tint của skin */
    --brand-line: #cdeae6;   /* viền nhạt của skin */
    --ey-color:   var(--text-sub);
    /* lưới khoảng cách 4 px */
    --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
    /* thang chữ */
    --fs-eyebrow: 11px;
    --fs-meta:    13.5px;
    --fs-btn:     15px;
    --fs-body:    16.5px;
    --fs-sub:     18px;
    --fs-q:       21px;
    --fs-title:   23px;
    --tap: 44px;
    --serif: "Charter", "Bitstream Charter", "Sitka Text", Cambria,
             "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}
@media (max-width: 440px) {
    :root { --fs-q: 19.5px; --fs-title: 21px; --fs-body: 16px; }
}
html, body {
    background: var(--bg);
    font-family: var(--font);
    line-height: 1.6;
    color: var(--text);
    margin: 0; padding: 0;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}

/* ---- Khung, nhãn trên cùng, tít, lời dẫn (khảo sát) ---- */

.quiz-container {
    max-width: 720px;
    margin: 0 auto 20px auto;
    padding: 0 3px;
    box-sizing: border-box;
    position: relative;
}

/* Eyebrow */
.ey {
    display: flex; align-items: center; gap: var(--s3);
    font-size: var(--fs-eyebrow); color: var(--ey-color); letter-spacing: .18em;
    text-transform: uppercase; font-style: normal; font-weight: 600;
    margin-bottom: var(--s4);
}
.ey::before, .ey::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Intro */
.intro { margin-bottom: var(--s5); }
.intro-sub {
    font-family: var(--serif); font-size: 16px; color: #45484d; line-height: 1.65;
    max-width: 64ch;
}

/* Tít hiện xuyên suốt */
.survey-title {
    font-family: var(--serif);
    font-size: var(--fs-title); font-weight: 700; color: var(--ink);
    margin: 0 0 var(--s3); line-height: 1.3; letter-spacing: -0.012em; text-wrap: balance;
}

.intro-sub + .intro-sub { margin-top: var(--s3); }

/* Thông báo nhanh */
.survey-toast {
    position: fixed; left: 50%; bottom: var(--s4); transform: translate(-50%, 8px);
    background: var(--ink); color: #fff; font-size: 13.5px; line-height: 1.5;
    padding: 10px var(--s4); opacity: 0; pointer-events: none; z-index: 9;
    transition: opacity .2s ease, transform .2s ease; max-width: 88%; text-align: center;
}
.survey-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Dải cuối: cụm cảm xúc một phía, khối logo phía đối diện (HT5). */
.dai-cuoi {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--s3) var(--s4); flex-wrap: wrap;
    margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--border);
}
.dai-cuoi .bc-react { display: flex; gap: var(--s2); align-items: center; }
.dai-logo { display: inline-flex; align-items: center; margin-left: auto; }
.dai-logo a { display: inline-flex; align-items: center; }
.dai-logo img {
    height: 33px; width: auto; max-width: 190px;
    object-fit: contain; display: block;
}
@media (max-width: 440px) {
    .dai-cuoi { row-gap: var(--s3); }
    .dai-logo img { max-width: 150px; }
}

.bc-react { display: flex; gap: var(--s2); align-items: center; }
.react-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
    min-width: var(--tap); height: var(--tap); padding: 0 var(--s2); border-radius: 0;
    box-sizing: border-box;
    background: transparent; border: 1px solid var(--border-ctl); cursor: pointer;
    font-family: var(--font); color: var(--text-mid); line-height: 1;
    transition: border-color .2s ease, background .2s ease;
}
.react-btn:hover { border-color: var(--brand-deep); background: var(--bg-hover); }
.react-e { font-size: 16px; }
.react-n { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.react-n:empty { display: none; }
.react-btn.pop { animation: reactPop .35s ease; }
@keyframes reactPop { 0% { transform: scale(1); } 40% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* ==== NHIỀU LOGO Ở DẢI CUỐI (HT5a, 30/10/2026) ====
   Chỉ có khi hồ sơ thêm logo đồng hành: các logo xếp một hàng, ngăn bằng
   vạch mảnh. Một logo thì markup như cũ.                               */
.dai-logos { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-end;
    gap: var(--s3) var(--s4); margin-left: auto; }
.dai-logos .dai-logo { margin-left: 0; }
.dai-logos .dai-logo + .dai-logo { padding-left: var(--s4); border-left: 1px solid var(--border); }
@media (max-width: 440px) {
    .dai-logos .dai-logo img { max-width: 110px; height: 28px; }
    .dai-logos .dai-logo + .dai-logo { padding-left: var(--s3); }
}

/* ==== CỤM ĐỌC THÊM SAU LỜI CẢM ƠN (HT13) — chỉ có khi có URL thật ==== */
.doc-them-cum {
    margin-top: var(--s4); padding-top: var(--s3);
    border-top: 1px solid var(--brand-line); text-align: center;
}
.doc-them-nhan {
    display: block; margin-bottom: var(--s1);
    font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: .14em;
    text-transform: uppercase; color: var(--text-sub);
}
.doc-them {
    display: inline-block; font-weight: 600; color: var(--brand-deep);
    text-decoration: underline; text-underline-offset: 3px; line-height: 1.5;
}
.doc-them:hover { color: var(--brand-press); }
.doc-them:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.quiz-container[data-skin="lam"] {
    --brand: #3b82f6; --brand-deep: #1d4ed8; --brand-press: #1e40af; --focus: #1d4ed8;
    --bg-hover: #eff5ff; --brand-line: #cfdcf7; --brand-ink: #1e3a8a; --ey-color: #1d4ed8;
}
.quiz-container[data-skin="son"] {
    --brand: #e5484d; --brand-deep: #b42330; --brand-press: #951b27; --focus: #b42330;
    --bg-hover: #fdf3f3; --brand-line: #f3d0d2; --brand-ink: #8c1a24; --ey-color: #b42330;
}
.quiz-container[data-skin="ho-phach"] {
    --brand: #e8912a; --brand-deep: #9a4b0b; --brand-press: #7c3c08; --focus: #9a4b0b;
    --bg-hover: #fdf6ec; --brand-line: #f1dcc0; --brand-ink: #7a3a06; --ey-color: #9a4b0b;
}
.quiz-container[data-skin="reu"] {
    --brand: #5aa05a; --brand-deep: #2e6b36; --brand-press: #24552b; --focus: #2e6b36;
    --bg-hover: #f1f8f0; --brand-line: #cfe3cd; --brand-ink: #22502a; --ey-color: #2e6b36;
}
.quiz-container[data-skin="tim-than"] {
    --brand: #8b6cd6; --brand-deep: #5b3aa0; --brand-press: #4a2e85; --focus: #5b3aa0;
    --bg-hover: #f6f2fd; --brand-line: #ddd2f3; --brand-ink: #46297e; --ey-color: #5b3aa0;
}
.quiz-container[data-skin] .ey::before, .quiz-container[data-skin] .ey::after { background: var(--brand-line); }

/* =====================================================================
   PHẦN RIÊNG CỦA CALCULATOR — cùng biến, cùng thang chữ, cùng lưới, góc vuông
   ===================================================================== */
html, body { overflow-x: hidden; }
.calc { padding-top: var(--s4); padding-bottom: var(--s2); }

/* Dòng số lượt tra cứu: chữ meta dưới lời dẫn, số đậm màu nhấn */
.luot-tra-cuu {
    display: flex; align-items: center; gap: var(--s2);
    font-size: var(--fs-meta); color: var(--text-sub); line-height: 1.5;
    margin: calc(-1 * var(--s2)) 0 var(--s5);
}
.luot-tra-cuu[hidden] { display: none; }
.luot-tra-cuu::before { content: ''; width: 16px; height: 2px; background: var(--brand); flex: 0 0 auto; }
.luot-so { color: var(--brand-deep); font-weight: 700; font-variant-numeric: tabular-nums; font-size: var(--fs-btn); }

/* Ô nhập */
.calc-form { display: flex; flex-direction: column; gap: var(--s4); margin: 0; }
.calc-o { display: flex; flex-direction: column; }
.calc-nhan {
    font-family: var(--font); font-size: var(--fs-sub); font-weight: 600;
    color: var(--ink); line-height: 1.4; margin: 0 0 var(--s2);
}
.calc-input {
    display: block; width: 100%; max-width: 100%; box-sizing: border-box;
    min-height: 48px; padding: var(--s3) var(--s4);
    background: var(--card); border: 1px solid var(--border-ctl); border-radius: 0;
    font-family: var(--font); font-size: var(--fs-body); line-height: 1.4; color: var(--text);
    -webkit-appearance: none; appearance: none;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
select.calc-input {
    padding-right: 40px; text-overflow: ellipsis; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-sub) 50%), linear-gradient(135deg, var(--text-sub) 50%, transparent 50%);
    background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%;
    background-size: 6px 6px; background-repeat: no-repeat;
}
.calc-input:hover { border-color: var(--brand-deep); }
.calc-input:focus { outline: none; border-color: var(--brand-deep); box-shadow: inset 0 0 0 1px var(--brand-deep); background: var(--bg-hover); }
.calc-input[aria-invalid="true"] { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.calc-goiy { font-size: var(--fs-meta); color: var(--text-faint); line-height: 1.5; margin-top: var(--s1); }

/* Nút Tính: cùng khuôn nút "Gửi đi" của khảo sát */
.calc-tinh { margin-top: var(--s5); text-align: center; }
.btn-submit {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 220px; min-height: 48px; box-sizing: border-box; padding: 12px 40px;
    background: var(--brand-deep); border: 1px solid var(--brand-deep); border-radius: 0;
    color: #fff; font-family: var(--font); font-size: 16px; font-weight: 700;
    letter-spacing: .02em; cursor: pointer; user-select: none;
    transition: background .2s ease, border-color .2s ease;
}
.btn-submit:hover { background: var(--brand-press); border-color: var(--brand-press); }
@media (max-width: 440px) { .btn-submit { width: 100%; min-width: 0; } }

/* Khối kết quả: cùng nền, viền với lời cảm ơn của khảo sát, canh trái để đọc */
.calc-kq {
    margin-top: var(--s5); padding: var(--s4) var(--s5);
    background: var(--bg-hover); border: 1px solid var(--brand-line); border-left: 3px solid var(--brand-deep);
    border-radius: 0; overflow-wrap: anywhere;
}
.calc-kq[hidden] { display: none; }
.kq-nhan {
    font-size: var(--fs-eyebrow); color: var(--ey-color); letter-spacing: .18em;
    text-transform: uppercase; font-weight: 600; margin: 0 0 var(--s2);
}
.kq-so {
    font-family: var(--serif); font-size: var(--fs-title); font-weight: 700; color: var(--ink);
    line-height: 1.3; letter-spacing: -0.012em; margin: 0;
}
.kq-dien-giai { font-size: var(--fs-body); color: var(--text); line-height: 1.65; margin: var(--s3) 0 0; }
.kq-luu-y {
    font-size: var(--fs-meta); color: var(--text-sub); font-style: italic; line-height: 1.6;
    margin: var(--s3) 0 0;
}
.kq-can-cu {
    font-size: var(--fs-meta); color: var(--text-sub); line-height: 1.6;
    margin: var(--s3) 0 0; padding-top: var(--s3); border-top: 1px solid var(--brand-line);
}
.calc-kq.thieu { background: var(--bg-soft); border-color: var(--border-ctl); border-left-color: var(--bad); }
.kq-hoi-lai { margin: 0; padding-left: 20px; color: var(--bad); font-size: var(--fs-body); font-weight: 600; line-height: 1.55; }
.kq-hoi-lai li + li { margin-top: var(--s1); }

/* Dòng chân, dòng cập nhật */
.calc-chan { font-size: var(--fs-meta); color: var(--text-sub); line-height: 1.6; margin: var(--s5) 0 0; }
.cap-nhat { font-size: var(--fs-meta); color: var(--text-faint); line-height: 1.5; margin: var(--s3) 0 0; }
.dai-cuoi { margin-top: var(--s5); }
/* Tim: chuẩn chung các sản phẩm tương tác Soha, to bằng hai nút ngón tay */
.react-btn[data-f="hearts"] { min-width: calc(2 * var(--tap)); }
.react-btn[data-f="hearts"] .react-e { font-size: 22px; }
.nhan-thu {
    display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-faint); border: 1px solid var(--border-ctl); padding: 3px 9px; margin-bottom: var(--s3);
}

/* Tiêu điểm bàn phím và giảm chuyển động (HT9) */
.btn-submit:focus-visible, .react-btn:focus-visible, .dai-logo a:focus-visible, .doc-them:focus-visible {
    outline: 2px solid var(--focus); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    html, body { scroll-behavior: auto; }
    .react-btn.pop { animation: none !important; }
    .btn-submit, .react-btn, .calc-input, .survey-toast { transition: none !important; }
}
@media (max-width: 440px) {
    .calc-kq { padding: var(--s4); }
}
