body:has(.form-page) { background: #eef0e8; }

.form-page { min-height: 60vh; }

.form-hero {
  background: linear-gradient(135deg, var(--deep-green), var(--green));
  color: var(--ivory);
  padding: 74px 0 68px;
}

.form-hero-inner { max-width: 860px; }

.form-hero h1 {
  font-size: clamp(48px, 6vw, 76px);
  line-height: .98;
  margin: 18px 0 20px;
}

.form-hero > .form-hero-inner > p:not(.eyebrow) {
  color: #dbe6da;
  font-size: 17px;
  line-height: 1.7;
  max-width: 720px;
}

.form-home-link {
  align-items: center;
  color: var(--gold);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 10px;
  margin-top: 27px;
  padding-block: 7px;
}

.form-home-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.form-home-link .icon { height: 19px; width: 19px; }

.form-section { max-width: 980px; padding-block: 55px 78px; }

.form-card {
  background: #fffef9;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 38px rgba(9, 52, 35, .08);
  padding: clamp(25px, 4.6vw, 52px);
}

.form-policy-note,
.group-intro,
.spam-note,
.required-note,
.form-setup-status,
.field-help {
  color: #5b695e;
  font-size: 13px;
  line-height: 1.65;
}

.form-policy-note {
  background: #f1f2e8;
  border-left: 4px solid var(--gold);
  margin: 0 0 22px;
  padding: 14px 16px;
}

.form-policy-note a { color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.required-note { margin: 0 0 23px; }
.required-note span { color: #aa412c; font-weight: 800; }
.form-setup-status { margin: 0 0 20px; }
.form-setup-status.is-ready { color: #3d6350; }
.form-setup-status.is-problem { color: #963d2a; }

.form-error-summary {
  background: #fff4f0;
  border: 1px solid #d98977;
  border-left: 4px solid #ac402c;
  color: #61291e;
  margin-bottom: 23px;
  padding: 17px 18px;
}

.form-error-summary h2 { color: #61291e; font-size: 21px; line-height: 1.2; }
.form-error-summary ul { margin: 10px 0 0; padding-left: 20px; }
.form-error-summary li { margin-top: 6px; }
.form-error-summary a { color: #762b1d; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.form-group {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
  min-width: 0;
  padding: 30px 0 32px;
}

.form-group:first-of-type { border-top: 0; padding-top: 3px; }
.form-group:last-of-type { padding-bottom: 20px; }
.form-group legend {
  color: var(--green);
  font-family: var(--display);
  font-size: clamp(25px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.2;
  padding: 0 8px 0 0;
}

.grant-group { padding-block: 34px; }
.group-intro { margin: 12px 0 22px; max-width: 780px; }

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

.form-field { min-width: 0; }
.form-field--wide { grid-column: 1 / -1; }
.form-field label {
  color: var(--ink);
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 8px;
}

.required-marker { color: #aa412c; margin-left: 3px; }
.optional-marker { color: #718077; font-size: 11px; font-weight: 500; margin-left: 7px; }
.field-help { margin: -1px 0 8px; }
.conditional-help { color: #607167; }
.signature-acknowledgment { background: #f6f4eb; border-left: 3px solid var(--gold); padding: 9px 11px; }

.form-field input:not([type="checkbox"]),
.form-field select,
.form-field textarea {
  appearance: none;
  background: #fff;
  border: 1px solid #bcc7bb;
  border-radius: 5px;
  color: var(--ink);
  display: block;
  font: inherit;
  line-height: 1.35;
  min-height: 48px;
  padding: 12px 13px;
  width: 100%;
}

.form-field textarea { min-height: 150px; resize: vertical; }
.form-field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--green) 50%), linear-gradient(135deg, var(--green) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 38px;
}
.form-field input[type="file"] { padding: 10px 11px; }
.form-field input[type="file"]::file-selector-button {
  background: #e7eadf;
  border: 0;
  border-radius: 3px;
  color: var(--green);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  margin-right: 11px;
  padding: 8px 10px;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(6, 76, 53, .14);
  outline: 0;
}

.form-field [aria-invalid="true"] { border-color: #ac402c !important; box-shadow: 0 0 0 3px rgba(172, 64, 44, .13) !important; }
.field-error { color: #9b3826; font-size: 12px; font-weight: 650; line-height: 1.5; margin: 7px 0 0; min-height: 0; }
.field-error:not(:empty) { min-height: 18px; }

.form-field--checkbox { padding-top: 5px; }
.checkbox-line { align-items: flex-start; display: flex; gap: 11px; }
.checkbox-line input {
  accent-color: var(--green);
  flex: 0 0 auto;
  height: 19px;
  margin: 2px 0 0;
  width: 19px;
}
.checkbox-line label { margin: 0; }

.spam-note {
  border-top: 1px solid var(--line);
  margin: 0;
  padding-top: 19px;
}

.form-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 16px; margin-top: 21px; }
.form-actions .button { border: 0; cursor: pointer; }
.form-actions .button[disabled] { cursor: not-allowed; opacity: .62; transform: none; }
.retry-token {
  background: transparent;
  border: 0;
  color: var(--green);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 3px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-confirmation { padding: 7px 0 3px; }
.form-confirmation h2 { margin-top: 12px; }
.form-confirmation > p:not(.eyebrow) { color: #536358; font-size: 15px; line-height: 1.7; margin-top: 13px; }
.confirmation-reference { background: #edf1e8; border-left: 4px solid var(--gold); color: var(--green) !important; font-family: var(--display); font-size: 16px !important; font-weight: 700; padding: 12px 14px; }
.confirmation-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.button-border-green { background: transparent; border-color: var(--green); color: var(--green); }
.button-border-green:hover { background: #e9eee6; }

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

[hidden] { display: none !important; }

@media (max-width: 850px) {
  .form-hero { padding-block: 53px 51px; }
  .form-hero h1 { font-size: clamp(42px, 9vw, 64px); }
  .form-section { padding-block: 38px 55px; }
  .form-card { padding: 28px; }
}

@media (max-width: 620px) {
  .form-hero > .form-hero-inner > p:not(.eyebrow) { font-size: 15px; }
  .form-card { border-radius: 7px; padding: 22px 18px; }
  .form-fields { grid-template-columns: 1fr; gap: 17px; }
  .form-field--wide { grid-column: auto; }
  .form-group { padding-block: 26px; }
  .form-group legend { font-size: 27px; }
  .form-actions .button, .confirmation-links .button { width: 100%; }
  .form-actions, .confirmation-links { align-items: stretch; flex-direction: column; }
}
