/* ── DESIGN TOKENS ────────────────────── */
:root {
  --red:     #E11812;
  --red-d:   #C01510;
  --red-bg:  rgba(225,24,18,.05);
  --navy:    #1A2744;
  --navy-2:  #243154;
  --teal:    #00A896;
  --teal-d:  #008F7F;
  --ink:     #1A1A2E;
  --ink-2:   #374151;
  --muted:   #6B7280;
  --border:  #E5E9F0;
  --surface: #F6F8FC;
  --white:   #FFFFFF;
  --error:   #DC2626;
  --radius:  8px;
  --shadow:  0 1px 4px rgba(26,39,68,.06);
}

/* ── RESET ────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Source Sans 3', sans-serif;
  font-size: clamp(16px, 1.1vw, 18px);
  background: var(--surface);
  color: var(--ink);
  min-height: 100dvh;
  padding-bottom: 80px;
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }

/* ── HEADER ──────────────────────────── */
.site-header {
  background: var(--navy);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 40px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo-img { height: 28px; width: auto; display: block; }
.header-right { display: flex; align-items: center; gap: 10px; }
.progress-text {
  font-size: .75rem;
  color: rgba(255,255,255,.5);
  font-weight: 500;
}
.header-badge {
  background: rgba(225,24,18,.15);
  color: #FF6B66;
  font-size: .62rem;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}

/* ── PROGRESS BAR ────────────────────── */
.progress-wrap {
  height: 4px;
  background: rgba(26,39,68,.08);
  position: sticky;
  top: 56px;
  z-index: 99;
}
.progress-fill {
  height: 100%;
  background: var(--red);
  transition: width .6s cubic-bezier(.4,0,.2,1);
  width: 0%;
}

/* ── STEPS / PAGES ───────────────────── */
.form-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(14px, 2vw, 32px) clamp(12px, 3vw, 24px);
  overflow: hidden;
}
.step { display: none; }
.step.active { display: block; animation: slideIn .35s cubic-bezier(.4,0,.2,1) forwards; }
.step.leaving { display: block; animation: slideOut .25s cubic-bezier(.4,0,.2,1) forwards; pointer-events: none; }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: none; }
}
@keyframes slideOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateX(-40px); }
}
/* Back navigation — reverse direction */
.step.active.from-left { animation-name: slideInLeft; }
.step.leaving.to-right { animation-name: slideOutRight; }
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: none; }
}
@keyframes slideOutRight {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateX(40px); }
}

/* ── INTRO CARD ──────────────────────── */
.intro-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}
.intro-top { margin-bottom: 24px; }
.intro-badge {
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--navy);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
}
.intro-card h1 {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 800;
  color: var(--navy);
  line-height: 1.15;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}
.intro-card h1 .accent { color: var(--red); }
.intro-desc {
  color: var(--ink-2);
  font-size: .95rem;
  line-height: 1.65;
  font-weight: 400;
}
.trust-block {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(0,168,150,.06);
  border: 1px solid rgba(0,168,150,.18);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
}
.trust-icon {
  color: var(--teal-d);
  flex-shrink: 0;
  margin-top: 1px;
}
.trust-text {
  font-size: .84rem;
  color: var(--teal-d);
  line-height: 1.55;
  font-weight: 400;
}
.trust-text strong { font-weight: 700; }
.btn-start {
  background: var(--red);
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: .95rem;
  padding: 13px 32px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
  width: 100%;
}
.btn-start:hover { background: var(--red-d); }
.btn-start:active { background: var(--red-d); }
.intro-footer {
  margin-top: 16px;
  font-size: .72rem;
  color: var(--muted);
  text-align: center;
  font-weight: 400;
}

/* ── SECTION CARD ────────────────────── */
.section-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.section-num {
  width: 30px; height: 30px;
  background: var(--red);
  color: var(--white);
  border-radius: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.section-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -.01em;
}
.section-sub {
  font-size: .7rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 1px;
}
.new-badge {
  margin-left: auto;
  background: rgba(0,168,150,.08);
  color: var(--teal-d);
  font-size: .58rem;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0,168,150,.2);
  white-space: nowrap;
}
.section-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── QUESTION ────────────────────────── */
.q-block { display: flex; flex-direction: column; gap: 8px; }
.q-label {
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1.45;
}
.q-num { color: var(--red); margin-right: 3px; font-weight: 700; }
.q-hint {
  font-size: .74rem;
  color: var(--muted);
  font-style: italic;
  margin-top: -4px;
}
.req { color: var(--red); margin-left: 2px; }

