/* ========== THE INTAKE FORM ON A CONDITION PAGE ==========
   The "Find out in 2 minutes" test (scripts/cta-test.js): in its form arm, the
   knee, hip, shoulder and spine pages show book.html's intake form right
   after "Who qualifies". The form itself is book.html's (styles/book.css,
   which keys on the .book class this section carries); this sheet only sets
   what stands around it and reads its labels in the page's plain type, the
   same way quiz-result.css does for the quiz result's copy of the form.
   Hidden until the arm says otherwise, so the other arm's page is today's. */
.ie {
  /* The colours this section adds over the site's tokens: the same values
     quiz-result.css uses for its copy of the form, except the field edge,
     darker here so an empty white field shows on the white card (3.3:1,
     WCAG 1.4.11; .34 measured 2.1:1). */
  --ie-online: #1B5A38;
  --ie-pulse: #2f9e62;
  --ie-placeholder: #5f7088;
  --ie-error: #a8342a;
  --ie-error-ring: rgba(168, 52, 42, .16);
  --ie-edge: rgba(11, 29, 58, .5);
  --ie-focus-ring: rgba(45, 110, 177, .28); /* --accent-blue, translucent */
  background: var(--accent-wash); padding: clamp(48px, 6vw, 88px) 0;
}
.ie[hidden] { display: none; }
.ie__inner { display: grid; gap: 28px; align-items: start; }
.ie .ie__aside h2 {
  font-family: var(--font-display); font-weight: 300; color: var(--ink);
  font-size: clamp(2rem, 3.4vw, 2.75rem); line-height: 1.08; margin: 0 0 18px;
}
.ie .ie__aside h2 em { font-style: italic; color: var(--accent-blue); }
.ie .ie__aside p { font-size: 17px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 14px; }
.ie .ie__aside p:last-child { margin-bottom: 0; }
/* The page sheets reset every p and h2 under main (the shoulder page's
   .sh-page main p / h2 take margins to 0 and set their own heading type; the
   knee page's lifts every p's max-width), one step stronger than book.css's
   single classes. These restate book.css's values, one class stronger, so
   the form is spaced the same on all four pages. */
.ie .book-status { margin: 18px 0 0; }
.ie .book-success h2 {
  font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 18px;
}
.ie .book-success h2 em { color: var(--accent-blue); }
.ie .book-form {
  background: var(--white); border: 1px solid var(--border); border-radius: 8px;
  padding: clamp(22px, 3.4vw, 48px);
}
.ie .v4-mono { font-family: var(--font-body); font-size: 14px; letter-spacing: 0; text-transform: none; }
.ie .book-sysbar__ok { font-size: 15px; font-weight: 600; color: var(--ie-online) !important; }
.ie .book-sysbar__pulse { flex: none; background: var(--ie-pulse); }
.ie .book-sysbar__pulse::after { background: var(--ie-pulse); animation-play-state: paused; }
.ie .book-form__status.is-live .book-sysbar__pulse::after { animation-play-state: running; }
.ie .book-for-patient { margin: 0 0 28px; border: 0; border-radius: 4px; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.ie .book-field label {
  font-family: var(--font-body); font-size: 15px; font-weight: 500;
  letter-spacing: 0; text-transform: none; line-height: 1.35; color: var(--ink);
}
.ie .book-field label .book-lbl-opt { font-size: 13.5px; font-weight: 400; color: var(--ink-muted); }
.ie .book-field :is(input[type="text"], input[type="email"], input[type="tel"], textarea),
.ie .book-field select {
  font-size: 16px; min-height: 54px; padding: 14px 16px; border-radius: 4px;
  border-color: var(--ie-edge);
}
/* Kept out of the :is() above, whose specificity is its most specific
   argument: inside it, select outranked this rule and its text ran under
   the chevron. */
.ie .book-field select { padding-right: 44px; text-overflow: ellipsis; }
.ie .book-field textarea { min-height: 128px; }
.ie .book-field :is(input, textarea)::placeholder { color: var(--ie-placeholder); opacity: 1; }
.ie .book-field :is(input, select, textarea):focus {
  border-color: var(--accent-blue); box-shadow: 0 0 0 3px var(--ie-focus-ring);
}
/* an invalid field keeps its red edge (the border rule above would otherwise
   outrank book.css's) */
.ie .book-field.is-error :is(input, select, textarea) { border-color: var(--ie-error); box-shadow: 0 0 0 3px var(--ie-error-ring); }
.ie :is(.book-success__case, .book-success__next h4, .book-success__next .n, .book-success__next .when) {
  font-family: var(--font-body); font-size: 14px; letter-spacing: 0; text-transform: none;
}
.ie .book-success__next .t { font-size: 16px; }
.ie .book-field__err { font-family: var(--font-body); font-size: 14px; letter-spacing: 0; text-transform: none; line-height: 1.45; color: var(--ie-error); }
.ie .book-field__hint { font-size: 13.5px; }
.ie .book-primary { min-height: 52px; font-size: 16px; }
.ie .book-legal { font-size: 13.5px; line-height: 1.55; margin: 32px auto 0; max-width: 62ch; }
/* book.css underlines with a border; one underline, not both */
.ie .book-legal a { border-bottom: 0; text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 1100px) {
  .ie__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 700px); gap: clamp(40px, 6vw, 88px); }
  .ie__aside { position: sticky; top: 112px; padding-top: 24px; }
}
/* On a short screen the side text is taller than the room under the header,
   so stuck it would hide its last line (where treatment is paid for) until
   the form scrolled past. It scrolls with the page there instead. */
