:root {
  color-scheme: light dark;
  --background: #f5f7f8;
  --surface: #ffffff;
  --text: #17252b;
  --muted: #52636b;
  --border: #cbd5d9;
  --accent: #086c73;
  --accent-contrast: #ffffff;
  --error: #a32525;
  --success: #236842;
  --warning: #fff4cf;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

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

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.5rem;
  background: var(--surface);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  max-width: 52rem;
  margin: 0 auto;
  padding: 1rem;
}

.brand {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.language-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.language-switch select {
  width: auto;
  min-width: 7.5rem;
  padding: 0.4rem;
}

.container {
  width: 100%;
  max-width: 50rem;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.panel {
  margin-bottom: 1rem;
  padding: clamp(1rem, 4vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
}

h1,
h2,
legend {
  line-height: 1.25;
}

h1 {
  margin-top: 0;
  font-size: clamp(1.65rem, 6vw, 2.2rem);
}

h2 {
  font-size: 1.25rem;
}

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

.field {
  min-width: 0;
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
}

label:not(.choice),
legend {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 650;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.45rem 0;
}

.choice input {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.2rem 0 0;
}

.choice-hint {
  margin-left: 1.65rem;
}

.hint,
.field-error {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.hint {
  color: var(--muted);
}

.field-error {
  color: var(--error);
}

[aria-invalid="true"] {
  border-color: var(--error) !important;
}

button {
  max-width: 100%;
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 0.4rem;
  background: var(--accent);
  color: var(--accent-contrast);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button.secondary {
  background: transparent;
  color: var(--accent);
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.message {
  min-height: 1.55rem;
  margin: 0.75rem 0;
  overflow-wrap: anywhere;
}

.message.error {
  color: var(--error);
}

.message.success {
  color: var(--success);
}

.notice {
  padding: 0.75rem 1rem;
  border-left: 0.25rem solid var(--accent);
  background: var(--background);
  overflow-wrap: anywhere;
}

.notice.success {
  border-left-color: var(--success);
}

.notice.warning {
  border-left-color: #896700;
  background: var(--warning);
  color: #332800;
}

.turnstile {
  max-width: 100%;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.privacy p {
  margin: 0.65rem 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 37.5rem) {
  .field-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .site-header {
    align-items: flex-start;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #11191d;
    --surface: #19262c;
    --text: #ecf3f5;
    --muted: #b2c2c9;
    --border: #50636c;
    --accent: #63d3d8;
    --accent-contrast: #102226;
    --error: #ffaaa3;
    --success: #8bdcb0;
    --warning: #453b19;
  }

  .notice.warning {
    color: #fff1bb;
  }
}
