/* =========================================================
   FMAP — Financial Health Check · giao diện công cụ trong website
   Mọi quy tắc nằm dưới #fhc và dùng class tiền tố fh- để không
   ảnh hưởng (và không bị ảnh hưởng bởi) stylesheet chung.
   ========================================================= */
#fhc{--danger:#B23A3A; --warn:#B4561F; --ok:#2F7352; --mid:#946E00; --edge:#DDD5C6;}

/* ---------- Intro ---------- */
#fhc .fh-facts{display:flex; flex-wrap:wrap; gap:10px; margin:26px 0 30px;}
#fhc .fh-facts span{background:var(--white); border:1px solid var(--line); border-radius:999px; padding:7px 14px; font-size:13px; font-weight:600; color:var(--navy);}
#fhc .fh-facts b{color:var(--sapphire);}
#fhc .fh-privacy{font-size:13px; color:var(--text-2); margin-top:16px; max-width:520px;}
#fhc .fh-out{background:var(--white); border-radius:var(--radius-lg); box-shadow:var(--shadow); padding:28px; width:100%; max-width:420px;}
#fhc .fh-out h3{font-size:15px; margin-bottom:14px; color:var(--navy);}
#fhc .fh-out li{display:flex; gap:12px; align-items:flex-start; padding:12px 0; border-top:1px solid var(--line); font-size:14px; color:var(--text-2);}
#fhc .fh-out li b{display:block; color:var(--navy); font-size:14.5px;}
#fhc .fh-out li i{flex-shrink:0; width:28px; height:28px; border-radius:8px; background:var(--sapphire); color:var(--gold); font-style:normal; font-weight:800; font-size:13px; display:flex; align-items:center; justify-content:center;}

/* ---------- Quiz shell (bản gọn 23/09/2026) ---------- */
#fhc #quiz, #fhc #results{display:none; padding:28px 0 72px;}
#fhc .fh-shell{max-width:800px; margin:0 auto;}
#fhc .fh-stephead{display:flex; justify-content:space-between; align-items:baseline; gap:12px; margin-bottom:10px;}
#fhc .fh-stepname{font-size:12px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--text-2);}
#fhc .fh-stepcount{font-size:13.5px; color:var(--text-2); white-space:nowrap;}
#fhc .fh-stepcount b{color:var(--navy); font-weight:800;}
#fhc .fh-tabs{display:flex; gap:6px; margin-bottom:16px;}
#fhc .fh-tab{flex:1 1 0; min-width:0; font-size:13px; font-weight:600; color:var(--text-2); text-align:center; padding-top:10px; position:relative; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
#fhc .fh-tab::before{content:''; position:absolute; left:0; right:0; top:0; height:4px; border-radius:4px; background:var(--beige);}
#fhc .fh-tab.fh-done{color:var(--sapphire);}
#fhc .fh-tab.fh-done::before{background:var(--sapphire);}
#fhc .fh-tab.fh-active{color:var(--navy); font-weight:800;}
#fhc .fh-tab.fh-active::before{background:var(--gold);}

#fhc .fh-step{display:none; background:var(--white); border-radius:var(--radius-lg); box-shadow:var(--shadow); padding:28px 32px 0;}
#fhc .fh-step.fh-active{display:block; animation:fhFade .25s ease;}
@keyframes fhFade{from{opacity:0; transform:translateY(4px);} to{opacity:1; transform:none;}}
#fhc .fh-step h2{font-size:clamp(21px,2.2vw,25px); margin-bottom:4px;}
#fhc .fh-sub{color:var(--text-2); font-size:14px; margin-bottom:18px;}
#fhc .fh-step > h2 + .fh-q, #fhc .fh-step > h2 + .fh-card{margin-top:18px;}

