/* ── MailHalla survey ────────────────────────────────────────────────
   Builds on landing.css tokens. Native radios/checkboxes tinted with
   accent-color; the option row itself lights up when checked. */

main.survey {
  width: min(720px, calc(100vw - 40px));
}

main.survey .lede {
  margin-bottom: 8px;
}

.block {
  margin-top: 52px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline-strong);
}

.block h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.q {
  border: none;
  margin-top: 30px;
}

.q legend,
.q > label {
  display: block;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 12px;
  padding: 0;
}

.qnum {
  display: inline-block;
  min-width: 2.1em;
  font: 500 14px var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--brand-deep);
}

.hint {
  font-size: 15px;
  color: var(--ink-faint);
  margin: -6px 0 12px 2.1em;
}

/* ── Choice lists ─────────────────────────────────────────────────── */

.options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
}

.options-row {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  background: var(--paper-raised);
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.opt:hover {
  border-color: var(--ink-faint);
}

.opt:has(:checked) {
  border-color: var(--brand-deep);
  background: var(--brand-wash);
}

.opt:has(:focus-visible) {
  outline: 2px solid var(--brand-deep);
  outline-offset: 2px;
}

.opt input[type='radio'],
.opt input[type='checkbox'] {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--brand-deep);
}

.opt input:focus-visible {
  outline: none;
}

.opt-other {
  grid-column: 1 / -1;
}

.opt-other input[type='text'] {
  flex: 1;
  min-width: 0;
  border: none;
  border-bottom: 1px solid var(--hairline-strong);
  background: none;
  font: inherit;
  color: inherit;
  padding: 2px 0;
  outline: none;
}

.opt-other input[type='text']:focus {
  border-bottom-color: var(--brand-deep);
}

/* Unchecked boxes get disabled once three are picked (Q9). */
.opt:has(:disabled) {
  opacity: 0.45;
  cursor: default;
}

/* ── Free text ────────────────────────────────────────────────────── */

.field,
textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  background: var(--paper-raised);
  font: inherit;
  line-height: 1.5;
  color: inherit;
  resize: vertical;
}

.field:focus,
textarea:focus {
  outline: 2px solid var(--brand-deep);
  outline-offset: 1px;
  border-color: var(--brand-deep);
}

/* Single-line answers (Q1, Q20) share the textarea look at input height. */
.field {
  max-width: 28em;
  resize: none;
}

.field::placeholder {
  color: var(--ink-faint);
}

/* ── 1–10 scale ───────────────────────────────────────────────────── */

.scale {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.scale label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  background: var(--paper-raised);
  font: 500 16px var(--font-mono);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.scale label:hover {
  border-color: var(--ink-faint);
}

.scale input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.scale label:has(:checked) {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}

.scale label:has(:focus-visible) {
  outline: 2px solid var(--brand-deep);
  outline-offset: 2px;
}

.scale-ends {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font: 400 13px var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

/* ── Importance matrix (Q8) ───────────────────────────────────────── */

.matrix-wrap {
  overflow-x: auto;
}

.matrix {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper-raised);
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  overflow: hidden;
}

.matrix th,
.matrix td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--hairline);
  text-align: center;
  vertical-align: middle;
}

.matrix thead th {
  font: 400 12px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  background: var(--paper);
  border-bottom-color: var(--hairline-strong);
}

.matrix tbody tr:last-child th,
.matrix tbody tr:last-child td {
  border-bottom: none;
}

.matrix th[scope='row'] {
  text-align: left;
  font-weight: 500;
  font-size: 16px;
  padding-left: 14px;
}

.matrix td label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 24px;
  cursor: pointer;
}

.matrix td input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand-deep);
}

.matrix tbody tr:has(:checked) th[scope='row'] {
  color: var(--brand-deep);
}

.matrix td .col-label {
  display: none;
}

/* ── Submit and thanks ────────────────────────────────────────────── */

.submit-row {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline-strong);
}

.submit-row .send {
  margin-top: 0;
}

.thanks {
  position: relative;
  margin-top: 40px;
  padding: 34px 36px 32px;
  background: var(--paper-raised);
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  box-shadow: 0 18px 40px -24px rgba(28, 26, 21, 0.35);
  overflow: hidden;
}

.thanks .postmark {
  opacity: 0.75;
  transform: rotate(-8deg) scale(1);
}

.thanks h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 34px;
  margin-bottom: 10px;
}

.thanks p {
  color: var(--ink-soft);
  max-width: 32em;
}

.thanks a {
  color: var(--brand-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Small screens ────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .block h2 {
    font-size: 28px;
  }

  .options {
    grid-template-columns: 1fr;
  }

  .options-row {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .scale {
    grid-template-columns: repeat(5, 1fr);
  }

  .scale label {
    height: 42px;
  }

  /* Matrix becomes one stacked card per feature. */
  .matrix,
  .matrix tbody,
  .matrix tr,
  .matrix th,
  .matrix td {
    display: block;
  }

  .matrix thead {
    display: none;
  }

  .matrix tr {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 12px 12px 14px;
    border-bottom: 1px solid var(--hairline);
  }

  .matrix tbody tr:last-child {
    border-bottom: none;
  }

  .matrix th[scope='row'] {
    grid-column: 1 / -1;
    padding: 0 0 6px;
    border: none;
  }

  .matrix td {
    padding: 0;
    border: none;
  }

  .matrix td label {
    flex-direction: column;
    gap: 6px;
    padding: 8px 4px;
    border: 1px solid var(--hairline-strong);
    border-radius: 6px;
  }

  .matrix td label:has(:checked) {
    border-color: var(--brand-deep);
    background: var(--brand-wash);
  }

  .matrix td .col-label {
    display: block;
    font: 400 11px var(--font-mono);
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-align: center;
    color: var(--ink-soft);
  }

  .thanks {
    padding: 26px 20px;
  }

  .thanks .postmark {
    width: 170px;
    top: 6px;
    right: -6px;
  }
}
