/* Little Tyvy Montessori - Student Registration page.
   Companion to home.css, pages.css and book-a-tour.css (must load first: they define the
   design tokens and the shared .ty-bookform field styling this form reuses). Mirrors the
   Contact page's .ty-enqsec/.ty-enqcard treatment (green card head, white card, cream
   section) but wider, since this form has several sections instead of one short list. */

.ty-regsec { background: var(--cream); padding: 92px 0 96px; }
.ty-regcard { max-width: 920px; margin: 0 auto; background: var(--white); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 60px -34px rgba(60, 58, 44, .32); overflow: hidden; }
.ty-regcard__head { background: var(--green); text-align: center; padding: 42px 32px 40px; }
.ty-page .ty-regcard__head .ty-eyebrow { color: rgba(255, 255, 255, .88); margin-bottom: 14px; }
.ty-page .ty-regcard__head h2 { color: #fff; font-size: clamp(28px, 3.2vw, 36px); }
.ty-page .ty-regcard__head p:last-child { margin: 12px auto 0; max-width: 500px; font-size: 14.5px; line-height: 1.7; color: rgba(255, 255, 255, .9); }
.ty-regform { padding: 44px 48px 48px; }

/* form sections: "1. Child's Information", "2. Parent / Guardian Information", ... */
.ty-formsec + .ty-formsec { margin-top: 42px; padding-top: 38px; border-top: 1px solid var(--line-2); }
.ty-page .ty-formsec__title { margin: 0 0 4px; font-size: 20px; }
.ty-formsec__note { margin: 0 0 22px; font-size: 12.5px; color: var(--muted); }
.ty-formsec__title + .ty-fields,
.ty-formsec__note + .ty-fields { margin-top: 22px; }
/* "Parent / Guardian 1" / "Parent / Guardian 2" sub-labels inside section 2 */
.ty-formsec__sub2 { margin: 30px 0 16px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--green); }
.ty-fields + .ty-formsec__sub2 { margin-top: 32px; }

/* inline radio groups: Gender, Toilet training status, Additional support */
.ty-radiogroup { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; min-height: 52px; }
.ty-radiogroup .wpcf7-list-item { margin: 0; }
.ty-radiogroup label { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink); cursor: pointer; }
.ty-page .ty-regform .ty-radiogroup input[type='radio'] { width: 18px; height: 18px; margin: 0; accent-color: var(--green); flex: none; }

/* stack the 3 policy-agreement checkboxes with a little breathing room */
.ty-formsec .ty-consent + .ty-consent { margin-top: 14px; }

@media (max-width: 640px) {
  .ty-regsec { padding: 56px 0 64px; }
  .ty-regcard { border-radius: 16px; }
  .ty-regcard__head { padding: 32px 22px 30px; }
  .ty-regform { padding: 30px 22px 34px; }
  .ty-formsec + .ty-formsec { margin-top: 34px; padding-top: 30px; }
}

/* --- fixes ---------------------------------------------------------------- */
/* .ty-page .ty-field sets display:block, which would override the [hidden] attribute */
.ty-page .ty-field[hidden] { display: none; }

/* radio group is a <div> now (no nested <label>): keep the title clear of the options */
.ty-page .ty-regform div.ty-field > .ty-label { margin-bottom: 8px; }
.ty-radiogroup label { padding: 6px 0; }
.ty-radiogroup .wpcf7-list-item-label { line-height: 1.4; }

/* CF7 response message: the card already has padding, so drop the 48px side margin used by the stepper form */
.ty-page .ty-regform .wpcf7 form .wpcf7-response-output { margin: 30px 0 0; }

/* long words, e-mail addresses and typed signatures must never push the card wider than the screen */
.ty-regform, .ty-regform .ty-field, .ty-regform .wpcf7-form-control-wrap { min-width: 0; }
.ty-regform .wpcf7-not-valid-tip { overflow-wrap: anywhere; }
.ty-regform .ty-hint { display: block; margin-top: 8px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }

@media (max-width: 640px) {
  .ty-radiogroup { gap: 6px 22px; min-height: 0; }
  .ty-page .ty-regform .ty-radiogroup input[type='radio'] { width: 20px; height: 20px; }
  .ty-page .ty-regform .wpcf7 form .wpcf7-response-output { margin-top: 24px; }
}

/* --- round 2: heading colour, radio spacing, policy-agreement message --------- */

/* a site-wide rule (.ty-page h2 { color:#545454 !important }) forces headings grey; this card head is green */
.ty-page .ty-regcard__head h2 { color: #fff !important; }

/* radio options: Contact Form 7 wraps them in extra spans, so the gap must be set on the inner list */
.ty-page .ty-regform .ty-radiogroup { display: block; min-height: 0; padding-top: 2px; }
.ty-page .ty-regform .ty-radiogroup .wpcf7-form-control-wrap { display: block; }
.ty-page .ty-regform .ty-radiogroup .wpcf7-radio { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 36px; }
.ty-page .ty-regform .ty-radiogroup .wpcf7-list-item { display: block; margin: 0; }
.ty-page .ty-regform .ty-radiogroup .wpcf7-list-item label { display: inline-flex; align-items: center; gap: 10px; padding: 9px 0; }

/* policy agreement: inline message + highlight for the boxes that are still unticked */
.ty-page .ty-regform .ty-consent-error { display: block; margin: 20px 0 0; padding: 13px 18px; border-left: 2px solid #a4452f; border-radius: 0 8px 8px 0; background: #fbf1ee; font-size: 13.5px; line-height: 1.6; color: #7a2f1d; }
.ty-page .ty-regform .ty-consent-error[hidden] { display: none; }
.ty-page .ty-regform .ty-consent.is-missing label { color: #a4452f; }
.ty-page .ty-regform .ty-consent.is-missing input[type='checkbox'] { outline: 2px solid #a4452f; outline-offset: 2px; border-radius: 3px; }

@media (max-width: 640px) {
  .ty-page .ty-regform .ty-radiogroup .wpcf7-radio { gap: 4px 28px; }
  .ty-page .ty-regform .ty-consent-error { padding: 12px 14px; }
}

/* iOS Safari zooms the whole page when a field with text smaller than 16px is focused */
@media (max-width: 640px) {
  .ty-page .ty-regform input[type='text'],
  .ty-page .ty-regform input[type='email'],
  .ty-page .ty-regform input[type='tel'],
  .ty-page .ty-regform input[type='date'],
  .ty-page .ty-regform textarea { font-size: 16px; }
}