#fhc .fh-q{margin-bottom:18px;}
#fhc .fh-qtext, #fhc .fh-q > label{display:block; font-size:14.5px; font-weight:600; color:var(--navy); margin:0 0 8px; line-height:1.45;}
#fhc .fh-hint{font-size:12.5px; color:var(--text-2); margin-top:6px; line-height:1.45;}
#fhc label{display:block; font-size:14px; font-weight:600; color:var(--navy); margin:0 0 6px;}
#fhc input[type=text], #fhc input[type=number], #fhc input[type=tel], #fhc input[type=email], #fhc select{
  width:100%; height:44px; padding:0 14px; border:1.5px solid var(--edge); border-radius:10px;
  font-family:inherit; font-size:16px; background:#FFFFFF; color:var(--navy); transition:border-color .15s, box-shadow .15s;
}
#fhc input::placeholder{color:#A9A296;}
#fhc input:focus, #fhc select:focus{outline:none; border-color:var(--sapphire); box-shadow:0 0 0 3px rgba(47,111,214,.18);}
/* ô tiền: dấu phẩy + đơn vị đ */
#fhc .fh-mw{position:relative;}
#fhc .fh-mw .fh-money{padding-right:34px; font-variant-numeric:tabular-nums; font-weight:600; letter-spacing:.01em;}
#fhc .fh-mw .fh-money:placeholder-shown{font-weight:400;}
#fhc .fh-unit{position:absolute; right:14px; top:50%; transform:translateY(-50%); font-size:14px; color:var(--text-2); pointer-events:none;}

/* lựa chọn */
#fhc .fh-opts5{display:grid; grid-template-columns:repeat(5,1fr); gap:8px;}
#fhc .fh-opts3{grid-template-columns:repeat(3,1fr);}
#fhc .fh-opt5, #fhc .fh-optbtn{
  border:1.5px solid var(--edge); background:#FFFFFF; border-radius:10px; padding:9px 6px;
  text-align:center; cursor:pointer; font-size:12.5px; color:var(--text-2); line-height:1.3; transition:.15s; user-select:none;
  min-height:44px; display:flex; flex-direction:column; align-items:center; justify-content:center;
}
#fhc .fh-opt5 b{display:block; font-size:16px; color:var(--navy); margin-bottom:1px;}
#fhc .fh-optbtn{font-size:14px; color:var(--navy); padding:10px 12px;}
#fhc .fh-opt5:hover, #fhc .fh-optbtn:hover{border-color:var(--action);}
#fhc .fh-opt5.fh-selected, #fhc .fh-optbtn.fh-selected{border-color:var(--sapphire); background:rgba(26,58,107,.07); color:var(--navy); font-weight:600; box-shadow:inset 0 0 0 1px var(--sapphire);}
#fhc .fh-opt2{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
#fhc .fh-opt4{display:grid; grid-template-columns:1fr 1fr; gap:8px;}
#fhc .fh-chips{display:grid; grid-template-columns:repeat(4,1fr); gap:8px;}
#fhc .fh-health-options .fh-optbtn{text-align:left; align-items:flex-start;}

/* khối tài sản/nợ: lưới 2 cột */
#fhc .fh-card{background:#FFFFFF; border:1px solid var(--line); border-radius:var(--radius); padding:18px 20px; margin-bottom:16px;}
#fhc .fh-step .fh-card{background:var(--ivory); border:none;}
#fhc .fh-card h3{font-size:15.5px; margin-bottom:12px; color:var(--navy);}
#fhc .fh-agrid{display:grid; grid-template-columns:1fr 1fr; gap:12px 18px;}
#fhc .fh-assetrow{display:flex; flex-direction:column; gap:6px; min-width:0;}
#fhc .fh-hasbasis{order:1;}
#fhc .fh-alabel{font-size:13.5px; font-weight:600; color:var(--navy); line-height:1.35;}
#fhc .fh-liq{display:inline-block; font-size:12px; font-weight:500; color:var(--text-2); margin-left:4px;}
#fhc .fh-basis{display:grid; grid-template-columns:1fr 118px; gap:6px;}
#fhc .fh-basis input, #fhc .fh-basis select{font-size:14.5px; padding:0 10px;}

