/* ==========================================================================
   Sydney Huskies Basketball — player registration form
   Phone, touch and embedded-page layer

   Loaded after the form's own <style> block. It is additive: nothing in that
   block is edited, so taking this file (and form.js) off the page puts the
   form back exactly as it was.
   ========================================================================== */

/* ── Every width ──────────────────────────────────────────────────────── */

/* The form's selects are stripped of their native look and were given
   nothing in its place, so a menu looked exactly like a text box. */
.field select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23555' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 11px;
  text-overflow: ellipsis;
}

/* The logo is a file now rather than text inside the page, so the room it
   will take is said up front and nothing below it moves when it arrives. */
.header img { aspect-ratio: 753 / 263; }

/* No wait and no double-tap zoom on anything that is pressed. */
a, button, select, label, input { touch-action: manipulation; }

/* A notch or a home bar is never drawn over. */
body {
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-bottom: max(4rem, calc(2rem + env(safe-area-inset-bottom)));
}

/* Keyboard focus that can be seen on the dark buttons as well as the fields. */
.btn:focus-visible, .toggle-btn:focus-visible, a:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}
.btn-next:focus-visible, .btn-submit:focus-visible { outline-color: #fff; box-shadow: 0 0 0 4px #111; }
.card-header-text h2:focus { outline: none; }

/* ── Inside the club's website ────────────────────────────────────────────
   On sydneyhuskies.com the form sits in a frame. form.js marks the page
   when that is so, and tells the page around it how tall the form is — so
   the frame is made exactly that tall and the form is scrolled with the
   page, not as a second, shorter page inside it. */
html.is-embedded, html.is-embedded body { min-height: 0; }
html.is-embedded body { padding-top: 1.25rem; padding-bottom: 1.5rem; }
html.is-embedded .header { padding-top: 0.25rem; }

/* ── Touch, and any narrow screen ─────────────────────────────────────── */

@media (max-width: 540px), (pointer: coarse) {
  /* Under 16px, an iPhone zooms the whole page in when a box is pressed and
     leaves it zoomed. */
  .field input, .field select, .field textarea { font-size: 16px; padding: 12px 13px; }
  .field select { padding-right: 38px; }

  /* Sized for a finger. */
  .btn { min-height: 48px; padding: 12px 22px; }
  .toggle-btn { min-height: 44px; padding: 10px 20px; font-size: 15px; }
  .toggle-group { gap: 10px; }
  #addContactBtn { min-height: 40px; padding: 8px 16px !important; }
  .recovery-notice .btn { min-height: 44px; }
  .check-item { padding: 13px 12px; gap: 12px; }
  .check-item input[type='checkbox'],
  #commitment-checkbox, #tandc-checkbox {
    width: 22px !important;
    height: 22px !important;
  }
  #commitment-gate label, #tandc-gate label { min-height: 44px; align-items: center !important; }
  #tandc-gate a { min-height: 44px; }
  #tandc-gate > div { gap: 0 !important; }
  .size-guide-prompt { padding: 12px; }
  .size-guide-prompt a { display: inline-block; padding: 4px 0; }

  /* Date of birth: three boxes a thumb can land in. */
  #dob_dd, #dob_mm { width: 64px !important; }
  #dob_yy { width: 88px !important; }
}

/* ── Phone ────────────────────────────────────────────────────────────── */

@media (max-width: 540px) {
  body { padding-top: 1.25rem; padding-left: max(0.75rem, env(safe-area-inset-left)); padding-right: max(0.75rem, env(safe-area-inset-right)); }
  html.is-embedded body { padding-left: 0.5rem; padding-right: 0.5rem; padding-top: 1rem; }
  .header { margin-bottom: 1.5rem; padding-top: 0.25rem; }
  .header img { max-width: 300px !important; margin-bottom: 1rem !important; }
  .header p { font-size: 15px; }
  .progress-wrap { margin-bottom: 1.5rem; }
  .dot-label { font-size: 11px !important; letter-spacing: 0.03em !important; }
  .card { border-radius: 14px; }
  .card-header { padding: 1rem 1.25rem; }
  .field label { font-size: 12.5px; line-height: 1.35; }
  .field-hint { font-size: 13px; }
  .notice, .info-banner { font-size: 14px; }
  .check-item .check-sub { font-size: 13px; }
  .grid-2, .grid-3 { gap: 0.9rem; }

  /* The consent text was a 180px window that scrolled inside the page. On a
     phone that is four lines at a time, read through a letterbox — it is set
     out in full instead, so what is being agreed to can simply be read. */
  .consent-box { max-height: none; overflow: visible; font-size: 14px; }

  /* Back, the step count and Continue: the two buttons share the row and the
     count sits above them, so neither button is squeezed onto two lines. */
  .nav-row { flex-wrap: wrap; gap: 10px; padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
  .nav-row .step-counter { order: -1; flex: 1 1 100%; text-align: center; }
  .nav-row .btn { justify-content: center; white-space: nowrap; }
  .nav-row .btn-back { flex: 0 0 auto; }
  .nav-row .btn-next, .nav-row .btn-submit { flex: 1 1 auto; }
  .success-screen { padding: 2.25rem 1.25rem; }
}

@media (max-width: 359px) {
  .dot-label { font-size: 10px !important; letter-spacing: 0 !important; }
  .dot-circle { width: 28px; height: 28px; }
  .step-line { margin-top: -20px; }
  .card-body { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
