/* form.css — enrollment form: details/summary accordion, step indicator, option cards (radio),
   fields, errors, status messages, fallback link. Uses tokens.css only. */

.section--form { scroll-margin-top: var(--header-h); }

.enroll {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.enroll[open] { border-color: var(--color-secondary-soft); }

.enroll__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 64px;
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer;
  list-style: none;
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 700;
  background: linear-gradient(90deg, rgba(229, 57, 69, .16), transparent 70%);
}
.enroll__summary::-webkit-details-marker { display: none; }
.enroll__summary:hover { background-color: var(--color-surface-2); }
.enroll__chevron {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-accent);
  position: relative;
  transition: transform var(--dur) var(--ease);
}
.enroll__chevron::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 12px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--color-text-strong);
  border-bottom: 2px solid var(--color-text-strong);
  transform: rotate(45deg);
}
.enroll[open] .enroll__chevron { transform: rotate(180deg); }

.enroll__body { padding: var(--sp-2) var(--sp-5) var(--sp-5); }
.enroll[open] .enroll__body { animation: enroll-in var(--dur) var(--ease); }
@keyframes enroll-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.enroll__lead { color: var(--color-text-muted); }
.enroll__lead p:last-child { margin-bottom: var(--sp-4); }
.enroll__fallback { margin: var(--sp-5) 0 0; text-align: center; }
.enroll__fallback a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--color-text); font-weight: 600; text-decoration: underline; }
.enroll__fallback a:hover { color: var(--color-text); }

/* ---------- form ---------- */
.nsform__progress {
  display: inline-block;
  margin-bottom: var(--sp-4);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-pill);
  background: var(--color-secondary-soft);
  color: var(--color-text);
  font-size: var(--fs-small);
  font-weight: 600;
}
.nsform__step { margin: 0; padding: 0; border: 0; min-width: 0; }
.nsform__legend {
  margin-bottom: var(--sp-4);
  padding: 0;
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  font-weight: 700;
}
.req { color: var(--color-accent-hover); }

/* honeypot: hidden from people, visible to bots */
.nsform__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* option cards */
.option-grid { display: grid; gap: var(--sp-3); grid-template-columns: 1fr; }
@media (min-width: 768px) { .option-grid { grid-template-columns: repeat(2, 1fr); } }
@media (orientation: landscape) and (max-height: 500px) {
  .option-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); }
  .option-card { min-height: 48px; padding: 10px var(--sp-3); font-size: .95rem; }
}
.nsform__legend[tabindex]:focus { outline: none; }

.option-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  min-height: 64px;
  padding: var(--sp-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  cursor: pointer;
  line-height: 1.4;
  transition: border-color var(--dur-fast), background-color var(--dur-fast), box-shadow var(--dur-fast);
}
.option-card:hover { border-color: var(--color-secondary); }
.option-card input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--color-accent);
}
.option-card:has(input:checked) {
  border-color: var(--color-accent);
  background: rgba(229, 57, 69, .12);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}
.option-card:has(input:focus-visible) { outline: 2px solid var(--color-white-ring); outline-offset: 2px; }

.nsform__other { margin-top: var(--sp-3); }

/* fields */
.field { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.field__label { font-weight: 500; color: var(--color-text); }
.field__input {
  width: 100%;
  min-height: 48px;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: 1rem; /* ≥16px — no zoom on iOS */
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
textarea.field__input { min-height: 96px; resize: vertical; }
.field__input::placeholder { color: var(--color-text-muted); }
.field__input:focus { outline: none; border-color: var(--color-secondary); box-shadow: 0 0 0 3px rgba(110, 134, 166, .35); }
.field__input[aria-invalid="true"] { border-color: var(--color-error); box-shadow: 0 0 0 3px rgba(255, 107, 107, .25); }

.nsform__error {
  margin: var(--sp-3) 0 0;
  color: var(--color-error);
  font-weight: 500;
}
.nsform__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}
.nsform__actions [data-next] { margin-left: auto; }
@media (max-width: 479px) { .nsform__actions .btn { flex: 1 1 100%; } }

.nsform.is-sending [data-submit] { opacity: .6; pointer-events: none; }

/* status messages */
.nsform__status {
  margin-top: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
}
.nsform__status.is-success { border-color: var(--color-success); color: var(--color-success); }
.nsform__status.is-error { border-color: var(--color-error); color: var(--color-error); }
.nsform__status a { color: inherit; font-weight: 600; }