/* điều hướng: dính đáy màn hình để luôn thấy nút Tiếp theo */
#fhc .fh-nav-row{position:sticky; bottom:0; z-index:3; display:flex; justify-content:space-between; gap:12px; margin:18px -32px 0; padding:14px 32px 18px; background:rgba(255,255,255,.96); border-top:1px solid var(--line); border-radius:0 0 var(--radius-lg) var(--radius-lg); backdrop-filter:blur(6px);}
#fhc .fh-btn{display:inline-flex; align-items:center; justify-content:center; min-height:46px; padding:0 26px; border-radius:999px; border:1.5px solid var(--sapphire); background:var(--sapphire); color:#FFFFFF; font-family:inherit; font-weight:600; font-size:15px; cursor:pointer; text-decoration:none; transition:.2s;}
#fhc .fh-btn:hover{background:var(--deep); border-color:var(--deep);}
#fhc .fh-btn.fh-secondary{background:transparent; color:var(--sapphire); border-color:rgba(26,58,107,.35);}
#fhc .fh-btn.fh-secondary:hover{background:rgba(26,58,107,.06);}

/* ---------- Kết quả ---------- */
#fhc .fh-score-hero{display:flex; gap:22px; flex-wrap:wrap; align-items:center; background:var(--white); border-radius:var(--radius-lg); box-shadow:var(--shadow); padding:24px 26px; margin-bottom:16px;}
#fhc .fh-score-badge{width:100px; height:100px; border-radius:50%; display:flex; flex-direction:column; align-items:center; justify-content:center; color:#FFFFFF; flex-shrink:0;}
#fhc .fh-score-badge .fh-num{font-size:36px; font-weight:800; line-height:1;}
#fhc .fh-score-badge .fh-denom{font-size:12px; opacity:.85;}
#fhc .fh-score-meta{flex:1 1 260px;}
#fhc .fh-score-meta h2{font-size:clamp(20px,2.2vw,26px); margin-bottom:6px;}
#fhc .fh-completeness{background:rgba(212,175,55,.12); border:1px solid rgba(212,175,55,.35); border-radius:14px; padding:14px 18px; margin-bottom:16px; font-size:13.5px; color:var(--navy);}
#fhc .fh-status-band{border-radius:14px; padding:16px 20px; margin-bottom:20px; font-size:14.5px; font-weight:600;}
#fhc .fh-status-critical{background:#FBECEC; color:var(--danger);}
#fhc .fh-status-watch{background:#FCF1E3; color:var(--warn);}
#fhc .fh-status-ok{background:#E9F3EE; color:var(--ok);}
#fhc #leadGate{max-width:520px;}
#fhc #leadGate input{margin-bottom:12px;}
#fhc .fh-consent{font-size:12.5px; color:var(--text-2); margin:4px 0 16px;}

#fhc .fh-pillar-row{display:flex; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid rgba(11,29,58,.07); font-size:14px;}
#fhc .fh-pillar-row:last-child{border-bottom:none;}
#fhc .fh-p-name{width:150px; flex-shrink:0; color:var(--navy); font-weight:500;}
#fhc .fh-p-score{width:36px; text-align:right; flex-shrink:0; font-weight:700;}
#fhc .fh-p-label{width:110px; text-align:right; flex-shrink:0; font-size:13px;}
#fhc .fh-pbar{flex:1; height:8px; background:var(--beige); border-radius:8px; position:relative; overflow:hidden;}
#fhc .fh-pbar i{position:absolute; left:0; top:0; bottom:0; border-radius:8px;}
#fhc .fh-t-high{color:var(--danger); font-weight:600;}
#fhc .fh-t-mid{color:var(--warn); font-weight:600;}
#fhc .fh-t-ok{color:var(--mid); font-weight:600;}
#fhc .fh-t-good{color:var(--ok); font-weight:600;}
#fhc .fh-flag-row{display:flex; justify-content:space-between; gap:14px; padding:10px 0; border-bottom:1px solid rgba(11,29,58,.07); font-size:14px; color:var(--navy);}
#fhc .fh-flag-row > span:last-child{text-align:right; font-weight:600;}
#fhc .fh-flag-row:last-child{border-bottom:none;}
#fhc .fh-advice{font-size:12.5px; color:var(--text-2); margin:-2px 0 8px;}
#fhc .fh-note{font-size:12.5px; color:var(--text-2); margin-top:12px;}
#fhc .fh-grid2{display:grid; grid-template-columns:1fr 1fr; gap:20px;}
#fhc .fh-result-cta{background:var(--deep); color:var(--ivory); border-radius:var(--radius-lg); padding:36px; text-align:center; margin-top:8px;}
#fhc .fh-result-cta h3{color:var(--ivory); font-size:22px; margin-bottom:10px;}
#fhc .fh-result-cta p{color:rgba(243,239,231,.75); max-width:560px; margin:0 auto 22px; font-size:15px;}