@media (min-width: 1100px) and (max-height: 760px) {
  .ie__aside { position: static; }
}

/* ========== ARRIVING (surprise-and-delight, the patient register) ==========
   Calm, and only when it says something. cta-test.js adds .ie--wait when it
   shows the section and takes it off the first time the section is on
   screen, so the copy and the card rise once (transform and opacity only),
   never again on a scroll back. A jump from "Find out in 2 minutes" or "Book a
   call" lands with one soft ring on the card (.ie--landed), so the eye knows this is where
   it was sent. After sending, the check draws itself. */
.ie__aside, .ie .book-form {
  transition: opacity .7s var(--ease-out-expo), transform .7s var(--ease-out-expo);
}
.ie .book-form { transition-delay: .12s; }
.ie.ie--wait .ie__aside, .ie.ie--wait .book-form { opacity: 0; transform: translateY(18px); }
@keyframes ieLanded {
  0%   { box-shadow: 0 0 0 0 transparent; }
  30%  { box-shadow: 0 0 0 5px var(--ie-focus-ring); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
/* cta-test.js adds .ie--landed on the click, not :target: these pages scroll
   to their anchors in script, which never updates :target. */
.ie.ie--landed .book-form { animation: ieLanded 1.8s var(--ease-out-expo) .45s both; }
@keyframes ieGlyph { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ieCheck { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.ie .book-success.is-active .book-success__glyph { animation: ieGlyph .45s var(--ease-out-expo) both; }
.ie .book-success.is-active .book-success__glyph::after { animation: ieCheck .5s var(--ease-out-expo) .25s both; }
@media (prefers-reduced-motion: reduce) {
  .ie__aside, .ie .book-form { transition: none; }
  .ie.ie--wait .ie__aside, .ie.ie--wait .book-form { opacity: 1; transform: none; }
  .ie.ie--landed .book-form,
  .ie .book-success.is-active .book-success__glyph,
  .ie .book-success.is-active .book-success__glyph::after { animation: none; }
}

/* Print: never blank, whether or not the section was ever on screen. */
@media print {
  .ie.ie--wait .ie__aside, .ie.ie--wait .book-form { opacity: 1; transform: none; }
}
