/* Landing CareMax — tông xanh thương hiệu của ứng dụng (#2563eb) phối xanh trời và xanh ngọc, nhiều màu theo yêu cầu
   chủ dự án (tham khảo ecomax.vn): thanh menu nền xanh, tiêu đề tô gradient, khối hiện dần khi cuộn, nút liên hệ nổi.
   Slide đầu trang ít chữ (01/12/2026): ảnh thật + "Phần mềm quản lý viện dưỡng lão" + hai nút, chi tiết ở khối Tổng quan.
   Một họ chữ Be Vietnam Pro (thiết kế cho dấu tiếng Việt).
   CSP không cho thuộc tính style trong HTML: mọi trang trí nằm ở đây, độ trễ hiệu ứng dùng :nth-child. */
:root {
  --paper: #f5f8fd;
  --surface: #ffffff;
  --tint: #edf3ff;
  --ink: #0f1b33;
  --ink-2: #47566e;
  --ink-3: #64738a;
  --line: #dbe4f3;

  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #e6eefe;
  --sky: #38bdf8;
  --mint: #2dd4bf;
  --teal: #0d9488;
  --teal-soft: #dcf5f1;
  --violet: #7c3aed;
  --orange: #f59e0b;
  --amber: #8f5600;
  --amber-soft: #fdf0d8;
  --navy: #0a1a3f;
  --navy-2: #12295e;

  --g-bar: linear-gradient(90deg, #1e40af 0%, #2563eb 55%, #0284c7 100%);
  --g-hero: linear-gradient(160deg, #081634 0%, #0d2357 55%, #123a8c 100%);
  --g-btn: linear-gradient(135deg, #2563eb 0%, #1d4ed8 60%, #0369a1 100%);
  --g-text: linear-gradient(90deg, #7dd3fc 0%, #5eead4 60%, #a7f3d0 100%);
  --g-text-dark: linear-gradient(90deg, #2563eb 0%, #0891b2 60%, #0d9488 100%);

  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wrap: 1180px;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 20px;
  --shadow: 0 18px 40px -22px rgba(15, 27, 51, .35);
  --shadow-lg: 0 40px 80px -40px rgba(10, 26, 63, .55);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.015em; text-wrap: balance; }
p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; border-radius: 4px; }
img, svg { display: block; }

.wrap { position: relative; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 60; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r-sm); }
.skip:focus { top: 12px; color: #fff; }

.grad-text { background: var(--g-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-text-dark { background: var(--g-text-dark); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Nút */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent;
  font: 600 16px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s, border-color .18s, color .18s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--g-btn); color: #fff; box-shadow: 0 10px 24px -10px rgba(37, 99, 235, .7); }
.btn-primary:hover { color: #fff; box-shadow: 0 16px 32px -12px rgba(37, 99, 235, .8); }
.btn-light { background: #fff; color: var(--blue-dark); box-shadow: 0 10px 26px -12px rgba(0, 0, 0, .45); }
.btn-light:hover { color: var(--blue-dark); box-shadow: 0 16px 34px -12px rgba(56, 189, 248, .65); }
.btn-ghost { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .6); }
.btn-quiet { background: var(--surface); color: var(--blue-dark); border-color: #c8d6f0; }
.btn-quiet:hover { color: var(--blue-dark); border-color: var(--blue); box-shadow: 0 10px 22px -14px rgba(37, 99, 235, .7); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 15px; }
.btn-block { width: 100%; }

/* Thanh menu nền xanh */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--g-bar); color: #fff; transition: box-shadow .2s; }
.topbar.is-scrolled { box-shadow: 0 10px 30px -12px rgba(10, 26, 63, .6); }
.topbar-in { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; color: #fff; text-decoration: none; letter-spacing: -0.01em; }
.brand:hover { color: #fff; }
/* Logo xanh ngọc chìm trên nền xanh dương/navy → đặt trong ô trắng bo góc */
.brand-badge { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #fff; box-shadow: 0 6px 16px -8px rgba(10, 26, 63, .55); }
.brand-badge img { width: 34px; height: 34px; }
.menu { display: flex; align-items: center; gap: 22px; margin-left: auto; font-size: 15.5px; }
.menu a:not(.btn) { position: relative; color: rgba(255, 255, 255, .88); text-decoration: none; font-weight: 500; padding: 6px 0; white-space: nowrap; }
.menu a:not(.btn)::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: #a5f3fc;
  transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.menu a:not(.btn):hover { color: #fff; }
.menu a:not(.btn):hover::after { transform: scaleX(1); }
.menu .menu-hotline { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 700; }
.menu .menu-login { color: #fff; }
.menu-btn { display: none; margin-left: auto; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .35); border-radius: var(--r-sm); padding: 8px; color: #fff; cursor: pointer; }

/* Slide đầu trang: ảnh thật chiếm cả khung, lớp navy chỉ phủ phía chữ (trái) để người trong ảnh vẫn rõ.
   Chữ chỉ nói sản phẩm là gì; dải số liệu bên dưới đè lên mép dưới slide. */
.hero { position: relative; overflow: hidden; color: #fff; background: var(--navy); }
.hero-slide { position: relative; display: grid; align-items: center; min-height: clamp(560px, calc(100svh - 68px), 780px); padding: 72px 0 128px; }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 68% 38%; }
.hero-slide::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, rgba(8, 22, 52, .94) 0%, rgba(10, 30, 76, .84) 30%, rgba(14, 44, 110, .38) 54%, rgba(14, 44, 110, 0) 72%),
    linear-gradient(0deg, rgba(8, 22, 52, .55) 0%, rgba(8, 22, 52, 0) 32%);
}
/* Vạch màu thương hiệu dưới chân slide */
.hero-slide::after { content: ''; position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--sky), var(--blue) 45%, var(--mint)); }
.hero-in { position: relative; z-index: 2; width: 100%; }
.hero-copy { max-width: 620px; }
.hero h1 { font-weight: 700; letter-spacing: -0.03em; }
.hero-h-small { display: block; font-size: clamp(1.45rem, 2.5vw, 2.1rem); font-weight: 600; letter-spacing: -0.015em; color: #d6e6ff; }
/* Chữ tô gradient: chừa đệm trên dưới để dấu tiếng Việt (ễ, ưỡ) không bị cắt khỏi vùng tô */
.hero-h-big {
  display: block; margin-top: 2px; padding: .08em 0 .06em; font-size: clamp(2.9rem, 6vw, 4.9rem); font-weight: 800; line-height: 1.12;
  background: var(--g-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { margin-top: 18px; font-size: 19px; color: #dbe7fb; max-width: 30em; text-wrap: balance; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.glow { position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; }

/* Tổng quan: chữ trái, bảng một ngày của cư dân phải */
.overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 72px; align-items: center; }
.overview h2 { font-size: clamp(1.8rem, 3.1vw, 2.5rem); font-weight: 700; }
.overview-copy > p { margin-top: 16px; font-size: 18px; color: var(--ink-2); max-width: 32em; }

/* Bảng một ngày của cư dân */
.dayboard {
  position: relative; color: var(--ink); background: var(--surface); border-radius: var(--r-lg); padding: 24px 26px 16px;
  border: 1px solid #e3ebf8; box-shadow: 0 0 80px -20px rgba(56, 189, 248, .45), var(--shadow-lg);
}
.dayboard-head { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.dayboard-avatar { grid-row: span 2; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--sky), var(--blue)); color: #fff; font-weight: 700; font-size: 15px; }
.dayboard-who { font-weight: 700; font-size: 18px; line-height: 1.3; }
.dayboard-where { font-size: 14px; color: var(--ink-3); }
.day { position: relative; padding: 10px 0 0; }
.day::before { content: ''; position: absolute; left: 71px; top: 22px; bottom: 22px; width: 2px; background: linear-gradient(var(--teal) 0%, var(--teal) 55%, var(--line) 62%); }
.ev { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 36px; padding: 9px 0; }
.ev time { font-size: 14.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; padding-top: 1px; }
.ev::before { content: ''; position: absolute; left: 65px; top: 14px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); }
.ev strong { display: block; font-weight: 600; font-size: 15.5px; line-height: 1.35; }
.ev span { display: block; font-size: 14px; color: var(--ink-3); line-height: 1.45; margin-top: 2px; }
.ev.is-done::before { background: var(--teal); border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.ev.is-alert::before { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 0 4px var(--amber-soft); }
.ev.is-alert strong { color: var(--amber); }
.ev.is-alert div { background: var(--amber-soft); margin: -6px 0 -6px -12px; padding: 6px 12px; border-radius: var(--r-sm); }
.ev.is-next strong { color: var(--ink-2); font-weight: 500; }
.now { position: relative; height: 26px; display: flex; align-items: center; }
.now::before { content: ''; position: absolute; left: 60px; right: 0; top: 50%; height: 2px; background: linear-gradient(90deg, var(--blue), var(--sky)); }
.now span { position: relative; z-index: 1; font-size: 12.5px; font-weight: 700; color: #fff; background: var(--blue); border-radius: 999px; padding: 2px 9px; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 4px var(--blue-soft); }

/* Dải số liệu nổi chồng lên mép dưới hero */
.stats { position: relative; z-index: 2; margin-top: -56px; }
.stats-in { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.stats-in li { padding: 26px 28px; border-left: 1px solid var(--line); }
.stats-in li:first-child { border-left: 0; }
.stats-in strong { display: block; font-size: 40px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; background: var(--g-text-dark); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.stats-in span { display: block; margin-top: 6px; font-size: 15px; color: var(--ink-2); }

/* Khối nội dung */
.sec { position: relative; padding: 100px 0; }
.sec-tint { background: linear-gradient(180deg, var(--tint), #f4f9ff); }
.sec-white { background: var(--surface); border-top: 1px solid #e6edf8; }
.sec-head { max-width: 46em; margin-bottom: 52px; }
.sec-head h2, .faq-wrap h2, .contact h2, .family h2 { font-size: clamp(1.8rem, 3.1vw, 2.5rem); font-weight: 700; }
.sec-head p { margin-top: 16px; font-size: 18px; color: var(--ink-2); max-width: 40em; }

/* Quy trình: chuỗi bước thật nên có đánh số; hai giai đoạn hai màu (xanh dương trước khi vào ở, xanh ngọc sau) */
.flow { --gap: 20px; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 4fr); gap: var(--gap); counter-reset: step; }
.flow-phase { --c1: var(--sky); --c2: var(--blue); --rule: #bfdbfe; --ink-c: var(--blue-dark); }
.flow-after { --c1: var(--mint); --c2: var(--teal); --rule: #99f6e4; --ink-c: var(--teal); }
.flow-phase-name { font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--ink-c); padding-bottom: 10px; margin-bottom: 26px; border-bottom: 2px solid var(--rule); }
.flow-phase ol { display: grid; gap: var(--gap); }
.flow-before ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.flow-after ol { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.flow li { position: relative; counter-increment: step; padding-top: 60px; }
.flow li::before {
  content: counter(step); position: absolute; top: 0; left: 0; z-index: 1; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 16px; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 10px 20px -8px var(--c2);
}
.flow li::after { content: ''; position: absolute; top: 20px; left: 52px; right: calc(var(--gap) * -1 + 8px); height: 2px; background: var(--rule); }
.flow-before li:last-child::after { background: linear-gradient(90deg, #bfdbfe, #99f6e4); }
.flow-after li:last-child::after { display: none; }
.flow h4 { margin: 0; font-size: 16.5px; font-weight: 700; line-height: 1.3; text-wrap: balance; }
.flow p { margin-top: 8px; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }

/* Tính năng theo bộ phận: mỗi bộ phận một màu. Có JS thì thành tab (một bộ phận mỗi lần), không JS thì xếp chồng. */
.depts { display: grid; gap: 22px; }
.dept-care { --c1: #5eead4; --c2: var(--teal); --soft: var(--teal-soft); --ink-c: #0f766e; }
.dept-sales { --c1: var(--sky); --c2: var(--blue); --soft: var(--blue-soft); --ink-c: var(--blue-dark); }
.dept-finance { --c1: #c4b5fd; --c2: var(--violet); --soft: #efe9fe; --ink-c: #6d28d9; }
.dept-board { --c1: #fcd34d; --c2: #ea580c; --soft: #fff1e2; --ink-c: #c2410c; }
.dept-tabs { display: none; }
.js .dept-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.js .dept:not(.is-active) { display: none; }
.dept-tab {
  display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 14px; text-align: left; cursor: pointer;
  font: 600 15.5px/1.3 var(--font); color: var(--ink-2); background: rgba(255, 255, 255, .55);
  border: 1px solid #dbe4f3; border-radius: var(--r); transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s;
}
.dept-tab .dept-icon { width: 44px; height: 44px; border-radius: 12px; opacity: .55; filter: saturate(.4); transition: opacity .2s, filter .2s; }
.dept-tab .dept-icon svg { width: 22px; height: 22px; }
.dept-tab:hover { color: var(--ink); background: var(--surface); }
.dept-tab:hover .dept-icon { opacity: .85; filter: none; }
.dept-tab.is-active { color: var(--ink); background: var(--surface); border-color: var(--c2); box-shadow: 0 0 0 1px var(--c2), 0 18px 34px -24px var(--c2); }
.dept-tab.is-active .dept-icon { opacity: 1; filter: none; }
.dept {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 44px; align-items: center;
  background: var(--surface); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow);
  border: 1px solid #e3ebf8; overflow: hidden;
}
.dept::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--c1), var(--c2)); }
.dept-photo { width: 100%; height: 100%; min-height: 300px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); box-shadow: 0 16px 30px -20px var(--c2); }
.dept-icon { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 12px 24px -12px var(--c2); }
.dept-icon svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dept-body { padding: 8px 8px 8px 0; }
.dept-body h3 { font-size: 24px; font-weight: 700; }
.dept-tagline { margin-top: 6px; color: var(--ink-c); font-size: 16.5px; font-weight: 500; }
.feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 32px; margin-top: 26px; align-items: start; }
.feats div { padding-left: 16px; border-left: 2px solid var(--soft); }
.feats dt { font-weight: 600; font-size: 16.5px; }
.feats dd { margin-top: 4px; color: var(--ink-2); font-size: 15px; line-height: 1.55; }

/* Người nhà */
.family { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 72px; align-items: center; }
.family-copy > p:not(.badge) { margin-top: 16px; font-size: 18px; color: var(--ink-2); max-width: 32em; }
.badge { display: inline-block; margin-bottom: 18px; font-size: 14px; font-weight: 600; color: var(--teal); background: var(--teal-soft); border-radius: 999px; padding: 5px 14px; }
.ticks { margin-top: 24px; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 32px; }
.ticks li::before { content: ''; position: absolute; left: 0; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg, var(--mint), var(--teal)); }
.ticks li::after { content: ''; position: absolute; left: 7px; top: 8px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
/* Ảnh lớn, khung điện thoại đè góc dưới trái (phần cây cỏ mờ của ảnh) */
.family-visual { position: relative; padding: 0 0 70px 90px; }
.family-photo { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 24px; box-shadow: var(--shadow-lg); }
.phone { position: absolute; left: 0; bottom: 0; width: 300px; background: #e7eef8; border-radius: 28px; padding: 16px 14px 18px; border: 8px solid var(--navy); box-shadow: 0 30px 60px -24px rgba(10, 26, 63, .65); font-size: 14px; }
.phone-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid #d3deec; }
.phone-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--mint), var(--teal)); color: #fff; font-weight: 700; font-size: 14px; }
.phone-head strong { display: block; font-size: 15px; }
.phone-head div > span { display: block; font-size: 13px; color: var(--ink-3); }
.msg { background: var(--surface); border-radius: 4px 14px 14px 14px; padding: 10px 12px 6px; font-size: 13.5px; line-height: 1.45; margin-right: 14px; box-shadow: 0 6px 14px -10px rgba(15, 27, 51, .4); }
.msg + .msg { margin-top: 12px; }
.msg p + p { margin-top: 4px; color: var(--ink-2); }
.msg time { display: block; text-align: right; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.msg-alert { box-shadow: inset 3px 0 0 var(--orange), 0 6px 14px -10px rgba(15, 27, 51, .4); }

/* Chuỗi — khối navy có quầng sáng */
.sec-night {
  overflow: hidden; color: #e3ebf8;
  background: linear-gradient(180deg, rgba(8, 22, 52, .93) 0%, rgba(10, 28, 70, .86) 60%, rgba(8, 22, 52, .95) 100%), url('/img/chain-bg-1600.webp') center / cover no-repeat, var(--navy);
}
.sec-night .sec-head p { color: #b2c2de; }
.glow-c { width: 520px; height: 520px; right: -180px; bottom: -260px; background: rgba(124, 58, 237, .35); }
.night-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.night-list li { background: rgba(255, 255, 255, .05); border: 1px solid rgba(148, 197, 255, .18); border-radius: var(--r-lg); padding: 24px 22px; transition: background-color .25s, border-color .25s, transform .25s; }
.night-list li:hover { background: rgba(255, 255, 255, .09); border-color: rgba(125, 211, 252, .45); transform: translateY(-3px); }
.night-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; margin-bottom: 18px; background: linear-gradient(135deg, rgba(56, 189, 248, .3), rgba(45, 212, 191, .25)); border: 1px solid rgba(125, 211, 252, .35); }
.night-icon svg { width: 24px; height: 24px; fill: none; stroke: #a5f3fc; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.night-list h3 { font-size: 17px; font-weight: 600; color: #fff; }
.night-list p { margin-top: 8px; font-size: 15px; color: #b2c2de; }

/* Bảng giá */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px 28px; box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease; }
.plan:hover { transform: translateY(-4px); box-shadow: 0 30px 50px -30px rgba(15, 27, 51, .45); }
.plan h3 { font-size: 23px; font-weight: 700; }
.plan-for { margin-top: 6px; color: var(--ink-2); font-size: 15.5px; }
.plan-plus { margin-top: 22px; font-size: 14.5px; font-weight: 600; color: var(--ink-3); }
.plan-plus + .ticks { margin-top: 12px; }
.plan .ticks { flex: 1; font-size: 15.5px; margin-bottom: 28px; }
.plan-main { border: 0; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--sky), var(--blue) 50%, var(--mint)) border-box; border: 2px solid transparent; box-shadow: 0 34px 70px -36px rgba(37, 99, 235, .75); }
.plan-flag { position: absolute; top: -14px; left: 28px; font-size: 13px; font-weight: 700; color: #fff; background: var(--g-btn); border-radius: 999px; padding: 5px 12px; }

/* Triển khai */
.rollout-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; margin-bottom: 52px; }
.rollout-head .sec-head { margin-bottom: 0; }
.rollout-photo { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.rollout { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; counter-reset: roll; }
.rollout li { position: relative; overflow: hidden; counter-increment: roll; background: var(--surface); border-radius: var(--r-lg); padding: 30px 24px 28px; box-shadow: var(--shadow); }
.rollout li::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--sky), var(--blue) 50%, var(--mint)); }
.rollout li::before { content: 'Bước ' counter(roll); display: inline-block; margin-bottom: 14px; font-size: 13.5px; font-weight: 700; color: var(--blue-dark); background: var(--blue-soft); border-radius: 999px; padding: 4px 12px; }
.rollout h3 { font-size: 18px; font-weight: 700; }
.rollout p { margin-top: 8px; font-size: 15px; color: var(--ink-2); }

/* Hỏi đáp: cột trái đứng yên khi cuộn danh sách câu hỏi */
.faq-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 48px; align-items: start; }
.faq-side { position: sticky; top: 100px; }
.faq-side p { margin-top: 14px; color: var(--ink-2); max-width: 22em; }
.faq-side .btn { margin-top: 22px; }
.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .2s, box-shadow .2s; }
.faq details[open] { border-color: #a9c4f5; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 56px 18px 22px; position: relative; font-weight: 600; font-size: 16.5px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 18px; top: 50%; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; font-weight: 500; color: #fff; background: var(--g-btn); transition: transform .25s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 56px 20px 22px; color: var(--ink-2); max-width: 44em; }

/* Liên hệ — nền xanh gradient, form trắng */
.sec-contact { overflow: hidden; background: var(--g-bar); color: #fff; }
.glow-d { width: 560px; height: 560px; left: -220px; top: -260px; background: rgba(45, 212, 191, .35); }
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 64px; align-items: start; }
.contact-copy > p { margin-top: 16px; font-size: 18px; color: #dbe8ff; max-width: 28em; }
.contact-info { margin-top: 32px; display: grid; gap: 16px; }
.contact-info dt { font-size: 14px; color: #bcd3fb; }
.contact-info dd { font-size: 20px; font-weight: 700; }
.contact-info a { color: #fff; text-decoration: none; }
.contact-info a:hover { text-decoration: underline; }
.contact-photo { display: block; width: 100%; max-width: 440px; height: auto; aspect-ratio: 4 / 3; object-fit: cover; margin-top: 36px; border-radius: var(--r-lg); border: 6px solid rgba(255, 255, 255, .22); box-shadow: 0 30px 60px -30px rgba(10, 26, 63, .8); }
.brochure { display: inline-flex; align-items: center; gap: 10px; margin-top: 28px; color: #fff; font-weight: 600; text-decoration: none; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; padding: 10px 18px; transition: background-color .2s; }
.brochure:hover { color: #fff; background: rgba(255, 255, 255, .2); }
.form-card { position: relative; color: var(--ink); background: var(--surface); border-radius: var(--r-lg); padding: 32px; display: grid; gap: 18px; box-shadow: 0 40px 80px -36px rgba(10, 26, 63, .7); }
.form-done h3 { font-size: 22px; }
.form-done p { color: var(--ink-2); }
.form-done .btn { justify-self: start; }
.form-alert { background: var(--amber-soft); color: var(--amber); border-radius: var(--r-sm); padding: 12px 14px; font-size: 15px; font-weight: 500; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field label { font-size: 15px; font-weight: 600; }
.opt { font-weight: 400; color: var(--ink-3); }
.field input:not([type='checkbox']), .field select, .field textarea {
  width: 100%; font: 400 16px/1.4 var(--font); color: var(--ink); background: #f8fbff;
  border: 1px solid #cfdaeb; border-radius: var(--r-sm); padding: 11px 12px; min-height: 48px; transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; background: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }
.field input.input-validation-error:not([type='checkbox']), .field select.input-validation-error, .field textarea.input-validation-error { border-color: var(--orange); background: #fffaf2; }
.field-err { font-size: 14px; color: var(--amber); font-weight: 500; }
.field-err:empty { display: none; }
.field-check { grid-template-columns: 22px 1fr; align-items: start; column-gap: 10px; }
.field-check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--blue); }
.field-check label { font-weight: 400; font-size: 14.5px; color: var(--ink-2); }
.field-check .field-err { grid-column: 2; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Trang văn bản */
.prose { max-width: 720px; }
.prose h1 { font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: 20px; }
.prose h2 { font-size: 20px; margin: 36px 0 10px; }
.prose p { color: var(--ink-2); }
.error-page p + p { margin-top: 28px; }

/* Chân trang: vạch màu thương hiệu trên cùng, bốn cột, dòng bản quyền */
.footer { position: relative; background: linear-gradient(180deg, #0b1d47 0%, var(--navy) 100%); color: #a9bbdb; padding: 72px 0 0; font-size: 15px; }
.footer::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--sky), var(--blue) 45%, var(--mint)); }
.footer-in { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 48px; }
.brand-light, .brand-light:hover { color: #fff; }
.footer-brand p { margin-top: 16px; max-width: 26em; line-height: 1.65; }
.footer-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.footer-h { font-size: 16px; font-weight: 600; letter-spacing: 0; color: #fff; margin-bottom: 18px; }
.footer-col ul { display: grid; gap: 12px; }
.footer a:not(.btn) { color: #c9d7ee; text-decoration: none; transition: color .15s; }
.footer a:not(.btn):hover { color: #fff; text-decoration: underline; }
.footer-contact li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start; }
.footer-contact svg { width: 18px; height: 18px; margin-top: 3px; fill: none; stroke: #7dd3fc; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.footer-contact small { display: block; font-size: 13.5px; color: #8fa3c6; }
.footer .footer-strong { color: #fff; font-weight: 700; font-size: 17px; }
.footer-contact p { line-height: 1.65; }
.footer-contact p a:not(.btn) { color: #fff; text-decoration: underline; }
.footer-bottom { margin-top: 56px; border-top: 1px solid rgba(148, 197, 255, .14); font-size: 14px; color: #7f92b4; }
.footer-bottom .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 22px; padding-bottom: 26px; }

/* Nút liên hệ nổi (chỉ có khi đã cấu hình hotline/Zalo) */
.fab { position: fixed; right: 20px; bottom: 22px; z-index: 40; display: grid; gap: 12px; }
.fab a { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; box-shadow: 0 12px 26px -10px rgba(10, 26, 63, .6); transition: transform .2s; }
.fab a:hover { color: #fff; transform: scale(1.07); }
.fab-zalo { background: linear-gradient(135deg, #3b82f6, #0068ff); }
.fab-call { position: relative; background: linear-gradient(135deg, #34d399, #059669); }

/* Hiệu ứng: chỉ khi người dùng không tắt chuyển động */
@media (prefers-reduced-motion: no-preference) {
  .fab-call::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #34d399; animation: ring 2s ease-out infinite; }

  /* Mở trang: ảnh slide lùi nhẹ về đúng khung, chữ hiện lần lượt */
  .hero-photo { animation: settle 1.8s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-copy > * { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .15s both; }
  .hero-copy > :nth-child(2) { animation-delay: .27s; }
  .hero-copy > :nth-child(3) { animation-delay: .39s; }

  /* Bảng một ngày: khi cuộn tới, các mốc đã làm điểm lần lượt, rồi vạch "bây giờ" xuất hiện */
  .js .dayboard.is-in .ev.is-done::before, .js .dayboard.is-in .ev.is-alert::before { animation: tick .35s ease-out both; }
  .js .dayboard.is-in .ev:nth-child(1)::before { animation-delay: .45s; }
  .js .dayboard.is-in .ev:nth-child(2)::before { animation-delay: .65s; }
  .js .dayboard.is-in .ev:nth-child(3)::before { animation-delay: .85s; }
  .js .dayboard.is-in .ev:nth-child(4)::before { animation-delay: 1.05s; }
  .js .dayboard.is-in .ev:nth-child(5)::before { animation-delay: 1.3s; }
  .js .dayboard.is-in .ev.is-alert div { animation: glowbg .5s ease-out 1.3s both; }
  .js .dayboard.is-in .now { animation: reveal .5s ease-out 1.65s both; }
  .js .dayboard.is-in .now::before { transform-origin: left; animation: draw .6s ease-out 1.65s both; }

  /* Đổi tab bộ phận: khối mới hiện ra tại chỗ */
  .js .dept.is-active { animation: reveal .35s ease-out both; }

  /* Hiện dần khi cuộn (site.js thêm .is-in); không có JS thì không ẩn gì */
  .js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
  .js .reveal.is-in { opacity: 1; transform: none; }
  .js :is(.flow-phase ol, .stats-in, .night-list, .plans, .rollout) > .reveal:nth-child(2) { transition-delay: .08s; }
  .js :is(.flow-phase ol, .stats-in, .night-list, .plans, .rollout) > .reveal:nth-child(3) { transition-delay: .16s; }
  .js :is(.flow-phase ol, .stats-in, .night-list, .plans, .rollout) > .reveal:nth-child(4) { transition-delay: .24s; }
  .js .flow-after .reveal { transition-delay: .24s; }
  .js .flow-after li.reveal:nth-child(2) { transition-delay: .32s; }
  .js .flow-after li.reveal:nth-child(3) { transition-delay: .4s; }
  .js .flow-after li.reveal:nth-child(4) { transition-delay: .48s; }
}
@keyframes tick { from { background: var(--surface); border-color: var(--line); box-shadow: none; transform: scale(.5); } }
@keyframes glowbg { from { background: transparent; } }
@keyframes reveal { from { opacity: 0; } }
@keyframes draw { from { transform: scaleX(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes settle { from { transform: scale(1.06); } }
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.55); opacity: 0; } }

/* Màn vừa và nhỏ */
/* Thanh menu đủ chỗ cho hotline chỉ trên màn rộng; hẹp hơn thì hotline vẫn có ở nút gọi nổi và chân trang */
@media (min-width: 961px) and (max-width: 1260px) {
  .menu .menu-hotline { display: none; }
}
@media (min-width: 961px) and (max-width: 1100px) {
  .topbar-in, .menu { gap: 16px; }
  .menu { font-size: 14.5px; }
}
/* Nút liên hệ nổi không đè lên "Lên đầu trang" */
@media (max-width: 1360px) {
  .has-fab .footer-bottom .wrap { padding-right: 96px; }
}
@media (max-width: 1080px) {
  /* Quy trình xếp dọc: số bên trái, vạch nối đi xuống */
  .flow { grid-template-columns: minmax(0, 1fr); gap: 32px; max-width: 640px; }
  .flow-phase-name { margin-bottom: 20px; }
  .flow-before ol, .flow-after ol { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .flow li { padding: 0 0 26px 62px; min-height: 72px; }
  .flow li::after, .flow-before li:last-child::after { top: 48px; bottom: 6px; left: 20px; right: auto; width: 2px; height: auto; background: var(--rule); }
  .flow-phase li:last-child::after { display: none; }
  .flow li:last-child { padding-bottom: 0; }
  .flow p { font-size: 15.5px; }
  .night-list, .rollout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-in { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-in li:nth-child(3) { border-left: 0; }
  .stats-in li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .footer-in { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 32px; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
  .menu-btn { display: inline-flex; }
  .menu {
    display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: #1e40af; padding: 8px 24px 20px; box-shadow: 0 20px 30px -16px rgba(10, 26, 63, .6);
  }
  .menu.is-open { display: flex; }
  .menu a:not(.btn) { padding: 13px 0; border-bottom: 1px solid rgba(255, 255, 255, .14); }
  .menu a:not(.btn)::after { display: none; }
  .menu .btn { margin-top: 16px; }
  /* Slide: người trong ảnh ở nửa trên, chữ nằm trên lớp navy ở nửa dưới */
  .hero-slide { align-items: end; min-height: clamp(560px, calc(100svh - 68px), 720px); padding: 200px 0 112px; }
  .hero-photo { object-position: 76% 30%; }
  .hero-h-big { font-size: clamp(2.9rem, 8vw, 4.4rem); }
  .hero-slide::before { background: linear-gradient(0deg, rgba(8, 22, 52, .97) 0%, rgba(9, 26, 64, .88) 36%, rgba(12, 36, 90, .3) 66%, rgba(12, 36, 90, 0) 100%); }
  .sec-night { background-image: linear-gradient(rgba(8, 22, 52, .92), rgba(8, 22, 52, .92)), url('/img/chain-bg-960.webp'); }
  .overview, .family, .contact, .faq-wrap, .rollout-head { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .faq-side { position: static; }
  .js .dept-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dept { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 20px; }
  .dept-photo { height: auto; min-height: 0; aspect-ratio: 16 / 9; }
  .dept-body { padding: 0 4px 4px; }
  .plans { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
  .sec { padding: 76px 0; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .lead, .sec-head p, .overview-copy > p, .family-copy > p:not(.badge), .contact-copy > p { font-size: 16.5px; }
  .hero-slide { padding: 180px 0 100px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .dayboard { padding: 20px 16px 12px; border-radius: var(--r); }
  .day::before { left: 59px; }
  .ev { grid-template-columns: 44px 1fr; gap: 30px; }
  .ev::before { left: 53px; }
  .now::before { left: 50px; }
  .stats { margin-top: -48px; }
  .stats-in li { padding: 18px 16px; }
  .stats-in strong { font-size: 32px; }
  .stats-in span { font-size: 14px; }
  .dept-tab { min-height: 60px; padding: 10px 12px; gap: 10px; font-size: 14.5px; }
  .dept-tab .dept-icon { width: 36px; height: 36px; border-radius: 10px; }
  .dept-tab .dept-icon svg { width: 19px; height: 19px; }
  .dept { padding: 16px; }
  .dept-body h3 { font-size: 21px; }
  .feats, .field-row, .night-list, .rollout { grid-template-columns: minmax(0, 1fr); }
  .form-card { padding: 22px 18px; }
  .sec { padding: 64px 0; }
  .sec-head { margin-bottom: 36px; }
  .contact-photo { display: none; } /* trên điện thoại đưa khách tới form nhanh hơn */
  .family-visual { padding: 0; }
  .phone { position: relative; width: auto; margin: -64px 16px 0; }
  .footer { padding-top: 56px; }
  .footer-in { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 20px; }
  .footer-contact { grid-column: 1 / -1; }
  .fab { right: 14px; bottom: 16px; }
  .has-fab .footer-bottom .wrap { padding-right: 16px; padding-bottom: 96px; }
  .fab a { width: 50px; height: 50px; }
}