/* ---------- Tablet ---------- */
@media (max-width:900px){
  #fhc .fh-tab{font-size:12px;}
}
/* ---------- Mobile ---------- */
@media (max-width:760px){
  #fhc #quiz, #fhc #results{padding:18px 0 56px;}
  #fhc .fh-step{padding:20px 16px 0; border-radius:18px;}
  #fhc .fh-nav-row{margin:16px -16px 0; padding:12px 16px 14px; border-radius:0 0 18px 18px;}
  #fhc .fh-tabs{overflow-x:auto; scrollbar-width:none; margin:0 0 14px; padding:0; gap:10px; scroll-snap-type:x proximity; -webkit-mask-image:linear-gradient(90deg,#000 82%,transparent); mask-image:linear-gradient(90deg,#000 82%,transparent);}
  #fhc .fh-tabs::-webkit-scrollbar{display:none;}
  #fhc .fh-tab{flex:0 0 auto; overflow:visible; font-size:13px; min-width:0; padding:10px 2px 0; scroll-snap-align:center;}
  #fhc .fh-opts5{gap:5px;}
  #fhc .fh-opt5{padding:6px 2px; min-height:46px;}
  #fhc .fh-opt5 b{font-size:15px;}
  #fhc .fh-opts3, #fhc .fh-opt4{grid-template-columns:1fr;}
  #fhc .fh-chips{grid-template-columns:1fr 1fr;}
  #fhc .fh-card{padding:14px 14px;}
  #fhc .fh-agrid{grid-template-columns:1fr; gap:12px;}
  #fhc .fh-basis{grid-template-columns:1fr 150px;}
  #fhc .fh-basis input, #fhc .fh-basis select{font-size:16px;}
  #fhc .fh-grid2{grid-template-columns:1fr;}
  #fhc .fh-nav-row .fh-btn{padding:0 22px; flex:1;}
  #fhc .fh-nav-row > span{display:none;}
  #fhc .fh-score-hero{padding:20px;}
  #fhc .fh-pillar-row{flex-wrap:wrap; row-gap:6px;}
  #fhc .fh-p-name{width:100%;}
  #fhc .fh-p-label{margin-left:auto;}
  #fhc .fh-result-cta{padding:28px 20px;}
  #fhc .fh-result-cta .fh-btn{white-space:normal;}
}

/* nhóm câu hỏi số ngắn thành cột (desktop) — ô nhập thẳng hàng theo đáy */
#fhc .fh-qgrid{display:grid; gap:0 18px; align-items:end;}
#fhc .fh-qgrid.fh-g2{grid-template-columns:1fr 1fr;}
#fhc .fh-qgrid.fh-g3{grid-template-columns:repeat(3,1fr);}
#fhc .fh-qgrid > .fh-q{min-width:0;}
@media (max-width:760px){
  #fhc .fh-qgrid.fh-g3{grid-template-columns:1fr;}
  #fhc .fh-qgrid.fh-g2:not(.fh-keep2){grid-template-columns:1fr;}
  /* tài sản/nợ trên mobile: nhãn và ô nhập cùng một hàng */
  #fhc .fh-agrid{gap:10px;}
  #fhc .fh-assetrow{display:grid; grid-template-columns:minmax(0,1fr) 56%; gap:4px 10px; align-items:center;}
  #fhc .fh-assetrow > .fh-alabel{font-size:13.5px;}
  #fhc .fh-assetrow > .fh-basis{grid-column:1 / -1;}
}
/* trong lúc làm bài: ẩn nút Zalo nổi trên mobile để không che nút Tiếp theo */
@media (max-width:760px){ body.fh-in-quiz .float-zalo{display:none;} }

