/* ============================================================
   GEM - one box, "Sign in" or "Join GEM" (to-B 044, from-B 063, 20 Nov 2026).
   Loaded after auth.css on login-patient.html, login-professional.html and sign-in.html only.
   The site's own tokens; the compat rules of auth.css (no :has(), no inset shorthand, no flex gap).
   Measured: --purple-deep #2E2150 on white 14.6:1 (the chosen choice); --text #2E2A3D on --lavender #F2EEF8 12.5:1
   (the other choice); the focus ring --focus #3A2A66 on --lavender 10.9:1.
   ============================================================ */

/* The two choices: one control, a quiet track with the chosen choice raised on white. The state is told by shape,
   weight and words (aria-selected), never by colour alone. */
.gem-choice {
  display: flex;
  margin: 0 0 1.6rem;
  padding: 4px;
  background: var(--lavender);
  border: 1px solid rgba(58, 42, 102, 0.14);
  border-radius: 999px;
}
.gem-choice__tab {
  -webkit-box-flex: 1;
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0.55rem 0.9rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  cursor: pointer;
  text-align: center;
}
.gem-choice__tab + .gem-choice__tab { margin-left: 4px; }
.gem-choice__tab[aria-selected="true"] {
  background: var(--white);
  border-color: rgba(58, 42, 102, 0.18);
  color: var(--purple-deep);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(46, 33, 80, 0.12), 0 4px 10px -6px rgba(46, 33, 80, 0.3);
}
.gem-choice__tab:hover { color: var(--purple-deep); }
.gem-choice__tab:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* The words that belong to one choice only */
[data-gem-mode][hidden] { display: none !important; }

/* The Join fields sit in the same rhythm as the email field */
.gem-join .field { margin-bottom: 1.15rem; }
.gem-join select {
  width: 100%;
  min-height: 48px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background-color: var(--white);
  border: 2px solid var(--text-muted);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
}
.gem-join select:focus { border-color: var(--purple); outline: 3px solid var(--focus); outline-offset: 2px; }
.gem-join .consent-field { margin-top: 0.4rem; }

/* The shared-computer choice, now on the code step (it governs where the session is kept, which happens there) */
#gem-step-code .consent-field { margin: 0.4rem 0 1.1rem; }

/* sign-in.html (to-B 044 answer 5): the chooser - two choices, each one link to its login page. (Was: a "join" line whose class
   gave an inline span a box that covered the heading above it - the fault in 063's picture 05.) */
.gem-chooser { margin: 0; padding: 0; list-style: none; }
.gem-chooser__item + .gem-chooser__item { margin-top: 1rem; }
.gem-chooser__link {
  display: block; position: relative; min-height: 44px; padding: 1.3rem 3.2rem 1.25rem 1.4rem; background: var(--white);
  border: 1px solid rgba(58, 42, 102, 0.18); border-radius: var(--radius); color: var(--text); text-decoration: none;
}
.gem-chooser__link:hover { border-color: rgba(58, 42, 102, 0.5); }
.gem-chooser__link:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.gem-chooser__title { display: block; margin: 0 0 0.3rem; font-family: var(--font-head); font-weight: 600; font-size: 1.3rem; line-height: 1.3; color: var(--purple-deep); }
.gem-chooser__line { display: block; font-size: 1rem; line-height: 1.55; color: var(--text); }
.gem-chooser__go { position: absolute; top: 50%; right: 1.3rem; margin-top: -0.7em; font-size: 1.25rem; font-weight: 600; color: var(--purple); }
[dir="rtl"] .gem-chooser__link { padding: 1.3rem 1.4rem 1.25rem 3.2rem; }
[dir="rtl"] .gem-chooser__go { right: auto; left: 1.3rem; -webkit-transform: scaleX(-1); transform: scaleX(-1); }

@media (prefers-reduced-motion: reduce) { .gem-choice__tab { transition: none; } }

/* to-B 046 part 1 (from-B 067): the help under the code step - one item to a line, each a 44px target (auth.css .auth-toggle), nothing covered at 360-430px */
.gem-code-wait { margin: 1rem 0 0.25rem; }
.gem-code-help { margin: 0; padding: 0; list-style: none; }
.gem-code-help li { margin: 0; }
.gem-code-help .auth-toggle { text-align: start; overflow-wrap: anywhere; }

/* to-B 046 part 2 (from-B 067): the phone box (type="tel") drawn exactly as styles.css draws the text and email boxes */
input[type="tel"] { width: 100%; font-family: var(--font-body); font-size: 1rem; color: var(--text); background: var(--white); border: 2px solid var(--text-muted); border-radius: var(--radius); padding: 0.7rem 0.85rem; }
input[type="tel"]:focus { border-color: var(--purple); }

/* to-B 046 part 3 (from-B 067): "You\2019 re signed in as ..." with Continue / Sign out and use a different account */
.gem-signed-in { margin: 0.5rem 0 0; }
.gem-signed-in__line { margin: 0 0 1rem; font-size: 1.05rem; line-height: 1.5; overflow-wrap: anywhere; }
.gem-signed-in__line:focus { outline: none; }
.gem-signed-in__line:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.gem-signed-in__actions { display: flex; flex-wrap: wrap; margin: 0 -0.5rem -0.5rem 0; }
.gem-signed-in__actions .btn { min-height: 44px; margin: 0 0.5rem 0.5rem 0; white-space: normal; text-align: center; }
