:root {
  --ink: #2f4858;
  --paper: #fff;
  --cream: #faf4ea;
  --mauve: #83677b;
  --rule: rgba(47, 72, 88, .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font: 400 1rem/1.7 "Nunito", Arial, sans-serif; }
button, input, textarea { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--mauve); outline-offset: 3px; }

.page-header { max-width: 1000px; margin: 0 auto; padding: 22px 28px 0; }
.page-header a { display: inline-block; }
.page-header img { display: block; width: 90px; height: 90px; object-fit: contain; }
.page-main { width: min(840px, calc(100% - 48px)); margin: 0 auto; padding: 38px 0 100px; }
.application-title { margin: 0 0 28px; font-size: clamp(2.7rem, 5.5vw, 4.3rem); }
.intro { position: relative; padding: 0 0 48px; }
.eyebrow { margin: 0 0 12px; color: var(--mauve); font-size: .85rem; font-weight: 700; letter-spacing: .12em; }
h1, h2 { font-family: "Fraunces", Georgia, serif; font-weight: 400; color: var(--ink); }
h1 { margin: 0 0 20px; font-size: clamp(2.8rem, 8vw, 5rem); line-height: 1.05; letter-spacing: -.035em; }
.intro > p:last-child { max-width: 54ch; margin: 0; font-size: 1.15rem; }
.intro::after { content: ""; display: block; width: 72px; height: 2px; margin-top: 30px; background: var(--mauve); }

.form-section { position: relative; z-index: 0; margin: 0; padding: 42px 0 46px; border: 0; border-top: 1px solid var(--rule); background: transparent; }
.form-section h2 { margin: 0 0 32px; font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.2; }
.form-section h2::after { content: ""; display: block; width: 42px; height: 2px; margin-top: 14px; background: var(--mauve); opacity: .8; }
.form-section:nth-of-type(2)::before { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); }
.form-section.acknowledgements { padding: 32px 28px; background: #eef3f4; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.field-grid .field { margin: 0; }
.field-wide { grid-column: 1 / -1; }
.field { margin: 0 0 32px; }
.field:last-child { margin-bottom: 0; }
.field label, fieldset legend { display: block; margin: 0 0 10px; font-weight: 700; font-size: 1.08rem; line-height: 1.4; color: var(--ink); }
.field label span, legend span { color: var(--mauve); }
.help { margin: 0 0 12px; font-size: .98rem; line-height: 1.6; }
.field input, .field textarea { display: block; width: 100%; border: 1px solid rgba(47, 72, 88, .38); border-radius: 3px; background: #fff; color: var(--ink); padding: 13px 15px; }
.field input { min-height: 52px; }
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus { border-color: var(--mauve); outline: 2px solid rgba(131, 103, 123, .2); outline-offset: 1px; }
.choice-field { border: 0; padding: 0; margin: 0 0 32px; min-width: 0; }
.choice-field:last-child { margin-bottom: 0; }
.choice-field legend { padding: 0; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); column-gap: 24px; }
.choices label { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid rgba(47, 72, 88, .16); cursor: pointer; line-height: 1.5; }
.choices label:has(input:checked) { color: var(--ink); border-bottom-color: var(--mauve); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; flex: none; margin: 3px 0 0; accent-color: var(--mauve); }
.acknowledgements > p { margin: 0 0 28px; }
.acknowledgements > label { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 18px; cursor: pointer; line-height: 1.6; }
.acknowledgements > label input { margin-top: 5px; }
.marketing-consent { margin-top: 28px; padding: 24px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: transparent; }
.marketing-consent > label { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; line-height: 1.6; }
.marketing-consent > label input { margin-top: 5px; }
.form-error { margin: 28px 0 0; padding: 12px 16px; border-left: 3px solid #a23c4f; background: #fae9e9; }
.form-error[hidden] { display: none; }
#submitButton { display: inline-block; margin-top: 36px; padding: 14px 23px; border: 1px solid #0B7A85; border-radius: 3px; background: #0B7A85; color: white; font-weight: 700; letter-spacing: .03em; cursor: pointer; transition: background-color 160ms ease, color 160ms ease; }
#submitButton:hover { background: #075c64; border-color: #075c64; }
#submitButton:disabled { opacity: .65; cursor: wait; }

.confirmation { max-width: 840px; margin-top: clamp(35px, 8vw, 85px); padding: 38px 0 100px; border-top: 1px solid var(--rule); }
.confirmation h1 { max-width: 15ch; margin: 0 0 36px; padding-top: 28px; }
.confirmation h1::after { content: ""; display: block; width: 72px; height: 2px; margin-top: 22px; background: var(--mauve); }
.confirmation p { max-width: 58ch; font-size: 1.12rem; line-height: 1.8; margin: 0 0 23px; }
.confirmation p:last-child { margin-top: 38px; color: var(--mauve); font: 400 1.65rem/1.3 "Fraunces", Georgia, serif; }

@media (max-width: 600px) {
  .page-header { padding: 14px 20px 0; }
  .page-header img { width: 78px; height: 78px; }
  .page-main { width: calc(100% - 40px); padding-top: 20px; }
  .intro { padding-bottom: 36px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-section { padding: 32px 0 36px; }
  .form-section h2 { margin-bottom: 26px; }
  .choices { grid-template-columns: 1fr; }
  .confirmation { width: calc(100% - 40px); padding-top: 28px; }
  .confirmation h1 { padding-top: 22px; }
}