/* ===== Sau audit UI/UX & thương hiệu (23/09/2026) ===== */
/* gợi ý đọc số bằng chữ: nằm ngay dưới ô, không đẩy lệch hàng */
#fhc .fh-fmt{position:absolute; left:2px; top:100%; margin-top:3px; font-size:12.5px; font-weight:600; color:var(--sapphire); white-space:nowrap; pointer-events:none;}
#fhc .fh-fmt:empty{display:none;}
#fhc .fh-q{margin-bottom:18px;}
#fhc .fh-agrid{row-gap:12px;}
#fhc .fh-mw:has(.fh-fmt:not(:empty)){margin-bottom:19px;}
#fhc .fh-mw.fh-short{max-width:220px;}
/* thang 1–5: nút chỉ có số, nhãn hai đầu hiển thị một lần */
#fhc .fh-opts5 .fh-opt5{min-height:46px; padding:6px;}
#fhc .fh-opt5 b{margin:0;}
#fhc .fh-scale-cap{display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-top:6px; font-size:12.5px; color:var(--text-2); line-height:1.35;}
#fhc .fh-scale-cap span:nth-child(2){text-align:center;}
#fhc .fh-scale-cap span:nth-child(3){text-align:right;}
#fhc .fh-opt5:focus-visible, #fhc .fh-optbtn:focus-visible{outline:2px solid var(--action); outline-offset:2px;}
/* thiếu thông tin: báo ngay tại bước */
#fhc .fh-missing .fh-qtext, #fhc .fh-missing > label{color:var(--danger);}
#fhc .fh-missing input, #fhc .fh-missing select, #fhc .fh-missing .fh-opt5, #fhc .fh-missing .fh-optbtn{border-color:rgba(178,58,58,.55);}
#fhc .fh-errbox{background:#FBECEC; color:var(--danger); border-radius:12px; padding:12px 16px; font-size:14px; font-weight:600; margin-top:6px;}
#fhc .fh-opt-tag{font-size:12px; font-weight:500; color:var(--text-2); margin-left:4px;}
/* tab đã đi qua: bấm để quay lại */
#fhc .fh-tab.fh-reach{cursor:pointer;}
#fhc .fh-tab.fh-reach:hover{color:var(--navy);}
/* ô định giá BĐS/doanh nghiệp: cao 44px như các ô khác */
#fhc .fh-basis{margin-top:2px;}
@media (max-width:760px){
  #fhc .fh-assetrow{grid-template-columns:minmax(0,1fr) 62%;}
  #fhc .fh-mw .fh-money{padding-right:28px; font-weight:500;}
  #fhc .fh-unit{right:11px;}
  #fhc .fh-liq{display:none;}
  #fhc .fh-assetrow.fh-hasbasis{grid-template-columns:1fr;}
  #fhc .fh-assetrow > .fh-alabel{font-size:14px;}
  #fhc .fh-agrid{gap:12px;}
  #fhc .fh-scale-cap{font-size:12.5px; gap:6px;}
  #fhc .fh-p-label, #fhc .fh-hint, #fhc .fh-consent, #fhc .fh-note{font-size:12.5px;}
}
@media (max-width:760px){
  #fhc .fh-scale-cap{grid-template-columns:1fr 1fr;}
  #fhc .fh-scale-cap span:nth-child(2){display:none;}
}
#fhc .fh-nav-row{flex-wrap:wrap;}
#fhc .fh-nav-row .fh-errbox{flex:1 1 100%; margin:0 0 2px; padding:10px 14px; font-size:13.5px;}
#fhc .fh-money.fh-bad{border-color:var(--danger); background:#FBF3F3;}
#fhc .fh-bad-wrap .fh-fmt{color:var(--danger);}
@media (max-width:560px){ #fhc .fh-bad-wrap .fh-fmt{white-space:normal; font-size:12px; line-height:1.35;} #fhc .fh-mw.fh-bad-wrap{margin-bottom:34px;} }
