/* Wantech survey — shared by the form, results and QR poster pages */
:root {
  --navy: #2B2860;
  --navy-2: #3A3680;
  --cyan: #2FAEE0;
  --cyan-dark: #1479A8;
  --ink: #1E2240;
  --muted: #5B6178;
  --line: #D9DEEA;
  --soft: #F3F6FB;
  --ground: #EAF1F8;
  --star: #F2A900;
  --star-off: #CBD2E0;
  --danger: #B42318;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: var(--ground);
  font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 16px; line-height: 1.5;
}
button, input, select { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header: white bar with the logo, cyan rule under it */
.top { background: #FFFFFF; border-bottom: 4px solid var(--cyan); }
.top-inner { max-width: 680px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top img { display: block; width: 132px; height: auto; }
.top .tag { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--navy); }

.main { max-width: 680px; margin: 0 auto; padding: 22px 14px 32px; }
.card { background: #FFFFFF; border-radius: 16px; box-shadow: 0 10px 30px rgba(43,40,96,.12); padding: 24px 20px; display: flex; flex-direction: column; gap: 26px; margin: 0; }
.card[hidden] { display: none; }
.intro h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.2; color: var(--navy); letter-spacing: -0.01em; }
.intro p { margin: 0; color: var(--muted); }
.anon { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 12px; border-radius: 999px; background: #E3F4FB; color: var(--cyan-dark); font-size: 14px; font-weight: 700; }

.qn { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.qn legend, .qn .qlabel { padding: 0; font-size: 18px; font-weight: 700; color: var(--navy); }
.num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-right: 8px; border-radius: 50%; background: var(--navy); color: #FFFFFF; font-size: 14px; vertical-align: 2px; }
.qn.missing .opts, .qn.missing .stars, .qn.missing .editor-box { box-shadow: 0 0 0 2px var(--danger); border-radius: 12px; }

/* Branch chips */
.opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt label {
  display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #FFFFFF; font-weight: 700; font-size: 16px; text-align: center; cursor: pointer; user-select: none;
}
.opt input:focus-visible + label { outline: 3px solid var(--cyan); outline-offset: 2px; }
.opt input:checked + label { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }

/* Stars */
.stars { display: flex; gap: 6px; }
.star input { position: absolute; opacity: 0; pointer-events: none; }
.star label { display: flex; width: 56px; height: 56px; align-items: center; justify-content: center; border-radius: 12px; cursor: pointer; color: var(--star-off); transition: transform .12s ease, color .12s ease; }
.star label svg { width: 46px; height: 46px; }
.star.on label { color: var(--star); }
.star label:active { transform: scale(.9); }
.star input:focus-visible + label { outline: 3px solid var(--cyan); outline-offset: 1px; }
.rating-text { min-height: 24px; font-weight: 700; color: var(--muted); }

/* Rich text */
.editor-box { border: 1.5px solid var(--line); border-radius: 12px; background: #FFFFFF; }
.editor-box:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(43,40,96,.12); }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--soft); border-radius: 12px 12px 0 0; }
.tb { min-width: 44px; height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; color: var(--navy); }
.tb:hover { background: #E6ECF6; }
.tb[aria-pressed="true"] { background: #DCE4F2; }
.tb:focus-visible { outline: 3px solid var(--cyan); outline-offset: 1px; }
.tb-b { font-weight: 800; } .tb-i { font-style: italic; font-family: Georgia, serif; font-size: 18px; } .tb-u { text-decoration: underline; }
.editor { min-height: 130px; max-height: 300px; overflow-y: auto; padding: 14px 16px; font-size: 17px; line-height: 1.55; outline: none; word-wrap: break-word; position: relative; }
.editor.empty::before { content: attr(data-placeholder); color: #8A90A6; pointer-events: none; position: absolute; }
.editor p, .editor div { margin: 0; }
.editor ul, .editor ol { margin: 4px 0; padding-left: 24px; }
.counter { display: flex; justify-content: space-between; gap: 8px; padding: 0 14px 10px; font-size: 13px; color: var(--muted); }
.counter.over b { color: var(--danger); }
.optional { font-weight: 600; font-size: 14px; color: var(--muted); }

.msg { margin: 0; color: var(--danger); font-weight: 600; }
.msg:empty { display: none; }
.btn { height: 54px; padding: 0 24px; border-radius: 12px; font-size: 17px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.primary { border: 0; background: var(--navy); color: #FFFFFF; width: 100%; }
.primary:hover:not(:disabled) { background: var(--navy-2); }
.primary:disabled { opacity: .6; cursor: wait; }
.ghost { border: 1.5px solid var(--line); background: #FFFFFF; color: var(--navy); }

.done { align-items: center; text-align: center; gap: 14px; }
.done h1 { margin: 0; font-size: 28px; color: var(--navy); }
.done p { margin: 0; color: var(--muted); max-width: 440px; }
.tick { width: 76px; height: 76px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #FFFFFF; background: var(--cyan-dark); }
.link-btn { border: 0; background: none; color: var(--cyan-dark); font-weight: 700; text-decoration: underline; cursor: pointer; padding: 8px; }

.foot { text-align: center; padding: 0 16px 28px; font-size: 13px; color: var(--muted); }

@media (min-width: 600px) {
  .main { padding-top: 36px; }
  .card { padding: 32px; }
  .intro h1 { font-size: 30px; }
  .star label { width: 64px; height: 64px; }
  .star label svg { width: 52px; height: 52px; }
}
@media (max-width: 360px) {
  .opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .star label { width: 50px; height: 50px; }
  .star label svg { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
