/* FANARO · khaosat.fanarosolutions.com
   Tokens lấy từ HANDOFF.md mục 3. Chữ trên nền xanh luôn màu mực. */

@font-face {
  font-family: 'DT Phudu';
  src: url(../fonts/DTPhudu-Bold.woff2) format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue: #00AEEF;
  --blue-hover: #4CC9F5;
  --ink: #0E2433;
  --ink-hover: #1F3B50;
  --ink-deep: #091A25;
  --wall: rgba(201, 214, 223, 0.70);
  --link: #0072A8;
  --mist: #E6F6FD;
  --steel: #4E5D69;
  --on-ink-2: #AFC0CC;
  --on-ink-1: #C9D6DF;
  --on-ink-link: #7FD6F7;
  --line: rgba(14, 36, 51, 0.10);
  --line-strong: rgba(14, 36, 51, 0.14);
  --field: #B9C6CF;
  --error: #B42318;

  --pad-x: clamp(20px, 5vw, 48px);
  --section-y: clamp(48px, 7vw, 88px);
  --h2: clamp(32px, 4vw, 52px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: #FFFFFF;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--link); }
a:hover { color: var(--ink); }
h1, h2, h3, p { margin: 0; }

.d { font-family: 'DT Phudu', 'Plus Jakarta Sans', sans-serif; font-weight: 700; letter-spacing: 0.02em; }

.wrap {
  box-sizing: content-box;
  max-width: 1240px;
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.section + .section--rule, .section--rule { border-top: 1px solid var(--line); }
.h2 { font-size: var(--h2); line-height: 1.18; }

.skip {
  position: absolute; left: 12px; top: -100px; z-index: 50;
  background: var(--ink); color: #FFFFFF; padding: 12px 16px; border-radius: 8px;
}
.skip:focus { top: 12px; color: #FFFFFF; }

/* Buttons: 2 cỡ. 44 cho header, 52 cho mọi nút còn lại */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 24px;
  border: 0; border-radius: 999px;
  font: inherit; font-weight: 500; text-decoration: none; text-align: center;
  cursor: pointer;
  transition: background-color 150ms ease, transform 100ms ease;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.btn--sm { min-height: 44px; padding: 0 20px; }
.btn--block { width: 100%; }
.btn--cta { background: var(--blue); color: var(--ink); }
.btn--cta:hover { background: var(--blue-hover); color: var(--ink); }
.btn--ink { background: var(--ink); color: #FFFFFF; }
.btn--ink:hover { background: var(--ink-hover); color: #FFFFFF; }
.btn--ghost { background: transparent; color: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.08); color: #FFFFFF; }
.btn--ghost:focus-visible { outline-color: #FFFFFF; }
.btn--quiet { background: #FFFFFF; color: var(--ink); box-shadow: inset 0 0 0 1px var(--field); }
.btn--quiet:hover { background: var(--mist); color: var(--ink); }
.btn--outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn--outline:hover { background: var(--mist); color: var(--ink); }
.btn[aria-busy="true"] { cursor: progress; }

/* Header */
.hdr { background: #FFFFFF; border-bottom: 1px solid var(--line); z-index: 20; }
.hdr__in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.hdr__logo { display: inline-flex; align-items: center; min-height: 44px; flex: none; }
.hdr__logo img { height: 32px; width: auto; }
.hdr__act { display: flex; align-items: center; gap: 16px; }
.hdr__tel { color: var(--ink); text-decoration: none; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; }
.hdr__tel:hover { text-decoration: underline; }
.hdr a:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
@media (min-width: 768px) { .hdr { position: sticky; top: 0; } }
@media (max-width: 767px) { .hdr__cta { display: none; } }

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--blue); background-image: linear-gradient(160deg, #22BCF3 0%, #00AEEF 45%, #0099D9 100%); scroll-margin-top: 68px; }
.hero__in {
  position: relative;
  padding-top: clamp(40px, 6vw, 80px);
  padding-bottom: clamp(56px, 8vw, 104px);
  display: flex; flex-wrap: wrap; gap: clamp(32px, 4vw, 56px); align-items: flex-start;
}
.fan {
  position: absolute; pointer-events: none;
  left: clamp(-200px, -9vw, -80px);
  bottom: clamp(-360px, -22vw, -240px);
  width: clamp(720px, 60vw, 880px); height: auto;
  transition: transform 500ms var(--ease);
}
.calc { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.calc__h1 { font-size: clamp(44px, 5vw, 76px); line-height: 1.14; letter-spacing: 0.015em; max-width: 10em; }
.calc__h1 label { white-space: nowrap; border-bottom: 0.08em solid var(--ink); cursor: pointer; }
.calc__h1 .nw { white-space: nowrap; }
.calc__lead { font-size: 1.2rem; max-width: 30em; }
.calc__ctl { display: flex; flex-direction: column; gap: 4px; max-width: 620px; }
.calc__ends { display: flex; justify-content: space-between; font-size: 12px; }
.calc__num { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.calc__num label { font-size: 14px; font-weight: 500; }
.calc__num .unit { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.calc__err { flex: 1 1 100%; font-size: 14px; font-weight: 500; }
.calc__sum {
  max-width: 620px; padding-top: 16px;
  border-top: 1px solid rgba(14, 36, 51, 0.24);
  font-size: 1.1rem;
}
.calc__sum b { font-weight: 500; }

.rng { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; --p: 17.5%; }
.rng::-webkit-slider-runnable-track { height: 10px; border-radius: 999px; background: linear-gradient(to right, var(--ink) var(--p), rgba(14, 36, 51, 0.22) var(--p)); }
.rng::-webkit-slider-thumb { -webkit-appearance: none; width: 32px; height: 32px; margin-top: -11px; border-radius: 50%; background: #FFFFFF; border: 4px solid var(--ink); }
.rng::-moz-range-track { height: 10px; border-radius: 999px; background: rgba(14, 36, 51, 0.22); }
.rng::-moz-range-progress { height: 10px; border-radius: 999px; background: var(--ink); }
.rng::-moz-range-thumb { width: 32px; height: 32px; border-radius: 50%; background: #FFFFFF; border: 4px solid var(--ink); }
.rng:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

.num {
  font: inherit; font-weight: 500; font-size: 16px; color: var(--ink);
  background: #FFFFFF; border: 2px solid var(--ink); border-radius: 8px;
  padding: 8px 12px; min-height: 44px; width: 120px; text-align: right;
}
.num:focus { outline: 3px solid var(--ink); outline-offset: 2px; }

/* Form card */
.lead {
  flex: 1 1 360px; min-width: 0; scroll-margin-top: 80px;
  background: #FFFFFF; border-radius: 20px;
  padding: clamp(24px, 3vw, 32px);
  border: 1px solid rgba(14, 36, 51, 0.08);
  box-shadow: 0 4px 16px rgba(14, 36, 51, 0.07);
}
.lead form { display: flex; flex-direction: column; gap: 16px; }
.lead__h { font-size: 1.728rem; line-height: 1.2; }
.lead__sub { margin-top: 8px; font-size: 14px; color: var(--steel); }
.lead__est { padding: 12px 0; border-top: 1px solid rgba(14, 36, 51, 0.12); border-bottom: 1px solid rgba(14, 36, 51, 0.12); font-size: 14px; }
.lead__est span:first-child { color: var(--steel); }
.lead__est b { font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 4px; }
.fl { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink); }
.grid-sel { display: flex; flex-wrap: wrap; gap: 16px 12px; }
.grid-sel .fl { flex: 1 1 128px; }
.grid-sel .fl--full { flex-basis: 100%; }
.in {
  font: inherit; font-weight: 400; font-size: 16px; color: var(--ink);
  background: #FFFFFF; border: 1px solid var(--field); border-radius: 8px;
  padding: 12px 16px; min-height: 48px; width: 100%;
}
.in:focus { outline: 3px solid var(--link); outline-offset: 1px; border-color: var(--ink); }
.in[aria-invalid="true"] { border-color: var(--error); }
.err { font-size: 14px; color: var(--error); }
.lead__fail { font-size: 14px; color: var(--error); }
.lead__fine { font-size: 12px; color: var(--steel); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Result */
.res { display: flex; flex-direction: column; gap: 24px; }
.res__card {
  background: var(--ink); color: #FFFFFF; border-radius: 20px;
  padding: clamp(24px, 3vw, 40px);
  display: flex; flex-wrap: wrap; gap: clamp(24px, 3vw, 48px); align-items: stretch;
}
.res__plan { flex: 3 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* Mặt bằng có đường ghi kích thước kiểu bản vẽ */
.plan { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: 28px auto; }
.plan__dx, .plan__dy { position: relative; display: flex; align-items: center; justify-content: center; color: var(--on-ink-2); font-size: 12px; }
.plan__dx { grid-column: 2; grid-row: 1; }
.plan__dy { grid-column: 1; grid-row: 2; }
.plan__dx::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid rgba(175, 192, 204, 0.6); }
.plan__dx::after { content: ""; position: absolute; left: 0; right: 0; top: calc(50% - 6px); height: 12px; border-left: 1px solid rgba(175, 192, 204, 0.6); border-right: 1px solid rgba(175, 192, 204, 0.6); }
.plan__dy::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid rgba(175, 192, 204, 0.6); }
.plan__dy::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 6px); width: 12px; border-top: 1px solid rgba(175, 192, 204, 0.6); border-bottom: 1px solid rgba(175, 192, 204, 0.6); }
.plan__dx > span, .plan__dy > span { position: relative; z-index: 1; background: var(--ink); padding: 0 8px; white-space: nowrap; }
.plan__dy > span { writing-mode: vertical-rl; transform: rotate(180deg); padding: 8px 0; }

.res__nums { flex: 2 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 24px; justify-content: center; }
.res__k { font-size: 14px; color: var(--on-ink-2); }
.cost { display: flex; flex-direction: column; gap: 12px; }
.cost__row { display: flex; flex-direction: column; gap: 4px; }
.cost__lab--muted { color: var(--on-ink-2); }
.res__note { font-size: 12px; color: var(--on-ink-2); }
.res__nums .btn { align-self: flex-start; }


/* 3D */
.sim { background: var(--mist); }
.sim__in { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.sim__txt { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.sim__txt p { color: var(--steel); max-width: 32em; }
.sim__frame {
  position: relative; flex: 1 1 460px; min-width: 0; aspect-ratio: 16 / 9;
  border-radius: 16px; background: var(--ink); color: var(--on-ink-2); overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  text-align: center; padding: 16px; font-size: 14px;
}
.sim__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sim__frame.is-open { flex-basis: 100%; aspect-ratio: auto; height: min(80vh, 760px); padding: 0; }
.sim__frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Steps */
.split { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.split > .h2 { flex: 1 1 320px; }
.split > :last-child { flex: 2 1 520px; min-width: 0; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 2px solid var(--ink); }
.steps li { display: flex; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line-strong); }
.steps__n { font-size: 2.488rem; line-height: 1; color: var(--link); min-width: 48px; }
.steps__t { font-weight: 500; font-size: 1.2rem; }
.steps__d { margin-top: 4px; color: var(--steel); }

/* FAQ */
.faq { border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line-strong); padding: 8px 0; }
.faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 44px; font-weight: 500; font-size: 1.2rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--link); flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.faq p { margin: 0 0 12px; color: var(--steel); max-width: 68ch; }

/* Closing + footer */
.close { background: var(--ink); color: #FFFFFF; overflow-x: clip; }
.close__in { padding-top: clamp(56px, 8vw, 104px); padding-bottom: clamp(40px, 5vw, 56px); display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.close__txt { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
/* Quạt FANARO thật quay liên tục như trang chủ; chỉ quay khi đang trong màn hình */
.close__fan {
  width: min(280px, 72vw); height: auto; align-self: center; margin-top: 8px;
  animation: fan-spin 6s linear infinite; animation-play-state: paused;
}
.close__fan.is-on { animation-play-state: running; }
@keyframes fan-spin { to { transform: rotate(360deg); } }
@media (min-width: 768px) {
  .close__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: clamp(32px, 5vw, 72px); }
  .close__fan { width: clamp(280px, 30vw, 400px); margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .close__fan { animation: none; } }
.close__h { font-size: clamp(40px, 5.6vw, 80px); line-height: 1.14; max-width: 12em; }
.close__p { color: var(--on-ink-1); font-size: 1.2rem; max-width: 32em; }
.close__p a { color: #FFFFFF; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.ftr { font-size: 14px; color: var(--on-ink-2); border-top: 1px solid rgba(255, 255, 255, 0.12); background: var(--ink); }
.ftr__in { padding-top: 24px; padding-bottom: 32px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; }
.ftr__links { display: flex; flex-wrap: wrap; gap: 16px; }
.ftr a { color: var(--on-ink-link); min-height: 44px; display: inline-flex; align-items: center; }
.ftr a:hover { color: #FFFFFF; }
.ftr a:focus-visible, .close a:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 3px; }

/* Mobile bottom bar */
.mbar { display: none; }
@media (max-width: 767px) {
  .mbar {
    display: flex; position: sticky; bottom: 0; z-index: 10; gap: 8px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: #FFFFFF; border-top: 1px solid rgba(14, 36, 51, 0.12);
  }
  .mbar[data-hide="true"] { display: none; }
  .mbar .btn--cta { flex: 1 1 auto; }
  .mbar .btn--quiet { flex: 0 0 auto; padding: 0 20px; }
  .fan { left: auto; bottom: auto; top: -300px; right: -400px; width: 640px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .fan, .bar__fill { transition: none; }
  .btn:active { transform: none; }
}

/* Trang cảm ơn */
.ty { background: var(--blue); background-image: linear-gradient(160deg, #22BCF3 0%, #00AEEF 45%, #0099D9 100%); overflow-x: clip; }
.ty__in { padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(48px, 7vw, 88px); display: flex; flex-direction: column; gap: 24px; }
.ty__h1 { font-size: clamp(48px, 6.2vw, 88px); line-height: 1.14; letter-spacing: 0.015em; }
.ty__p { font-size: 1.2rem; max-width: 34em; }
.ty__p a { color: var(--ink); font-weight: 500; }
.ty__steps { max-width: 880px; list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; }
.ty__steps li { flex: 1 1 180px; border-top: 4px solid rgba(14, 36, 51, 0.24); padding-top: 12px; font-weight: 500; display: flex; gap: 12px; align-items: baseline; }
.ty__steps li.is-now { border-top-color: var(--ink); }
.ty__steps .d { font-size: 1.728rem; line-height: 1; }
.prep { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.prep li { display: flex; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line-strong); font-size: 1.1rem; }
.prep .steps__n { font-size: 1.728rem; min-width: 40px; }
.prep + .btns { margin-top: 32px; }

/* ---- Bố trí minh họa ---- */
.res__cap { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--on-ink-2); }
.res__key { width: 20px; height: 20px; flex: none; color: var(--blue); }
.plan__floor {
  grid-column: 2; grid-row: 2;
  position: relative; width: 100%; aspect-ratio: 3 / 2;
  background: var(--ink-deep);
  border: 2px solid var(--wall); border-radius: 4px;
}
.plan__cols, .plan__fans { position: absolute; inset: 0; }
.plan__fans { overflow: hidden; }
.bay { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid rgba(255, 255, 255, 0.06); }
.col { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; background: rgba(175, 192, 204, 0.55); border-radius: 1px; }
.fanpt {
  position: absolute; aspect-ratio: 1 / 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: rgba(0, 174, 239, 0.10);
  border: 1.5px dashed rgba(0, 174, 239, 0.60);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue);
}
.fanpt svg { width: 52%; height: 52%; min-width: 14px; min-height: 14px; transform: rotate(var(--rot, 0deg)); transition: transform 500ms var(--ease); }

.res__count { padding-bottom: 24px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.res__big { font-size: clamp(56px, 6vw, 80px); line-height: 1.05; color: var(--blue-hover); margin: 4px 0; }
.cost { gap: 16px; }
.cost__lab { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.cost__v { font-size: 1.44rem; line-height: 1.1; color: var(--on-ink-1); white-space: nowrap; }
.cost__v--hv { color: var(--blue-hover); }
.bar { height: 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.10); overflow: hidden; }
.bar__fill { height: 100%; width: 100%; border-radius: 999px; background: var(--blue); transform: scaleX(0); transform-origin: left center; transition: transform 600ms var(--ease); }
.bar__fill--trad { background: rgba(175, 192, 204, 0.55); }

/* ---- Dự án: danh mục chữ ---- */
.proof { display: flex; flex-direction: column; gap: 32px; }
.proof .h2 { max-width: 14em; }
.proj { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.proj__row {
  display: grid; grid-template-columns: 64px 1fr; gap: 16px 24px; align-items: start;
  padding: 28px 0; border-bottom: 1px solid var(--line-strong);
}
.proj__n { font-family: 'DT Phudu', sans-serif; font-weight: 700; font-size: 1.2rem; color: var(--link); padding-top: 12px; }
.proj__name { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.18; }
.proj__desc, .proj__loc { margin-top: 8px; color: var(--steel); max-width: 52ch; }
.proj__media:empty { display: none; }
.proj__media { grid-column: 2; }
.proj__media img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 16px; display: block; background: var(--mist); }
.proj__more { display: flex; flex-wrap: wrap; gap: 4px 16px; font-weight: 500; }
.proj__more span { color: var(--steel); font-weight: 400; }
@media (min-width: 960px) {
  .proj__row { grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1fr); }
  .proj__media { grid-column: 3; grid-row: 1; }
}

/* ---- Mặt cắt nhà xưởng ---- */
.sim__frame { padding: 0; cursor: pointer; }
.xsec { width: 100%; height: 100%; display: block; }
.xsec__bld path { stroke: #C9D6DF; stroke-width: 2.5; }
.xsec__bld .xsec__web { stroke: rgba(175, 192, 204, 0.55); stroke-width: 1.25; }
.xsec__bld .xsec__ground { stroke: rgba(175, 192, 204, 0.55); stroke-width: 1.5; }
.xsec__person { stroke: rgba(175, 192, 204, 0.8); stroke-width: 2; }
.xsec__fan { fill: var(--blue); }
.xsec__rod { stroke: var(--blue); stroke-width: 3; }
.xsec__dim path { stroke: var(--on-ink-2); stroke-width: 1.25; }
.xsec__air { stroke: var(--blue-hover); stroke-width: 2.5; }
.xsec__t { font-family: 'Plus Jakarta Sans', Arial, sans-serif; font-size: 17px; fill: var(--on-ink-1); }
.sim__play {
  position: absolute; right: 16px; top: 16px;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 999px; background: var(--blue); color: var(--ink);
  font: inherit; font-weight: 500; cursor: pointer; transition: background-color 150ms ease;
}
.sim__frame:hover .sim__play { background: var(--blue-hover); }

/* ---- 3 bước: dải ngang trên desktop ---- */
.flow { display: flex; flex-direction: column; gap: 40px; }
@media (min-width: 960px) {
  .steps--row { flex-direction: row; border-top: 0; gap: 32px; }
  .steps--row li {
    flex: 1 1 0; flex-direction: column; gap: 16px;
    padding: 24px 0 0; border-bottom: 0; border-top: 2px solid var(--ink); position: relative;
  }
  .steps--row li::before {
    content: ""; position: absolute; top: -7px; left: 0;
    width: 12px; height: 12px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px #FFFFFF;
  }
}
@media (prefers-reduced-motion: reduce) { .fanpt svg, .bar__fill { transition: none; } }
.sim__frame { aspect-ratio: 600 / 324; }
.sim__frame.is-open { aspect-ratio: auto; }
@media (max-width: 767px) { .xsec__t { font-size: 22px; } .sim__play { display: none; } }

/* ---- Sơ đồ 3D isometric ---- */
.plan--iso { display: block; }
.iso { display: block; width: 100%; height: auto; overflow: visible; }
.iso__floor { fill: var(--ink-deep); stroke: var(--wall); stroke-width: 1.5; stroke-linejoin: round; }
.iso__wall { fill: rgba(201, 214, 223, 0.05); stroke: rgba(201, 214, 223, 0.45); stroke-width: 1; stroke-linejoin: round; }
.iso__wall--side { fill: rgba(201, 214, 223, 0.08); }
.iso__grid { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }
.iso__cover { fill: rgba(0, 174, 239, 0.24); stroke: rgba(76, 201, 245, 0.85); stroke-width: 1.5; }
.iso__col { fill: none; stroke: rgba(175, 192, 204, 0.55); stroke-width: 1.5; }
.iso__eave { fill: none; stroke: rgba(201, 214, 223, 0.35); stroke-width: 1; stroke-linejoin: round; }
.iso__air { fill: none; stroke: rgba(76, 201, 245, 0.55); stroke-width: 1.25; stroke-dasharray: 3 4; }
.iso__t { font-family: 'Plus Jakarta Sans', Arial, sans-serif; font-size: 14px; fill: var(--on-ink-2); }
@media (max-width: 767px) { .iso__t { font-size: 22px; } }
.iso__col--front { stroke: rgba(175, 192, 204, 0.22); stroke-width: 1; }
.iso__truss { fill: none; stroke: rgba(201, 214, 223, 0.16); stroke-width: 1; stroke-linejoin: round; }
.iso__ridge { fill: none; stroke: rgba(201, 214, 223, 0.38); stroke-width: 1.25; stroke-linejoin: round; }
.iso__rod { fill: none; stroke: #C9D6DF; stroke-width: 1.75; }
.iso__wire { fill: none; stroke: rgba(201, 214, 223, 0.45); stroke-width: 0.75; }
.iso__shadow { opacity: 0.22; }
.iso__cone { fill: rgba(0, 174, 239, 0.10); stroke: none; }
.iso__sweep { fill: rgba(0, 174, 239, 0.16); stroke: rgba(76, 201, 245, 0.6); stroke-width: 1; stroke-dasharray: 3 3; }
.mbar .btn { white-space: nowrap; padding: 0 16px; }
.mbar .btn--quiet { padding: 0 16px; }
@media (max-width: 359px) { .mbar__opt { display: none; } }
@media (max-width: 479px) { .calc__h1 { font-size: 36px; } }

/* ---- Chuyển động làm nổi bật (chỉ transform, opacity, màu; không lặp) ---- */
.lead__est b { padding: 2px 8px; margin: 0 -8px; border-radius: 8px; }
.lead__est b.is-flash { animation: estFlash 1200ms var(--ease); }
@keyframes estFlash { 0% { background: transparent; } 25% { background: var(--mist); } 100% { background: transparent; } }
.btn.is-nudge { animation: ctaNudge 900ms var(--ease); }
@keyframes ctaNudge { 0%, 100% { background: var(--blue); transform: none; } 30% { background: var(--blue-hover); transform: translateY(-2px); } 60% { transform: none; } }
@media (max-width: 767px) { .mbar[data-hide="false"] { animation: barIn 200ms var(--ease); } }
@keyframes barIn { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .lead__est b.is-flash, .btn.is-nudge, .mbar[data-hide="false"] { animation: none; }
}

/* Desktop: cân hero và căn giữa dòng dự án theo chiều cao ảnh */
@media (min-width: 960px) {
  .hero__in { align-items: center; }
  .proj__row { align-items: center; }
  .proj__n { padding-top: 0; }
}

/* ---- Nút CTA: mũi tên, nhấc nhẹ khi rê, vệt sáng lướt qua đúng một lần ---- */
.btn--cta { position: relative; overflow: hidden; isolation: isolate; transition: background-color 150ms ease, transform 150ms var(--ease), box-shadow 150ms ease; }
.btn--cta::after {
  content: ""; flex: none; width: 16px; height: 16px; margin-left: 8px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 150ms var(--ease);
}
.btn--cta[aria-busy="true"]::after { display: none; }
.btn--cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
}
.btn--cta.is-shine::before { animation: ctaShine 900ms var(--ease) 1; }
@keyframes ctaShine { from { transform: translateX(-120%); } to { transform: translateX(120%); } }
@media (hover: hover) {
  .btn--cta:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(14, 36, 51, 0.07); }
  .btn--cta:hover::after { transform: translateX(3px); }
}
.btn--cta:active { transform: scale(0.98); box-shadow: none; }
@media (prefers-reduced-motion: reduce) {
  .btn--cta.is-shine::before { animation: none; }
  .btn--cta:hover, .btn--cta:hover::after { transform: none; }
}
.mbar .btn--cta::after { display: none; }

/* ---- Hero: khối so sánh tiền điện ---- */
.cmp { max-width: 620px; display: flex; flex-direction: column; gap: 8px; }
.cmp__k { font-size: 14px; font-weight: 500; }
.cmp__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp__it { margin: 0; display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; border-radius: 16px; box-shadow: inset 0 0 0 1px rgba(14, 36, 51, 0.28); }
.cmp__it--hv { background: var(--ink); color: #FFFFFF; box-shadow: none; }
.cmp__n { font-size: 14px; font-weight: 500; }
.cmp__v { font-size: clamp(28px, 2.6vw, 36px); line-height: 1.05; white-space: nowrap; }
.cmp__it--hv .cmp__v { color: var(--blue-hover); }
@media (max-width: 479px) { .cmp__row { grid-template-columns: 1fr; } .cmp__it { flex-direction: row; justify-content: space-between; align-items: baseline; } }

/* ---- Form: cột rộng hơn trên desktop, mũi tên ô chọn đều nhau ---- */
@media (min-width: 1024px) {
  .hero__in { display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, 32vw, 440px); }
}
select.in {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  padding-right: 44px;
  background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E2433' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center / 16px 16px;
}

/* ---- Ngắt dòng: tiêu đề cân dòng, đoạn văn tránh chữ mồ côi ---- */
h1, h2, h3, .lead__h, .close__h, .ty__h1, .proj__name { text-wrap: balance; }
p, li, summary, figcaption, .res__k { text-wrap: pretty; }
.nw { white-space: nowrap; }
.calc__h1 .h1g { white-space: nowrap; }
@media (max-width: 359px) { .calc__h1 { font-size: 32px; } }

/* Điều kiện áp dụng công cụ tính (góp ý Fanaro 27/11) */
.calc__cond { font-size: 14px; margin-top: -16px; }

/* Dự án ở không gian khác */
.more { display: flex; flex-direction: column; gap: 32px; }
.more__head { display: flex; flex-direction: column; gap: 12px; max-width: 46em; }
.more__sub { color: var(--steel); font-size: 1.1rem; }
.more__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
@media (min-width: 960px) { .more__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } }
.more__grid img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; display: block; background: var(--mist); }
.more__k { font-weight: 500; margin-top: 12px; }
.more__n { color: var(--steel); font-size: 14px; }

/* Trang cảm ơn: dòng ước tính và quạt quay bên phải (chỉ desktop) */
.ty__est { font-size: 1.05rem; margin-top: -8px; }
.ty__est b { font-weight: 500; }
.ty__fan { display: none; }
@media (min-width: 960px) {
  .ty__in { position: relative; }
  .ty__fan { display: block; position: absolute; right: 0; top: 50%; width: clamp(280px, 27vw, 380px); margin-top: clamp(-190px, -13.5vw, -140px); filter: drop-shadow(0 10px 24px rgba(14, 36, 51, 0.18)); }
  .ty__in > :not(.ty__fan) { max-width: min(880px, calc(100% - clamp(330px, 31vw, 440px))); }
  .ty__p, .ty__est { max-width: min(34em, calc(100% - clamp(330px, 31vw, 440px))); }
  .ty__steps li { flex-basis: 140px; }
}
