/* Form page in the site design. Loads after main.css and reuses its tokens, buttons, header and footer. */

/* Page: the warm yellow of the E hero, with the big sun behind the form */
.apply {
  position: relative;
  padding: clamp(2.5rem, 6vw, 5rem) var(--pad) clamp(3.5rem, 7vw, 6rem);
  background: var(--sun-soft);
  overflow: hidden;
  isolation: isolate;
}
.apply::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(130vw, 900px);
  aspect-ratio: 1;
  right: -45%;
  bottom: -25%;
  background: var(--sun);
  border-radius: 50%;
}
.apply-inner { display: grid; gap: clamp(2.25rem, 5vw, 4rem); max-width: var(--max); margin: 0 auto; align-items: start; }
@media (min-width: 960px) {
  .apply-inner { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
  .apply-intro { position: sticky; top: 6.5rem; }
  .apply::before { right: -10%; bottom: auto; top: 58%; transform: translateY(-50%); width: min(58vw, 820px); }
}

/* Phones and tablets: headline first, then straight into the form, then what happens next */
@media (max-width: 959px) {
  .apply-inner { gap: 0; }
  .apply-intro { display: contents; }
  .form-card { order: 1; margin-bottom: 2.75rem; }
  .next, .apply .trust, .call { order: 2; }
}

/* Intro column */
.apply h1 { margin: 0 0 1.25rem; display: grid; justify-items: start; gap: 0.75rem; text-transform: uppercase; }
.apply .tag { font-size: clamp(1.05rem, 0.9rem + 0.8vw, 1.5rem); }
.apply-big { font-weight: 700; font-size: clamp(2.8rem, 1.6rem + 5vw, 5.6rem); line-height: 0.95; }
.apply .lede { margin-bottom: 2rem; max-width: 34ch; }
.next { margin: 0 0 2rem; }
.next-steps { position: relative; list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 1.25rem; }
.next-steps li:not(:last-child)::before { content: ""; position: absolute; top: 2.5rem; bottom: -1.25rem; left: 1.25rem; border-left: 2px solid var(--ink); transform: translateX(-1px); }
.next-steps li { position: relative; display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem; align-items: start; }
.next-steps .n { grid-row: auto; width: 2.5rem; height: 2.5rem; font-size: 1.05rem; box-shadow: 0 0 0 5px var(--sun-soft); }
.next-steps h2 { margin: 0.35rem 0 0.15rem; font-size: 1.1rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1.2; }
.next-steps p { margin: 0; color: #4a4a4a; font-size: 0.98rem; }
.apply .trust { margin: 0 0 0.75rem; }
.call { margin: 0; font-size: 1rem; }
.call a { font-family: "Oswald", sans-serif; font-weight: 600; font-size: 1.2rem; letter-spacing: 0.02em; text-underline-offset: 4px; text-decoration-thickness: 2px; display: inline-flex; align-items: center; min-height: 44px; }

/* The form card: same hairline and layered shadow as the program cards */
.form-card {
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(20, 20, 20, 0.08);
  box-shadow: 0 1px 1px rgba(20, 20, 20, 0.04), 0 2px 4px rgba(20, 20, 20, 0.04), 0 8px 16px rgba(20, 20, 20, 0.05), 0 20px 40px rgba(20, 20, 20, 0.07);
}

/* Band at the top of the card: shows the program the chosen age leads to, coloured like its card on the home page */
.form-band { display: flex; align-items: center; gap: 1rem; padding: 1.4rem clamp(1.4rem, 3vw, 2.25rem); background: var(--ink); color: #fff; }
.form-band img { flex: none; width: 44px; height: 44px; border-radius: 50%; background: #fff; }
.form-band > div { display: grid; justify-items: start; gap: 0.45rem; }
.band-title { margin: 0; font-family: "Oswald", sans-serif; font-weight: 700; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); line-height: 1; text-transform: uppercase; }
.form-band[data-program="puppy"] { background: var(--sun); color: var(--ink); }
.form-band[data-program="board"] { background: var(--red); color: #fff; }
@media (prefers-reduced-motion: no-preference) { .form-band { transition: background-color 280ms ease, color 280ms ease; } }

#inquiry, .done { padding: clamp(1.5rem, 3vw, 2.25rem); }
.form-status { margin: 0; color: var(--mute); }

/* Fields */
#form-fields { display: grid; gap: 1.35rem; }
.field { display: grid; gap: 0.45rem; }
.field > label, .field legend {
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
}
.field fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.field legend { padding: 0; margin-bottom: 0.55rem; }
.req { color: var(--red); }

.field input:not([type="radio"]):not([type="checkbox"]), .field select, .field textarea {
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #8a8a8a;
  border-radius: 12px;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.field select {
  padding-right: 2.75rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23141414' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.1rem;
}
.field input::placeholder, .field textarea::placeholder { color: #6b6b6b; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(244, 196, 48, 0.6);
}
.field [aria-invalid="true"] { border-color: var(--red) !important; }
.field [aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(200, 36, 27, 0.22); }
@media (prefers-reduced-motion: no-preference) {
  .field input, .field select, .field textarea { transition: border-color 160ms ease, box-shadow 160ms ease; }
}
@media (hover: hover) { .field input:not([type="radio"]):not([type="checkbox"]):hover, .field select:hover, .field textarea:hover { border-color: #555; } }

/* Choice pills for radio and checkbox questions */
.choice {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.5rem 1.1rem 0.5rem 0.9rem;
  background: #fff;
  border: 1.5px solid #8a8a8a;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.98rem;
}
.choice input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--ink); }
.choice:has(input:checked) { background: var(--sun-soft); border-color: var(--ink); }
.choice:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(244, 196, 48, 0.6); }
.field > .choice { border-radius: 12px; align-items: flex-start; padding: 0.85rem 1rem; }
.field > .choice input { margin-top: 0.2rem; }

.field-help { margin: 0; font-size: 0.9rem; color: var(--mute); }
.field-error { margin: 0; font-size: 0.92rem; font-weight: 600; color: var(--red); }
.form-error { margin-top: 1.25rem; padding: 0.85rem 1rem; background: #fdecea; border-radius: 12px; }

/* Send button: the E pill, full width on phones, with the same arrow as the program cards */
.submit { margin-top: 1.75rem; width: 100%; gap: 0.6rem; border: 0; cursor: pointer; }
.submit::after { content: "\2192"; font-family: system-ui, sans-serif; letter-spacing: 0; }
.submit[hidden] { display: none; }
.submit:disabled { opacity: 0.7; cursor: progress; }
@media (min-width: 600px) { .submit { width: auto; } }
@media (hover: hover) { .submit:hover { background: var(--red); } }
@media (prefers-reduced-motion: no-preference) {
  .submit::after { transition: transform 200ms var(--ease); }
  .submit:active { transform: scale(0.98); }
}
@media (hover: hover) { .submit:hover::after { transform: translateX(4px); } }
.submit:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.form-fine { margin: 1rem 0 0; font-size: 0.85rem; color: var(--mute); }

/* Thank you state */
.done { display: grid; gap: 0.5rem; }
.done[hidden], #inquiry[hidden] { display: none; }
.done::before {
  content: "\2713";
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 0.5rem;
  background: var(--sun);
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 700;
  border-radius: 50%;
}
.done p { margin: 0; font-size: 1.1rem; }
.done p:first-child { font-family: "Oswald", sans-serif; font-weight: 700; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); line-height: 1.1; text-transform: uppercase; }
.done:focus { outline: none; }