/* ── LIKERT SCALE ────────────────────── */
.likert-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.likert-anchors {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px 2px;
}
.likert-anchors span {
  font-size: .64rem;
  color: var(--muted);
  max-width: 90px;
  line-height: 1.3;
  font-weight: 400;
}
.likert-anchors span:first-child { text-align: left; }
.likert-anchors span:last-child { text-align: right; }
.likert-options {
  display: flex;
  padding: 6px 10px 12px;
  gap: 4px;
}
.likert-options label {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.likert-options input { display: none; }
.l-pip {
  width: 42px; height: 42px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 600; color: var(--muted);
  transition: all .14s;
  font-family: 'Poppins', sans-serif;
}
.likert-options label:hover .l-pip { border-color: var(--red); color: var(--red); }
.likert-options input:checked + .l-pip {
  background: var(--red); border-color: var(--red); color: var(--white);
}

/* ── LIKERT TABLE ────────────────────── */
.ltable { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ltable-head {
  display: grid;
  grid-template-columns: 1fr repeat(5, 42px);
  padding: 8px 12px;
  gap: 4px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.ltable-head span {
  text-align: center;
  font-size: .62rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  font-family: 'Poppins', sans-serif;
}
.ltable-head span:first-child { text-align: left; }
.ltable-row {
  display: grid;
  grid-template-columns: 1fr repeat(5, 42px);
  align-items: center;
  padding: 10px 12px;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}
.ltable-row:last-child { border-bottom: none; }
.ltable-row:hover { background: rgba(26,39,68,.02); }
.lrow-label { font-size: .82rem; color: var(--ink-2); line-height: 1.3; font-weight: 400; }
.ltable-row input { display: none; }
.ltable-row label {
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.l-dot {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 700; color: var(--muted);
  transition: all .14s;
  font-family: 'Poppins', sans-serif;
}
.ltable-row input:checked + .l-dot {
  background: var(--teal); border-color: var(--teal); color: var(--white);
}
.ltable-row label:hover .l-dot { border-color: var(--teal); }

/* ── CHECK / RADIO LIST ──────────────── */
.check-list { display: flex; flex-direction: column; gap: 5px; }
.check-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .12s, background .12s;
  background: var(--white);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.check-item:hover { border-color: var(--red); background: var(--red-bg); }
.check-item input { display: none; }
.c-box {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.check-item input:checked ~ .c-box { background: var(--navy); border-color: var(--navy); }
.check-item input:checked ~ .c-box::after {
  content: '';
  width: 8px; height: 5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}
.r-circle {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.check-item input:checked ~ .r-circle { border-color: var(--navy); background: var(--navy); }
.check-item input:checked ~ .r-circle::after {
  content: '';
  width: 8px; height: 5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}
.c-text { font-size: .84rem; color: var(--ink-2); line-height: 1.4; flex: 1; font-weight: 400; }

/* ── OUTRO ───────────────────────────── */
.outro-wrap { display: none; margin-top: 4px; }
.outro-wrap.on { display: block; }
.outro-in {
  width: 100%;
  padding: 10px 12px;
  font-size: .84rem;
  font-family: 'Source Sans 3', sans-serif;
  border: 1.5px solid var(--red);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--red-bg);
  outline: none;
}

/* ── TEXT INPUT / TEXTAREA ───────────── */
.t-input, .t-area {
  width: 100%;
  padding: 11px 14px;
  font-size: .88rem;
  font-family: 'Source Sans 3', sans-serif;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color .15s;
  resize: vertical;
}
.t-input:focus, .t-area:focus { border-color: var(--red); }
.char-count { font-size: .7rem; color: var(--muted); text-align: right; margin-top: 2px; }

/* ── YES/NO ──────────────────────────── */
.yn-list { display: flex; gap: 8px; }
.yn-item { flex: 1; }
.yn-item input { display: none; }
.yn-lbl {
  display: block; text-align: center;
  padding: 11px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .84rem; font-weight: 500; cursor: pointer; color: var(--muted);
  transition: all .12s;
  -webkit-tap-highlight-color: transparent;
}
.yn-item input:checked + .yn-lbl { border-color: var(--navy); color: var(--navy); background: rgba(26,39,68,.04); font-weight: 600; }
.yn-item:hover .yn-lbl { border-color: var(--navy); color: var(--navy); }

/* ── RANKING ─────────────────────────── */
.rank-hint { font-size: .72rem; color: var(--muted); font-style: italic; }
.rank-list { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.rank-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--white); cursor: grab;
  transition: all .12s; user-select: none;
  touch-action: none;
}
.rank-item:active { cursor: grabbing; }
.rank-item.dragging { opacity: .35; }
.rank-item.drag-over { border-color: var(--red); background: var(--red-bg); }
.r-handle { color: #C4C9D4; font-size: 1rem; flex-shrink: 0; line-height: 1; }
.r-pos {
  width: 24px; height: 24px; border-radius: 4px;
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: .7rem; font-weight: 700; font-family: 'Poppins', sans-serif;
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rank-item:nth-child(1) .r-pos { background: var(--red); border-color: var(--red); color: #fff; }
.rank-item:nth-child(2) .r-pos { background: var(--navy); border-color: var(--navy); color: #fff; }
.rank-item:nth-child(3) .r-pos { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.r-text { font-size: .82rem; color: var(--ink-2); flex: 1; line-height: 1.35; font-weight: 400; }

/* ── CONDITIONAL ─────────────────────── */
.conditional { display: none; }
.conditional.on { display: flex; flex-direction: column; gap: 8px; }

/* ── DIVIDER ─────────────────────────── */
.q-div { border: none; border-top: 1px solid var(--border); }

/* ── CONSENT MODAL ───────────────────── */
.consent-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(26,39,68,.55);
  backdrop-filter: blur(6px);
  z-index: 300;
}
.consent-modal.on { display: flex; }
.consent-card {
  width: min(100%, 520px);
  background: var(--white);
  border-radius: 18px;
  border: 1px solid rgba(26,39,68,.08);
  box-shadow: 0 24px 60px rgba(26,39,68,.22);
  padding: 28px 24px;
}
.consent-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0,168,150,.1);
  color: var(--teal-d);
  font-family: 'Poppins', sans-serif;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.consent-card h2 {
  margin-top: 16px;
  color: var(--navy);
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 800;
  line-height: 1.15;
}
.consent-copy {
  margin-top: 14px;
  color: var(--ink-2);
  font-size: .94rem;
  line-height: 1.65;
}
.consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.consent-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-family: 'Poppins', sans-serif;
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, color .12s ease, border-color .12s ease;
}
.consent-btn:hover { transform: translateY(-1px); }
.consent-btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid rgba(26,39,68,.16);
}
.consent-btn-secondary:hover { border-color: var(--navy); }
.consent-btn-primary {
  background: var(--red);
  color: var(--white);
}
.consent-btn-primary:hover { background: var(--red-d); }

/* ── SUBMIT ──────────────────────────── */
.submit-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.submit-note { font-size: .76rem; color: var(--ink-2); text-align: center; max-width: 400px; line-height: 1.5; font-weight: 400; }

/* ── SPINNER ─────────────────────────── */
.spin {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%;
  animation: rotate .55s linear infinite;
  margin-right: 7px; vertical-align: middle;
}
@keyframes rotate { to { transform: rotate(360deg); } }

/* ── BOTTOM NAV ──────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 100%;
  height: 60px;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(14px, 4vw, 32px);
  z-index: 100;
}
.bottom-nav.hidden { display: none; }
.nav-btn {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: .84rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  padding: 10px 24px;
  transition: all .12s;
  -webkit-tap-highlight-color: transparent;
}
.nav-back {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.nav-back:hover { border-color: var(--navy); color: var(--navy); }
.nav-back.hidden { visibility: hidden; }
.nav-next { background: var(--red); color: var(--white); }
.nav-next:hover { background: var(--red-d); }
.nav-next:disabled { opacity: .5; cursor: default; }
.nav-next.submit-mode { background: var(--navy); }
.nav-next.submit-mode:hover { background: var(--navy-2); }
.nav-step-count {
  font-size: .72rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── SUCCESS ─────────────────────────── */
#success,
#consent-rejected {
  display: none; flex-direction: column; align-items: center;
  justify-content: center; padding: 80px 24px; text-align: center; gap: 20px;
}
#success.on,
#consent-rejected.on { display: flex; }
.success-icon { margin-bottom: 4px; }
#success h2,
#consent-rejected h2 { font-family: 'Poppins', sans-serif; font-size: 1.6rem; font-weight: 800; color: var(--navy); }
#success p,
#consent-rejected p { color: var(--ink-2); max-width: 420px; line-height: 1.65; font-size: .92rem; }

/* ── VALIDATION PULSE ────────────────── */
.q-block.shake { animation: shake .4s ease; }
.q-block.shake .likert-wrap,
.q-block.shake .check-list,
.q-block.shake .yn-list,
.q-block.shake .t-input,
.q-block.shake .t-area,
.q-block.shake .ac-wrap .t-input {
  border-color: var(--error);
  box-shadow: 0 0 0 2px rgba(220,38,38,.12);
}
@keyframes shake {
  0%, 100% { transform: none; }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
.nav-next.shake { animation: btnPulse .5s ease; }
@keyframes btnPulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 4px rgba(220,38,38,.3); }
}

/* ── RESPONSIVE ──────────────────────── */
@media (max-width: 600px) {
  .site-header { height: 48px; padding: 0 14px; }
  .logo-img { height: 22px; }
  .progress-wrap { top: 48px; }
  .section-body { padding: 14px; gap: 16px; }
  .section-header { padding: 12px 14px; }
  .intro-card { padding: 24px 18px; }
  .ltable-row { grid-template-columns: 1fr repeat(5, 36px); padding: 9px 10px; }
  .l-dot { width: 28px; height: 28px; font-size: .62rem; }
  .ltable-head { grid-template-columns: 1fr repeat(5, 36px); padding: 7px 10px; }
  .l-pip { width: 40px; height: 40px; }
  .bottom-nav { height: 54px; }
  .nav-btn { padding: 9px 16px; font-size: .82rem; }
  .consent-modal { padding: 16px; }
  .consent-card { padding: 24px 18px; }
  .consent-actions { flex-direction: column-reverse; }
  .consent-btn { width: 100%; }
}

@media (min-width: 768px) {
  .bottom-nav { max-width: 760px; }
}

@media (min-width: 1200px) {
  .site-header { height: 60px; padding: 0 48px; }
  .logo-img { height: 32px; }
  .progress-wrap { top: 60px; }
  .form-wrap { max-width: 820px; }
  .section-body { padding: 28px 32px; gap: 26px; }
  .section-header { padding: 18px 32px; }
  .intro-card { padding: 48px 44px; }
  .intro-card h1 { font-size: 2.2rem; }
  .intro-desc { font-size: 1.05rem; }
  .q-label { font-size: .94rem; }
  .l-pip { width: 48px; height: 48px; font-size: .9rem; }
  .l-dot { width: 34px; height: 34px; font-size: .74rem; }
  .ltable-row { grid-template-columns: 1fr repeat(5, 48px); padding: 12px 16px; }
  .ltable-head { grid-template-columns: 1fr repeat(5, 48px); padding: 10px 16px; }
  .check-item { padding: 14px 18px; }
  .c-text { font-size: .9rem; }
  .t-input, .t-area { padding: 13px 16px; font-size: .94rem; }
  .yn-lbl { padding: 13px 10px; font-size: .9rem; }
  .bottom-nav { height: 68px; max-width: 820px; border-radius: var(--radius) var(--radius) 0 0; box-shadow: 0 -4px 20px rgba(26,39,68,.08); border-top: none; }
  .nav-btn { padding: 12px 36px; font-size: .92rem; }
  .submit-note { font-size: .82rem; }
  .consent-card { padding: 32px 30px; }
  #success h2,
  #consent-rejected h2 { font-size: 1.9rem; }
  #success p,
  #consent-rejected p { font-size: 1rem; max-width: 500px; }
}
