/* Inbank brand tokens (from Inbank_Theme.thmx) */
:root {
  --night-violet: #20093A;
  --almost-white: #F9F9F6;
  --lavender: #E3D2FF;
  --purple: #AA93FF;
  --offwhite: #F0F0EA;
  --sand: #D9D3A7;
  --orange: #FF9540;
  --sky: #95CDF5;
  --white: #FFFFFF;
  --accent: var(--night-violet);
  --on-accent: var(--almost-white);

  --text: var(--night-violet);
  --muted: #5d5170;
  --line: #E4E1EA;
  --bg: var(--almost-white);
  --card: var(--white);
  --good: #2E8B57;
  --bad: #C2410C;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(32, 9, 58, .04), 0 4px 16px rgba(32, 9, 58, .05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

@font-face { font-family: "Inter"; src: local("Inter"), url("/fonts/Inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 28px; } h2 { font-size: 21px; } h3 { font-size: 17px; } h4 { font-size: 15px; }
p { margin: 0 0 .8em; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* Buttons */
.btn { appearance: none; border: 1.5px solid var(--night-violet); background: var(--night-violet); color: var(--almost-white); font: 600 14px/1 var(--font); padding: 11px 20px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap; transition: transform .05s, background .15s, opacity .15s; }
.btn:hover { background: #351160; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--night-violet); }
.btn.secondary:hover { background: var(--lavender); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--night-violet); padding: 8px 12px; }
.btn.ghost:hover { background: var(--offwhite); }
.btn.purple { background: var(--purple); border-color: var(--purple); color: var(--night-violet); }
.btn.purple:hover { background: #9a80f5; }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.lg { padding: 15px 28px; font-size: 16px; }

/* Forms */
label { font-weight: 600; font-size: 13px; display: block; margin-bottom: 6px; }
input:not([type]), input[type=text], input[type=number], input[type=date], input[type=email], input[type=search], select, textarea {
  width: 100%; font: 400 15px/1.4 var(--font); color: var(--text); background: var(--white);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(170, 147, 255, .25); }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.field { margin-bottom: 14px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--night-violet); }

/* Chips & badges */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--offwhite); color: var(--night-violet); white-space: nowrap; }
.chip.live { background: #DDF3E4; color: #17603A; }
.chip.draft { background: var(--offwhite); }
.chip.closed { background: #ECE9F1; color: var(--muted); }
.chip.pending { background: #FFE6D1; color: #8A4100; }
.chip.lav { background: var(--lavender); }
.chip.sky { background: #DCEFFC; }
.chip.sand { background: #F1EDD3; }
.chip.orange { background: #FFE6D1; }

/* Choice controls (shared respondent + interviewer) */
.q { margin-bottom: 28px; }
.q-title { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.q-help { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.q-req { color: var(--orange); margin-left: 3px; }
.q-error { color: var(--bad); font-size: 13px; margin-top: 8px; font-weight: 600; }
.scale { display: grid; gap: 6px; }
.scale.n11 { grid-template-columns: repeat(11, minmax(0, 1fr)); }
.scale.n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.scale.n7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.scale button { appearance: none; border: 1.5px solid var(--line); background: var(--white); color: var(--night-violet); border-radius: 12px; height: 48px; font: 700 16px var(--font); cursor: pointer; transition: all .12s; }
.scale button:hover { border-color: var(--purple); background: #F5F0FF; }
.scale button[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.scale-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; gap: 12px; }
.options { display: grid; gap: 8px; }
.option { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--white); cursor: pointer; font-weight: 500; transition: all .12s; text-align: left; font: 500 15px var(--font); color: var(--text); width: 100%; }
.option:hover { border-color: var(--purple); }
.option[aria-pressed=true], .option[aria-checked=true] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, white); }
.option .box { width: 20px; height: 20px; border: 2px solid var(--accent); border-radius: 50%; flex: none; display: grid; place-items: center; }
.option.multi .box { border-radius: 6px; }
.option[aria-pressed=true] .box::after, .option[aria-checked=true] .box::after { content: ""; width: 10px; height: 10px; background: var(--accent); border-radius: inherit; }
.q-intro { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.stars { display: flex; gap: 6px; }
.stars button { appearance: none; border: 0; background: transparent; padding: 2px; cursor: pointer; line-height: 0; }
.stars svg { fill: none; stroke: var(--accent); stroke-width: 1.6; transition: transform .1s, fill .1s; }
.stars button.on svg { fill: var(--accent); }
.stars button:hover svg { transform: scale(1.08); }
.stars-labels { max-width: 230px; }
.pii-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

@media (max-width: 560px) {
  .scale.n11 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .scale button { height: 44px; }
}
.q-context { margin: 4px 0 12px; }

/* ---- special answers: "Cannot assess" (outside the numeric scale) and "Other — please specify" ---- */
.ca-row { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ca-btn { appearance: none; border: 1.5px dashed var(--line); background: var(--white); color: var(--text); border-radius: 12px; padding: 10px 16px; font: 600 14px var(--font); cursor: pointer; min-height: 44px; }
.ca-btn:hover { border-color: var(--purple); }
.ca-btn[aria-pressed=true] { background: var(--accent); border: 1.5px solid var(--accent); color: var(--on-accent); }
.option-other { font-style: normal; }
.other-field { margin-top: 8px; }
.other-field input { width: 100%; }
.other-count { text-align: right; margin-top: 4px; }
.other-count.over { color: var(--bad); font-weight: 600; }

/* ---- Likert scale matrix: rows × columns on wide screens, stacked cards on narrow ones ---- */
.matrix { --mx-cols: 5; }
.mx-head, .mx-row { display: grid; grid-template-columns: minmax(140px, 1.6fr) repeat(var(--mx-cols), minmax(0, 1fr)); gap: 4px; align-items: center; }
.mx-choices { display: contents; }
.mx-head { font-size: 12px; color: var(--muted); text-align: center; padding-bottom: 6px; line-height: 1.25; }
.mx-head .ca, .mx-choice.ca { border-left: 1px dashed var(--line); }
.mx-row { padding: 8px 0; border-top: 1px solid var(--line); }
.mx-row.mx-missing { background: color-mix(in srgb, var(--bad) 7%, transparent); border-radius: 10px; }
.mx-st { font-weight: 500; padding-right: 8px; }
.mx-choice { position: relative; display: flex; justify-content: center; align-items: center; min-height: 44px; cursor: pointer; border-radius: 10px; }
.mx-choice:hover { background: #F5F0FF; }
.mx-choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.mx-choice:has(input:focus-visible) { outline: 3px solid var(--purple); outline-offset: -2px; }
.mx-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 640px) {
  .mx-head { display: none; }
  .mx-row { display: block; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
  .mx-row.mx-missing { border-color: var(--bad); }
  .mx-st { margin-bottom: 6px; }
  .mx-choices { display: grid; gap: 6px; }
  .mx-choice { justify-content: flex-start; gap: 10px; padding: 8px 12px; border: 1.5px solid var(--line); }
  .mx-choice.ca { border-left: 1.5px dashed var(--line); border-style: dashed; }
  .mx-choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, white); }
  .mx-lbl { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
}
