/* ============================================================
   FTFamily — the family-facing sign-up form.

   Mobile-first and deliberately large: this is filled in one-handed,
   on a phone, in a busy lobby, often by someone holding a toddler.
   Inputs are 16px minimum so iOS doesn't zoom on focus, and tap
   targets are >= 44px tall.
   ============================================================ */

.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
}

/* ── Header ─────────────────────────────────────────────────── */
.masthead {
  text-align: center;
  padding: 1.5rem 0 1.25rem;
}
.masthead__church {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.masthead__title {
  font-size: 1.75rem;
  margin-top: 0.35rem;
}
.masthead__lead {
  margin: 0.6rem auto 0;
  max-width: 30rem;
  font-size: 0.95rem;
  color: var(--text-body);
}

/* ── Sections ───────────────────────────────────────────────── */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.section__title {
  font-size: 1.05rem;
  font-weight: 600;
}
.section__hint {
  margin: -0.5rem 0 0.9rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.section__optional {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Fields ─────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.85rem; }
.field:last-child { margin-bottom: 0; }

.field__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.field__required { color: var(--accent); margin-left: 0.15rem; }
.field__hint { font-size: 0.78rem; color: var(--text-muted); }

.field__input,
.field__select,
.field__textarea {
  width: 100%;
  /* 16px keeps iOS Safari from zooming the viewport on focus. */
  font-size: 1rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.75rem;
  min-height: 2.85rem;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.field__textarea { min-height: 5rem; resize: vertical; }
.field__input:focus,
.field__select:focus,
.field__textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field__input::placeholder { color: var(--text-muted); }

.field--invalid .field__input,
.field--invalid .field__select,
.field--invalid .field__textarea {
  border-color: var(--err-text);
  background: var(--err-bg);
}
.field__error {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--err-text);
}

/* Two-up rows collapse to one column on narrow screens. */
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.row--thirds { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 32rem) {
  .row, .row--thirds { grid-template-columns: 1fr; }
}

/* ── Choice controls ────────────────────────────────────────── */
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice {
  position: relative;
  flex: 1 1 auto;
  min-width: 6rem;
}
.choice input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.choice input:checked + span {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
  font-weight: 600;
}
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.6rem 0;
  cursor: pointer;
}
.checkbox input {
  width: 1.35rem;
  height: 1.35rem;
  margin: 0.1rem 0 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.checkbox__text { font-size: 0.92rem; color: var(--text); }
.checkbox__note { display: block; font-size: 0.8rem; color: var(--text-muted); }

/* ── Repeating people (children) ────────────────────────────── */
.person {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.9rem;
  background: var(--surface-alt);
}
.person__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}
.person__title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 2.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-hover);
  background: var(--surface);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  transition: background var(--ease);
}
.add-btn:hover { background: var(--accent-soft); }

.remove-btn {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}
.remove-btn:hover { color: var(--err-text); border-color: #f1b0b7; background: var(--err-bg); }

/* ── Submit ─────────────────────────────────────────────────── */
.submit-bar { margin-top: 1.5rem; }
.submit-btn {
  width: 100%;
  min-height: 3.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: background var(--ease);
}
.submit-btn:hover { background: var(--accent-hover); }
.submit-note {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Error summary ──────────────────────────────────────────── */
.errors {
  background: var(--err-bg);
  border: 1px solid var(--err-border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}
.errors__title { font-size: 0.95rem; font-weight: 700; color: var(--err-text); }
.errors__list { margin: 0.5rem 0 0; padding-left: 1.1rem; }
.errors__list li { font-size: 0.87rem; color: var(--err-text); margin-bottom: 0.2rem; }
.errors__list a { color: var(--err-text); text-decoration: underline; }

/* ── Confirmation page ──────────────────────────────────────── */
.confirm { text-align: center; padding: 1.5rem 1.1rem 2rem; }
.confirm__tick {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  color: var(--ok-text);
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  border-radius: 50%;
}
.confirm__title { font-size: 1.5rem; margin-bottom: 0.5rem; }
.confirm__lead { font-size: 0.98rem; color: var(--text-body); margin: 0 0 1.5rem; }

.code {
  display: inline-block;
  padding: 1rem 1.75rem;
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
}
.code__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-hover);
}
.code__value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-top: 0.2rem;
}

.confirm__next {
  margin-top: 1.75rem;
  text-align: left;
  font-size: 0.9rem;
  color: var(--text-body);
}
.confirm__next li { margin-bottom: 0.4rem; }

.warnings {
  margin-top: 1.5rem;
  text-align: left;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}
.warnings__title { font-size: 0.88rem; font-weight: 700; color: var(--warn-text); }
.warnings__list { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.warnings__list li { font-size: 0.84rem; color: var(--warn-text); }

/* ── Footer ─────────────────────────────────────────────────── */
.foot {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

@media print { .no-print { display: none; } }
