:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #1d2733;
  --muted: #5d6875;
  --line: #d8dee7;
  --accent: #1b6b7a;
  --accent-dark: #124b55;
  --soft: #e8f2f4;
  --focus: #f2b84b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

header {
  background: #102a43;
  color: #ffffff;
  padding: 40px 20px 34px;
}

header .wrap,
main {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.lead {
  max-width: 780px;
  margin: 0;
  color: #d9e6ee;
  font-size: 1.03rem;
}

main {
  padding: 28px 0 48px;
}

form {
  display: grid;
  gap: 20px;
}

section,
fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

section {
  padding: 24px;
}

fieldset {
  margin: 18px 0 0;
  padding: 18px;
}

fieldset:first-child {
  margin-top: 0;
}

legend,
h2 {
  font-weight: 700;
  color: var(--text);
}

h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

legend {
  padding: 0 8px;
  font-size: 1.03rem;
}

p {
  margin: 0 0 14px;
}

.section-note,
.help {
  color: var(--muted);
  font-size: 0.94rem;
}

.definition {
  border-left: 4px solid var(--accent);
  background: var(--soft);
  padding: 14px 16px;
  margin-top: 16px;
  border-radius: 4px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.question {
  margin-top: 18px;
}

.question:first-child {
  margin-top: 0;
}

label,
.question-title {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 8px 0;
  font-weight: 400;
}

.option input {
  margin-top: 0.25em;
  flex: 0 0 auto;
}

input,
select,
textarea,
button {
  font: inherit;
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1px solid #b8c2cf;
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--text);
  background: #ffffff;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.95rem;
}

th,
td {
  border: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #eef2f6;
  font-weight: 700;
}

td.center,
th.center {
  text-align: center;
}

.matrix input {
  width: 18px;
  height: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

button,
.btn {
  border: 0;
  border-radius: 6px;
  padding: 11px 18px;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

button:hover,
.btn:hover {
  background: var(--accent-dark);
}

.secondary {
  color: var(--accent-dark);
  background: #e1eef1;
}

.secondary:hover {
  background: #cfe5e9;
}

footer {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  header {
    padding-top: 30px;
  }

  section,
  fieldset,
  .actions {
    padding: 16px;
  }

  .grid,
  .three-col {
    grid-template-columns: 1fr;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  tr {
    border: 1px solid var(--line);
    margin: 0 0 12px;
    background: #ffffff;
  }

  td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
  }

  td:first-child {
    display: block;
    background: #eef2f6;
    font-weight: 700;
  }

  td:first-child::before {
    content: "";
  }
}

/* ---- Cross-page additions (welcome/consent/thank-you/declined) ---- */

/* Anchor styled as a button, and inline button rows. */
.btn {
  display: inline-block;
  text-decoration: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

/* Reference list inside info sections. */
.refs {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
  padding-left: 18px;
}

.refs li {
  margin: 4px 0;
}

/* Consent choice block. */
.consent-choice {
  margin-top: 8px;
}

.consent-choice .option {
  font-weight: 700;
}

.error {
  color: #9a2828;
  background: #fbe6e6;
  border: 1px solid #e6b4b4;
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0 0 14px;
  font-weight: 700;
}
