/* Landing Vaytien – TNEX Finance
   Bố cục: hero xanh (form bên trái, ảnh bên phải) → thẻ trắng "Ước tính khoản vay" đè lên mép hero
   → 3 bước → lý do chọn TNEX → footer. Một cột trên mobile. */

:root {
  --sky-1: #5ccaf7;
  --sky-2: #2aa6ea;
  --card-1: #3b95e8;
  --card-2: #2366cf;
  --primary: #00a3e0;
  --primary-hover: #0090c7;
  --card-btn: #3fa5e8;
  --ink: #1b2c4f;
  --muted: #6b7a90;
  --line: #e2e8f0;
  --bg: #f1f4f8;
  --surface: #ffffff;
  --track: #d6ecfa;
  --green: #2bc48a;
  --mint: #e9faf3;
  --error: #e5484d;
  --radius-lg: 32px;
  --radius: 16px;
  --font: "Quicksand", "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.25; }
.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 14px 32px;
  border: 0; border-radius: 8px;
  font: 700 16px/1.2 var(--font); color: #fff; text-decoration: none; text-align: center;
  cursor: pointer; transition: background-color .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, .modal__close:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
.btn--primary { background: var(--primary); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--card { width: 100%; min-height: 60px; background: var(--card-btn); }
.btn--card:hover { background: #4fb0ee; }
.btn[disabled] { opacity: .7; cursor: progress; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 100%);
  color: #fff;
  overflow: hidden;
}
.hero__inner {
  max-width: 1220px; margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-right, 0px)) 120px max(16px, env(safe-area-inset-left, 0px));
  display: grid; grid-template-columns: minmax(0, 610px) minmax(0, 1fr); gap: 24px; align-items: center;
}
.hero__left { display: grid; gap: 26px; justify-items: center; min-width: 0; }
.hero__logo { color: #fff; text-decoration: none; }
.hero__logo img { width: 132px; height: auto; }
.hero__logo .logo-text { font-weight: 700; font-size: 26px; letter-spacing: .04em; color: #fff; text-decoration: none; }
.hero__card {
  width: 100%;
  background: linear-gradient(160deg, var(--card-1) 0%, var(--card-2) 100%);
  border-radius: 24px;
  padding: 44px 20px 32px;
  box-shadow: 0 18px 40px rgba(9, 54, 120, .18);
  display: grid; gap: 22px;
  scroll-margin-top: 24px;
}
.hero__card h1 { font-size: clamp(22px, 3.2vw, 26px); padding: 0 18px; }
.badges { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.badges li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .2); font-size: 14.5px; font-weight: 500;
}
.check {
  width: 18px; height: 18px; border-radius: 50%; background: #3cc47c; flex: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E");
  background-size: 12px; background-position: center; background-repeat: no-repeat;
}
/* căn ảnh theo giữa thẻ form (bỏ qua phần logo phía trên: 46px logo + 26px khoảng cách) */
.hero__art { align-self: center; min-width: 0; display: flex; justify-content: center; align-items: center; padding-top: 72px; }
.hero__art img { width: 100%; max-width: 600px; }

/* ---------- Form ---------- */
.form { display: grid; gap: 8px; }
.field {
  background: #fff; border-radius: 6px; padding: 9px 12px 7px;
  display: grid; gap: 2px; border: 2px solid transparent;
}
.field:focus-within { border-color: #8fd0f5; }
.field label { font-size: 13px; color: #4a5568; font-weight: 600; }
/* Câu hỏi chọn 1 (Có rồi / Chưa) */
.field--choice { margin: 0; min-width: 0; padding: 9px 12px 10px; }
.field--choice legend { float: left; width: 100%; padding: 0; font-size: 13px; color: #4a5568; font-weight: 600; }
.choice { clear: both; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 6px; }
.choice label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid #d3dde8; border-radius: 6px; padding: 8px 10px;
  font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.field .choice input[type="radio"] { accent-color: var(--card-2); margin: 0; padding: 0; width: 18px; height: 18px; flex: none; }
.choice label:has(input:checked) { border-color: var(--card-btn); background: #eaf5fd; color: var(--card-2); }
.choice label:has(input:focus-visible) { outline: 3px solid #ffd166; outline-offset: 2px; }
/* Ô chọn tỉnh/thành */
.field select {
  -webkit-appearance: none; appearance: none; width: 100%; border: 0; outline: 0; padding: 2px 24px 2px 0;
  font: 500 14px/1.6 var(--font); color: var(--ink); background: transparent; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%236b7a90' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0 center; background-size: 18px;
}
.field select:invalid, .field select.is-empty { color: #9aa5b5; }
.field select option { color: var(--ink); }
.field input {
  border: 0; outline: 0; padding: 2px 0; width: 100%;
  font: 500 14px/1.6 var(--font); color: var(--ink); background: transparent;
}
.field input::placeholder { color: #9aa5b5; }
.field--invalid { border-color: var(--error); }
.field__error { margin: -2px 0 6px; font-size: 13px; color: #ffe1e1; font-weight: 600; }
.form .btn--card { margin-top: 24px; }
.consent { margin: 4px 0 0; font-size: 12px; line-height: 1.45; color: rgba(255, 255, 255, .95); }
.consent a { color: #fff; text-decoration: underline; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Section shells ---------- */
main { display: grid; gap: 56px; padding-bottom: 72px; }
.section-title { text-align: center; font-size: clamp(22px, 2.6vw, 26px); color: var(--ink); }
.calc, .steps, .why {
  width: min(1216px, calc(100% - 2 * max(16px, env(safe-area-inset-left, 0px))));
  margin: 0 auto;
}

/* ---------- Calculator ---------- */
.calc {
  position: relative; margin-top: -36px;
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) var(--radius) var(--radius);
  padding: 32px 32px 32px; display: grid; gap: 28px;
  box-shadow: 0 10px 30px rgba(15, 45, 90, .06);
}
.calc__grid { display: grid; grid-template-columns: 1fr 1fr; }
.calc__inputs { display: grid; gap: 30px; padding-right: 26px; border-right: 1px solid var(--line); }
.calc__result { display: grid; gap: 14px; padding-left: 26px; align-content: start; }
.range { display: grid; gap: 10px; }
.range__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.range__head label { font-weight: 600; font-size: 14.5px; }
.range__head output { font-weight: 700; font-size: clamp(20px, 2.4vw, 24px); font-variant-numeric: tabular-nums; }
.range__ends { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 999px; margin: 6px 0;
  background: linear-gradient(to right, var(--card-btn) 0 var(--fill, 0%), var(--track) var(--fill, 0%) 100%);
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--card-btn); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--card-btn); border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.calc__label { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 14.5px; }
.muted { color: #9aa5b5; font-weight: 500; }
.calc__value {
  background: var(--mint); color: var(--green); border-radius: 8px;
  text-align: center; padding: 10px 12px; font-weight: 700; font-size: clamp(24px, 3vw, 30px);
  font-variant-numeric: tabular-nums;
}
.calc__rate { display: flex; justify-content: space-between; font-size: 14.5px; }
.calc__rate b { font-weight: 600; }
.calc__result .btn { justify-self: center; margin-top: 8px; min-width: 148px; padding-inline: 22px; }

.disclosure {
  background: #f5f7fa; border-radius: 10px; padding: 16px 20px 16px 34px;
  font-size: 13.5px; line-height: 1.6; position: relative;
}
.disclosure::before {
  content: ""; position: absolute; left: 16px; top: 22px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--card-btn);
}
.disclosure p { margin: 0 0 4px; }
.disclosure ul { margin: 0 0 8px; padding-left: 18px; }
.disclosure ul ul { margin: 2px 0 0; list-style: "+ "; }
.disclosure__example-title { margin-top: 8px !important; }

/* ---------- Steps ---------- */
.steps, .why { display: grid; gap: 28px; justify-items: center; }
.steps__list {
  list-style: none; margin: 0; padding: 0; width: 100%;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
}
.step {
  background: var(--surface); border-radius: var(--radius); padding: 24px 22px 26px;
  display: grid; gap: 8px; justify-items: center; text-align: center; align-content: start;
  box-shadow: 0 6px 20px rgba(15, 45, 90, .05);
}
.step__img { width: 100%; display: flex; justify-content: center; min-height: 12px; }
.step__img img { width: 120px; height: 120px; object-fit: contain; }
.step__no {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: #fff; font-weight: 700;
}
.step h3 { font-size: 18px; }
.step p { margin: 0; color: var(--muted); }

/* ---------- Why ---------- */
.why__grid { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.why__item {
  background: var(--surface); border-radius: var(--radius); padding: 24px;
  display: grid; grid-template-columns: 120px minmax(0, 1fr); column-gap: 20px; row-gap: 10px; align-items: start;
  box-shadow: 0 6px 20px rgba(15, 45, 90, .05);
}
.why__item img { grid-row: 1 / span 2; width: 120px; }
.why__item h3 { font-size: 18px; color: var(--card-2); }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 28px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #3cc47c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.why__item.no-img { grid-template-columns: 1fr; }

/* ---------- Footer ---------- */
.footer { background: linear-gradient(160deg, var(--card-1) 0%, var(--card-2) 100%); color: #fff; }
.footer__inner {
  max-width: 1220px; margin: 0 auto;
  padding: 40px max(16px, env(safe-area-inset-right, 0px)) calc(40px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center;
}
.footer__info { display: grid; gap: 8px; min-width: 0; }
.footer__info p { margin: 0; }
.footer__logo { width: 120px; margin-bottom: 6px; }
.footer__name { font-weight: 700; font-size: 17px; }
.footer__row { display: flex; gap: 10px; align-items: flex-start; }
.footer__row a { color: #fff; font-weight: 700; text-decoration: none; }
.ico { width: 20px; height: 20px; flex: none; fill: #fff; margin-top: 2px; }
.footer__app { display: grid; gap: 14px; justify-items: center; }
.footer__app img { width: auto; max-height: 260px; }
.logo-text { font-weight: 700; font-size: 24px; letter-spacing: .04em; }

/* ---------- Modals ---------- */
.hs-overlay {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(10, 25, 50, .55);
}
.modal {
  position: relative; width: min(460px, 100%);
  background: #fff; color: var(--ink); border-radius: 20px; padding: 36px 28px 28px;
  display: grid; gap: 12px; justify-items: center; text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}
.modal h3 { font-size: 22px; }
.modal p { margin: 0 0 8px; color: #4a5568; }
.modal__close {
  position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: #f1f4f8; color: #4a5568; font-size: 22px; line-height: 1; cursor: pointer;
}
.modal__icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; }
.modal__icon--ok {
  background: #3cc47c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 36px no-repeat;
}
.modal__icon--info {
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' d='M12 11v6M12 7h.01'/%3E%3C/svg%3E") center / 36px no-repeat;
}
.modal__icon--err {
  background: var(--error) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' d='M12 7v6M12 17h.01'/%3E%3C/svg%3E") center / 36px no-repeat;
}
body.modal-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; padding-bottom: 72px; }
  .hero__art { display: none; }
  .calc__grid { grid-template-columns: 1fr; gap: 28px; }
  .calc__inputs { padding-right: 0; border-right: 0; }
  .calc__result { padding-left: 0; }
  .steps__list { grid-template-columns: 1fr; }
  .why__grid { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; }
  .footer__app { justify-items: start; }
}
@media (max-width: 520px) {
  body { font-size: 14.5px; }
  .hero__card { padding: 30px 14px 22px; border-radius: 20px; }
  .hero__card h1 { padding: 0 4px; }
  .badges li { font-size: 13.5px; padding: 6px 12px 6px 8px; }
  .calc { padding: 24px 16px; border-radius: 24px 24px 16px 16px; }
  .disclosure { padding: 14px 14px 14px 26px; }
  .disclosure::before { left: 10px; }
  .why__item { grid-template-columns: 84px minmax(0, 1fr); padding: 18px; column-gap: 14px; }
  .why__item img { width: 84px; }
}
