:root {
  --green: #009846;
  --green-dark: #08733b;
  --blue: #005ca9;
  --blue-dark: #064578;
  --yellow: #ffcf24;
  --ink: #173044;
  --muted: #5d7080;
  --line: #d8e1e7;
  --surface: #fff;
  --background: #eef4f1;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(11, 55, 38, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 92% 4%, rgba(255, 207, 36, .20), transparent 18rem), linear-gradient(180deg, #f7fbf8 0, var(--background) 100%);
}
button, input, textarea { font: inherit; }
button { touch-action: manipulation; }
[hidden] { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  color: #fff;
  background: linear-gradient(112deg, var(--green-dark), var(--green) 70%);
  box-shadow: 0 3px 18px rgba(0, 0, 0, .13);
}
.topbar-inner { width: min(980px, calc(100% - 28px)); margin: 0 auto; padding: 17px 0 13px; }
.brand-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.brand-copy h1 { margin: 0; max-width: 760px; font-size: clamp(1.15rem, 2.9vw, 1.75rem); line-height: 1.08; }
.brand-copy p { margin: 7px 0 0; font-size: .84rem; line-height: 1.3; opacity: .92; }
.flag-mark { flex: 0 0 auto; width: 54px; height: 38px; border-radius: 10px; background: var(--yellow); transform: skewX(-16deg); position: relative; overflow: hidden; }
.flag-mark::after { content: ''; position: absolute; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); right: -3px; top: 6px; }
.progress-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-top: 15px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.3); }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--yellow); transition: width .2s ease; }
.progress-text { min-width: 54px; font-size: .8rem; font-weight: 800; text-align: right; }

.sync-strip {
  position: sticky;
  top: 99px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px max(14px, calc((100% - 980px) / 2));
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(23,48,68,.06);
  font-size: .82rem;
}
.sync-strip > div { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.connection-dot { width: 10px; height: 10px; border-radius: 50%; background: #98a2b3; }
.connection-dot.online { background: var(--green); }
.connection-dot.offline { background: #f79009; }
#pendingText { color: var(--muted); }
.sync-button { border: 0; border-radius: 9px; padding: 8px 12px; color: #fff; background: var(--blue); font-weight: 800; cursor: pointer; }
.sync-button:disabled { opacity: .55; cursor: wait; }

main { width: min(980px, calc(100% - 28px)); margin: 22px auto 0; }
.card { overflow: hidden; border: 1px solid rgba(0,92,169,.12); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.card-body { padding: clamp(22px, 4vw, 40px); }
.eyebrow { margin: 0 0 8px; color: var(--green-dark); font-size: .76rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
h2 { margin: 0 0 14px; color: var(--blue-dark); line-height: 1.2; }
.activity { white-space: pre-line; color: var(--muted); line-height: 1.55; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 24px; }
.field { display: block; }
.field.full { grid-column: 1 / -1; }
.label { display: block; margin-bottom: 7px; font-weight: 800; }
.control { width: 100%; min-height: 48px; border: 1px solid #b8c6cf; border-radius: 11px; padding: 11px 13px; color: var(--ink); background: #fff; }
textarea.control { min-height: 110px; resize: vertical; }
.control:focus { outline: 3px solid rgba(0,92,169,.15); border-color: var(--blue); }
.sex-options, .ratings { display: grid; gap: 8px; }
.sex-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sex-fieldset { border: 0; padding: 0; margin: 0; }
.ratings { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 14px; }
.choice, .rating { position: relative; cursor: pointer; }
.choice input, .rating input { position: absolute; opacity: 0; pointer-events: none; }
.choice span, .rating span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: center; font-weight: 800; }
.choice input:checked + span, .rating input:checked + span { color: #fff; border-color: var(--blue); background: var(--blue); box-shadow: 0 5px 14px rgba(0,92,169,.2); }
.scale-box { margin-top: 30px; padding: 20px; border-radius: 16px; background: #f2f8fb; border-left: 5px solid var(--blue); }
.scale-box p { margin: 0; color: var(--blue-dark); line-height: 1.5; font-style: italic; }
.scale-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.scale-item { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.scale-item strong, .scale-item small { display: block; }
.scale-item strong { color: var(--blue-dark); }
.scale-item small { margin-top: 5px; color: var(--muted); line-height: 1.35; }
.questions { margin-top: 26px; }
.question { margin: 0; padding: 24px 0; border: 0; border-top: 1px solid var(--line); }
.question:first-child { border-top: 0; padding-top: 0; }
.question legend { width: 100%; padding: 0; font-weight: 800; line-height: 1.4; }
.question-number { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-right: 8px; border-radius: 8px; color: #fff; background: var(--blue); }
.comment { margin-top: 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.actions { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; gap: 12px; padding: 17px clamp(20px, 4vw, 38px); border-top: 1px solid var(--line); background: #fbfdfc; }
.btn { min-height: 50px; padding: 12px 22px; border: 0; border-radius: 12px; font-weight: 800; cursor: pointer; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-secondary { color: var(--blue-dark); background: #eaf1f6; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--blue), #0875c7); }
.btn-submit { background: linear-gradient(135deg, var(--green-dark), var(--green)); }
.message { display: none; margin: 0 0 18px; padding: 13px 15px; border-radius: 12px; font-weight: 700; line-height: 1.4; }
.message.show { display: block; }
.message.error { color: #7a271a; background: #fef3f2; border: 1px solid #fecdca; }
.message.info { color: #175cd3; background: #eff8ff; border: 1px solid #b2ddff; }
.activation p { line-height: 1.55; }
.activation .field { margin: 22px 0 14px; max-width: 420px; }
.success { text-align: center; }
.success-icon { display: flex; align-items: center; justify-content: center; width: 70px; height: 70px; margin: 0 auto 18px; border-radius: 50%; color: #fff; background: var(--green); font-size: 2rem; font-weight: 900; }
.protocol { display: inline-block; margin: 14px 0 0; padding: 9px 12px; border-radius: 9px; background: #eff6f2; color: var(--green-dark); font-family: Consolas, monospace; font-weight: 800; }
.success-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.honeypot { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
footer { padding: 22px 12px 34px; color: var(--muted); text-align: center; font-size: .78rem; }

@media (max-width: 720px) {
  .topbar-inner { padding-block: 13px 10px; }
  .sync-strip { top: 91px; }
  main { margin-top: 14px; }
  .grid, .sex-options, .scale-list { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .ratings { grid-template-columns: 1fr 1fr; }
  .rating:last-child { grid-column: 1 / -1; }
  .btn { flex: 1; padding-inline: 12px; }
}
