:root {
  --teal: #0397A7; --teal-d: #027A88; --teal-soft: #E6F5F7; --orange: #F8A46B; --orange-soft: #FFF1E6;
  --ink: #00425A; --muted: #5B7480; --line: #D6E3E5; --bg: #F3F8F9; --card: #FFFFFF; --err: #C62828;
  --radius: 14px; --gutter: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Be Vietnam Pro", "Helvetica Neue", Arial, sans-serif; font-size: 16px; line-height: 1.55; }
a { color: var(--teal-d); }
button, input, select, textarea { font: inherit; color: inherit; }

.shell { max-width: 820px; margin: 0 auto; padding: 0 var(--gutter) 120px; }
.steps { display: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

.hero { overflow: hidden; margin-top: var(--gutter); }
.hero-img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 1; object-fit: cover; }
.hero-body { padding: 18px 22px 16px; border-top: 6px solid var(--teal); }
.hero h1 { font-size: 24px; line-height: 1.3; margin: 0 0 8px; font-weight: 700; }
.desc { white-space: pre-line; font-size: 15px; }
.desc.collapsed { max-height: 4.8em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.more { background: none; border: 0; color: var(--teal-d); padding: 4px 0; cursor: pointer; font-weight: 600; }
.reqnote { margin: 10px 0 0; font-size: 13px; color: var(--err); }
.star { color: var(--err); }

.notice { margin-top: 12px; padding: 12px 16px; border-radius: 10px; background: var(--orange-soft); font-size: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.notice button { background: none; border: 0; color: var(--teal-d); font-weight: 600; cursor: pointer; padding: 0; }

.progress { height: 6px; background: var(--line); border-radius: 99px; margin: 16px 0 4px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--teal); transition: width .3s; }

.sec { padding: 18px 22px; margin-top: 12px; border-left: 6px solid var(--teal); }
.sec h2 { margin: 0; font-size: 20px; line-height: 1.35; }
.sec p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }

.q { padding: 18px 22px; margin-top: 12px; scroll-margin-top: 16px; }
.q.invalid { border-color: var(--err); box-shadow: 0 0 0 1px var(--err) inset; }
.q > label, .q > .qt { display: block; font-weight: 600; font-size: 16.5px; line-height: 1.4; }
.help { color: var(--muted); font-size: 14px; margin: 4px 0 10px; }
.err { color: var(--err); font-size: 14px; margin-top: 8px; display: none; }
.invalid > .err, .f.invalid .err { display: block; }

input[type=text], input[type=email], input[type=tel], input[type=url], input[type=number], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 16px; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
::placeholder { color: #9AAEB5; opacity: 1; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.q:not(.repeat) > input, .q > textarea, .q > select { margin-top: 6px; }

.opts { display: grid; gap: 8px; margin-top: 8px; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; min-height: 48px; background: #fff; }
.opt:hover { border-color: var(--teal); }
.opt input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--teal); flex: none; }
.opt.on { border-color: var(--teal); background: var(--teal-soft); }
.opt .other-in { display: block; width: 100%; height: auto; min-height: 42px; margin: 8px 0 0; flex: none; }
.chips { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.chips .opt { padding: 10px 12px; }

.rows { display: grid; gap: 12px; margin-top: 10px; }
.row { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #FAFDFD; position: relative; }
.row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 600; color: var(--teal-d); font-size: 14.5px; }
.row-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 6px 8px; border-radius: 8px; }
.row-del:hover { background: var(--line); color: var(--err); }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grid > .f { grid-column: 1 / -1; }
.grid > .f.short { grid-column: auto; }
.f > label { display: block; font-size: 14.5px; font-weight: 500; margin-bottom: 4px; }
.f .help { margin: -2px 0 6px; font-size: 13px; }
.f.wide { grid-column: 1 / -1; }
.f.invalid input, .f.invalid select { border-color: var(--err); }
.add { margin-top: 12px; }

.drop { margin-top: 10px; border: 2px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; background: #FAFDFD; }
.drop.over { border-color: var(--teal); background: var(--teal-soft); }
.drop p { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.thumb { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; font-size: 12px; position: relative; }
.thumb img, .thumb .pdf { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--teal-soft); }
.thumb .pdf { display: grid; place-items: center; font-weight: 700; color: var(--teal-d); font-size: 16px; }
.thumb span { display: block; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,66,90,.75); color: #fff; cursor: pointer; font-size: 16px; line-height: 1; }

.btn { min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid var(--teal); font-weight: 600; cursor: pointer; font-size: 16px; }
.btn.primary { background: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-d); }
.btn.ghost { background: #fff; color: var(--teal-d); }
.btn.soft { background: var(--teal-soft); color: var(--teal-d); border-color: transparent; }
.btn[disabled] { opacity: .5; cursor: default; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; gap: 10px; align-items: center; justify-content: space-between;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
  backdrop-filter: blur(6px); }
.nav .btn { flex: 1; }
.nav-step { font-size: 13px; color: var(--muted); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.done { padding: 28px 22px; margin-top: 16px; text-align: center; }
.done h2 { margin: 6px 0; }
.done .code { display: inline-block; margin: 10px 0; padding: 10px 18px; border-radius: 10px; background: var(--teal-soft); font-weight: 700; font-size: 20px; letter-spacing: .5px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin: 28px 0 8px; }
.muted { color: var(--muted); font-size: 14px; }

.overlay { position: fixed; inset: 0; background: rgba(0,40,55,.45); display: grid; place-items: center; z-index: 50; padding: var(--gutter); }
.overlay-box { background: #fff; border-radius: var(--radius); padding: 22px; width: min(420px, 100%); text-align: center; }
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 12px 0; }
.bar span { display: block; height: 100%; width: 0; background: var(--teal); transition: width .2s; }

/* Điện thoại nhỏ */
@media (max-width: 420px) {
  .hero h1 { font-size: 21px; }
  .q, .sec, .hero-body { padding-left: 16px; padding-right: 16px; }
  .chips { grid-template-columns: 1fr 1fr; }
  .nav-step { display: none; }
}
/* iPad dọc trở lên */
@media (min-width: 700px) {
  .grid > .f { grid-column: auto; }
  .grid > .f.wide, .grid > .f.wide2 { grid-column: 1 / -1; }
  .nav { position: static; padding: 0; background: none; border: 0; margin-top: 18px; backdrop-filter: none; }
  .nav .btn { flex: 0 0 auto; min-width: 150px; }
  .shell { padding-bottom: 40px; }
}
/* iPad ngang, máy tính: cột các bước bên trái */
@media (min-width: 1100px) {
  .shell { max-width: 1120px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; }
  .steps { display: block; position: sticky; top: 16px; align-self: start; margin-top: 16px; padding: 14px; }
  .steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .steps li { padding: 10px 12px; border-radius: 10px; font-size: 14.5px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
  .steps li b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--ink); font-size: 13px; flex: none; }
  .steps li.now { background: var(--teal-soft); color: var(--ink); font-weight: 600; }
  .steps li.now b, .steps li.ok b { background: var(--teal); color: #fff; }
  .steps .logo { display: block; height: 34px; margin: 4px 6px 14px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .grid > .f.wide2 { grid-column: span 2; }
  .progress { display: none; }
}

.nojs { margin: 16px; padding: 16px; }
.done-logo { height: 44px; width: auto; display: block; margin: 0 auto; }
.grow { flex: 1; }
.pick { display: inline-flex; align-items: center; }
.hero-mini { display: none; }
.hero.compact .desc, .hero.compact .more, .hero.compact .hero-body, .hero.compact .hero-img { display: none; }
.hero.compact .hero-mini { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 4px solid var(--teal); }
.hero-mini img { height: 30px; width: auto; display: block; }
.hero-mini span { font-weight: 600; font-size: 15px; color: var(--ink); padding-left: 14px; border-left: 1px solid var(--line); }
