:root {
  --navy: #12223d;
  --blue: #2864dc;
  --blue-dark: #1748aa;
  --blue-soft: #eef4ff;
  --ink: #182033;
  --muted: #667085;
  --line: #dfe5ef;
  --surface: #ffffff;
  --background: #f4f7fb;
  --danger: #d92d20;
  --shadow: 0 16px 48px rgba(21, 39, 70, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 6%, rgba(60, 119, 235, 0.1), transparent 26rem),
    linear-gradient(180deg, #f7f9fc 0%, var(--background) 100%);
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  line-height: 1.55;
}

button, input, textarea { font: inherit; }

.page-shell { width: min(100% - 32px, 920px); margin: 0 auto; padding: 72px 0 64px; }

.hero { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start; margin-bottom: 30px; }

.brand-mark {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px;
  color: white; background: linear-gradient(145deg, #3575ef, #1746a5); box-shadow: 0 10px 24px rgba(40, 100, 220, 0.28);
}

.brand-mark svg { width: 32px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow, .section-heading p { margin: 0 0 5px; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .13em; }
h1 { margin: 0; color: var(--navy); font-size: clamp(30px, 5vw, 45px); line-height: 1.18; letter-spacing: -.04em; }
.hero-copy { max-width: 700px; margin: 14px 0 0; color: var(--muted); font-size: 16px; }

.progress-card { position: sticky; z-index: 10; top: 14px; padding: 16px 20px; margin-bottom: 20px; border: 1px solid rgba(223,229,239,.9); border-radius: 16px; background: rgba(255,255,255,.9); box-shadow: 0 8px 30px rgba(21,39,70,.07); backdrop-filter: blur(12px); }
.progress-copy { display: flex; justify-content: space-between; margin-bottom: 9px; color: var(--muted); font-size: 12px; font-weight: 600; }
.progress-copy strong { color: var(--blue); }
.progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: #e7ecf4; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f73ec, #55a0ff); transition: width .25s ease; }

#surveyForm { display: grid; gap: 20px; }
.form-section { padding: 34px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.section-heading { display: flex; gap: 14px; align-items: center; padding-bottom: 24px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.section-number { display: grid; flex: 0 0 auto; place-items: center; width: 44px; height: 44px; color: var(--blue); border-radius: 13px; background: var(--blue-soft); font-size: 13px; font-weight: 700; }
.section-heading p { margin-bottom: 1px; }
.section-heading h2 { margin: 0; color: var(--navy); font-size: 22px; letter-spacing: -.025em; }
.fields-grid { display: grid; gap: 22px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-width { grid-column: 1 / -1; }

.field { display: grid; min-width: 0; gap: 9px; margin: 0; padding: 0; border: 0; }
.field > span, .field legend { color: #344054; font-size: 14px; font-weight: 600; }
.field b { color: var(--danger); }
input, textarea {
  width: 100%; border: 1px solid #d5dce7; border-radius: 11px; outline: none; color: var(--ink); background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input { height: 48px; padding: 0 14px; }
textarea { min-height: 96px; padding: 12px 14px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #98a2b3; }
input:hover, textarea:hover { border-color: #aeb8c7; }
input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(40,100,220,.11); }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); background: #fffafa; }
.field.invalid::after { content: "Vui lòng điền thông tin này"; color: var(--danger); font-size: 12px; }

.radio-field { gap: 12px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice span { display: block; padding: 10px 14px; color: #475467; border: 1px solid #d5dce7; border-radius: 10px; background: #fff; font-size: 13px; font-weight: 500; transition: .2s ease; }
.choice span:hover { border-color: #9eb7e6; background: #f8faff; }
.choice input:checked + span { color: var(--blue-dark); border-color: #79a3f5; background: var(--blue-soft); box-shadow: inset 0 0 0 1px #79a3f5; }
.choice input:focus-visible + span { outline: 3px solid rgba(40,100,220,.2); }
.radio-field.invalid .choice-row::after { content: "Vui lòng chọn một phương án"; flex-basis: 100%; color: var(--danger); font-size: 12px; }

.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 8px 0; }
.form-actions p { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 12px; }
.saved-dot { width: 8px; height: 8px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 3px #d1fadf; }
button { cursor: pointer; border: 0; border-radius: 11px; font-weight: 600; }
.form-actions button { min-width: 175px; padding: 14px 20px; color: white; background: linear-gradient(135deg, #2f73ec, #1a4eb7); box-shadow: 0 10px 22px rgba(40,100,220,.25); transition: transform .2s, box-shadow .2s; }
.form-actions button:hover { transform: translateY(-2px); box-shadow: 0 13px 26px rgba(40,100,220,.32); }
.form-actions button span { margin-left: 8px; }
.form-actions button:disabled { cursor: wait; opacity: .7; transform: none; }
.submit-error { margin: 0 8px; padding: 12px 14px; color: #b42318; border: 1px solid #fecdca; border-radius: 10px; background: #fef3f2; font-size: 13px; text-align: center; }

.success-card { padding: 60px 34px; text-align: center; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); }
.success-icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 22px; color: white; border-radius: 50%; background: #12b76a; box-shadow: 0 10px 26px rgba(18,183,106,.25); font-size: 30px; }
.success-card h2 { margin: 4px 0 12px; color: var(--navy); font-size: 28px; }
.success-card > p:not(.eyebrow) { max-width: 580px; margin: 0 auto 26px; color: var(--muted); }
.success-card button { padding: 12px 18px; color: var(--blue-dark); background: var(--blue-soft); }

@media (max-width: 680px) {
  .page-shell { width: min(100% - 22px, 920px); padding-top: 36px; }
  .hero { grid-template-columns: 1fr; gap: 15px; }
  .brand-mark { width: 46px; height: 46px; border-radius: 14px; }
  .form-section { padding: 24px 18px; border-radius: 18px; }
  .two-columns { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .section-heading { align-items: flex-start; }
  .form-actions { flex-direction: column-reverse; align-items: stretch; padding-top: 8px; }
  .form-actions p { justify-content: center; text-align: center; }
  .choice-row { display: grid; grid-template-columns: 1fr; }
  .progress-card { top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
