:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #52606d;
  --border: #bcc7d1;
  --surface: #ffffff;
  --surface-subtle: #f4f7f8;
  --brand: #164e63;
  --brand-dark: #0e3b4c;
  --focus: #f59e0b;
  --error: #a61b1b;
  --success: #176b42;
  --radius: 0.5rem;
  --shadow: 0 12px 30px rgb(23 32 42 / 8%);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--surface-subtle);
  font-size: 100%;
  line-height: 1.5;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface-subtle);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.container {
  width: min(100% - 2rem, 48rem);
  margin-inline: auto;
}

.site-header {
  padding: 3rem 0 2.5rem;
  color: #fff;
  background: var(--brand);
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.25rem);
  letter-spacing: -0.025em;
}

.intro {
  max-width: 42rem;
  margin: 1rem 0 0;
  font-size: 1.08rem;
  color: #e8f3f5;
}

main {
  padding-block: 2rem 4rem;
}

.guidance,
.privacy {
  padding: 1.25rem 1.5rem;
  border-left: 0.3rem solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #e8f3f5;
}

.guidance {
  margin-bottom: 1.5rem;
}

.guidance summary,
.privacy summary,
.error-summary h2 {
  margin: 0 0 0.6rem;
  font-size: 1.2rem;
}

.guidance summary,
.privacy summary {
  margin-bottom: 0;
  color: var(--brand-dark);
  font-weight: 750;
  cursor: pointer;
}

.guidance summary::marker,
.privacy summary::marker {
  color: var(--brand);
}

.guidance[open] summary,
.privacy[open] summary {
  margin-bottom: 0.6rem;
}

.guidance p,
.privacy p {
  margin: 0.65rem 0 0;
}

.guidance strong {
  color: var(--brand-dark);
}

form {
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border: 1px solid #dbe2e8;
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0 0 2.25rem;
  border: 0;
}

legend {
  width: 100%;
  margin: 0;
  padding: 0;
  font-size: 1.45rem;
  font-weight: 750;
}

.section-help,
.field-help,
.submit-help,
.optional,
.counter {
  color: var(--muted);
}

.section-help {
  margin: 0.5rem 0 0;
}

.field {
  margin-top: 1.4rem;
}

.field-grid {
  display: grid;
  gap: 0 1.25rem;
  align-items: start;
}

label {
  display: inline-block;
  font-weight: 700;
}

.optional {
  font-weight: 500;
}

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

input,
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.68rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 0.35rem;
  color: var(--ink);
  background: #fff;
}

select {
  min-height: 3rem;
  cursor: pointer;
}

textarea {
  min-height: 12rem;
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
.guidance summary:focus-visible,
.privacy summary:focus-visible,
.error-summary:focus-visible,
.form-status:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

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

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

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

.field-error:empty {
  display: none;
}

.label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
}

.counter {
  flex: none;
  font-size: 0.9rem;
}

.checkbox-field {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.checkbox-field input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.15rem 0 0;
}

.checkbox-field label {
  font-weight: 600;
}

.copy-choice {
  padding: 1rem;
  border: 1px solid #c9d8df;
  border-radius: var(--radius);
  background: #f7fafb;
}

.copy-choice .field-help {
  margin-bottom: 0;
}

.privacy {
  margin-top: 1.5rem;
  border-left-color: #64748b;
  background: #f0f3f5;
}

.privacy strong {
  color: #334155;
}

.error-summary {
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--error);
  border-radius: var(--radius);
  color: #781313;
  background: #fff3f3;
}

.error-summary ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.error-summary a {
  color: inherit;
  font-weight: 650;
}

.form-status {
  margin-bottom: 1rem;
  border-radius: var(--radius);
  font-weight: 650;
}

.form-status.success,
.form-status.failure {
  padding: 1rem 1.25rem;
  border: 2px solid currentcolor;
}

.form-status.success {
  color: var(--success);
  background: #effbf5;
}

.form-status.failure {
  color: var(--error);
  background: #fff3f3;
}

button {
  width: 100%;
  min-height: 3rem;
  padding: 0.72rem 1.35rem;
  border: 0;
  border-radius: 0.35rem;
  color: #fff;
  background: var(--brand);
  font-weight: 750;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--brand-dark);
}

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

.submit-help {
  margin: 0.55rem 0 0;
  font-size: 0.9rem;
}

.site-footer {
  padding: 1.5rem 0;
  color: #fff;
  background: #102a35;
}

.site-footer p {
  margin: 0;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (min-width: 42rem) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }

  button {
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
