/* ==========================================================================
   Sign in / create an account
   --------------------------------------------------------------------------
   One shell shared by the login page, both signup pages and the two
   verification screens, so the whole account flow looks like one thing.
   Brand tokens, .site-shell, buttons, links and hand-drawn marks come from
   base.css; everything here is scoped to .auth-page (set on <main>).

   Left: the form. Right: a panel saying what the account is actually for —
   different for a student and a tutor, because they are joining for
   different reasons.
   ========================================================================== */

.auth-page {
  background-color: var(--ll-cream);
  color: var(--ll-body);
  font-family: "Lexend", "Segoe UI", sans-serif;
}

.auth-page h1,
.auth-page h2,
.auth-page h3 {
  color: var(--ll-ink);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-page :where(ul, ol) {
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-page a:focus-visible,
.auth-page button:focus-visible,
.auth-page input:focus-visible,
.auth-page select:focus-visible {
  outline: 2px solid var(--ll-green);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.auth-shell { padding-block: 64px 88px; }

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: 56px;
  align-items: start;
  max-width: 1120px;
  margin-inline: auto;
}

.auth-card {
  padding: 44px;
  border: 1px solid var(--ll-line);
  border-radius: 12px;
  background-color: #fff;
}

.auth-card h1 {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(1.8rem, 2.8vw, 2.4rem);
  line-height: 1.1;
}

.auth-intro { max-width: 46ch; margin: 14px 0 0; line-height: 1.7; }

/* --------------------------------------------------------------------------
   Form
   --------------------------------------------------------------------------
   The forms add Bootstrap's .form-control / .form-check-input themselves, so
   these rules restyle those classes inside the auth pages rather than asking
   every field definition to change.
   -------------------------------------------------------------------------- */

.auth-form { margin-top: 32px; }

.auth-field { margin-bottom: 20px; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.auth-field label {
  display: block;
  margin-bottom: 7px;
  color: var(--ll-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-page .form-control {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--ll-line);
  border-radius: 8px;
  background-color: #fff;
  color: var(--ll-ink);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-page .form-control:focus {
  border-color: var(--ll-green);
  box-shadow: 0 0 0 3px rgba(15, 91, 67, 0.12);
  outline: 0;
}

.auth-page .form-control::placeholder { color: #9BA39D; }

.field-hint { margin: 8px 0 0; font-size: 0.82rem; line-height: 1.55; }

.field-error { margin: 7px 0 0; color: #B3261E; font-size: 0.85rem; }
.field-error:empty { display: none; }

.auth-alert {
  margin-bottom: 22px;
  padding: 14px 16px;
  border: 1px solid #E7C6C2;
  border-radius: 8px;
  background-color: #FBEFED;
  color: #7A2A22;
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Checkboxes read as statements, so the label sits beside the box. */
.auth-check {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.auth-page .form-check-input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--ll-green);
}

/* Bootstrap paints the checked state itself with its own primary, which wins
   over accent-color because the control is appearance:none — so the checked
   colour has to be set explicitly or the ticks come out blue. */
.auth-page .form-check-input:checked {
  border-color: var(--ll-green);
  background-color: var(--ll-green);
}

.auth-page .form-check-input:focus {
  border-color: var(--ll-green);
  box-shadow: 0 0 0 3px rgba(15, 91, 67, 0.18);
}

.auth-check label { margin: 0; font-size: 0.92rem; line-height: 1.55; }
.auth-check a { color: var(--ll-green); text-decoration: underline; text-underline-offset: 3px; }
.auth-check .field-error { grid-column: 2; }

.auth-submit { width: 100%; margin-top: 8px; }

.auth-meta { margin: 22px 0 0; font-size: 0.92rem; text-align: center; }
.auth-meta a { color: var(--ll-green); font-weight: 600; }

.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.auth-label-row a { color: var(--ll-green); font-size: 0.8rem; font-weight: 600; }

/* --------------------------------------------------------------------------
   Side panel
   -------------------------------------------------------------------------- */

.auth-aside { position: relative; padding-top: 12px; }

.auth-panel {
  position: relative;
  z-index: 1;
  padding: 34px;
  border-radius: 12px;
  background-color: var(--ll-mint);
}

.auth-panel-tutor { background-color: var(--ll-peach); }

.auth-panel h2 { margin: 0 0 20px; font-size: 1.3rem; line-height: 1.25; }

.auth-points li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(23, 33, 28, 0.12);
}

.auth-points li:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }

.auth-points .point-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  background-color: #fff;
  color: var(--ll-green);
  font-size: 0.8rem;
  font-weight: 700;
}

.auth-points strong { display: block; color: var(--ll-ink); font-size: 0.98rem; }
.auth-points span { display: block; margin-top: 3px; font-size: 0.9rem; line-height: 1.6; }

.auth-panel-note { margin: 22px 0 0; font-size: 0.85rem; line-height: 1.6; }
.auth-panel .text-link { margin-top: 18px; font-size: 0.9rem; }

/* One flat block behind the panel, the same trick as the marketing pages. */
.auth-flash {
  position: absolute;
  top: -6px;
  right: -18px;
  z-index: 0;
  width: 104px;
  height: 104px;
  border-radius: 10px;
  background-color: var(--ll-yellow);
  transform: rotate(-7deg);
}

/* --------------------------------------------------------------------------
   Verification screens
   -------------------------------------------------------------------------- */

.auth-message { padding-block: 88px 104px; }

.auth-message-inner {
  max-width: 620px;
  margin-inline: auto;
  padding: 52px 44px;
  border: 1px solid var(--ll-line);
  border-radius: 12px;
  background-color: #fff;
  text-align: center;
}

.auth-message-icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  margin: 0 auto 24px;
  border-radius: 12px;
  background-color: var(--ll-mint);
  color: var(--ll-green);
  font-size: 1.4rem;
}

.auth-message-icon.is-warning { background-color: var(--ll-peach); color: #B3261E; }

.auth-message h1 { margin: 0; font-size: clamp(1.6rem, 2.4vw, 2.1rem); }
.auth-message p { max-width: 48ch; margin: 16px auto 0; line-height: 1.75; }
.auth-message .home-button { margin-top: 28px; }
.auth-message .auth-meta { margin-top: 24px; }

/* --------------------------------------------------------------------------
   Staff two-step sign-in
   -------------------------------------------------------------------------- */

.staff-mfa-card { max-width: 560px; margin-inline: auto; }
.staff-mfa-steps { margin: 24px 0 0; padding-left: 20px; line-height: 1.7; }
.staff-mfa-steps li + li { margin-top: 12px; }
.staff-mfa-qr { width: 200px; max-width: 100%; margin: 14px 0 10px; padding: 12px; background: #fff; border: 1px solid var(--ll-line); border-radius: 12px; }
.staff-mfa-qr svg { display: block; width: 100%; height: auto; }
.staff-mfa-manual summary { cursor: pointer; color: var(--ll-green); }
.staff-mfa-secret { display: block; margin-top: 8px; font-size: 1rem; letter-spacing: 0.06em; overflow-wrap: anywhere; }
.staff-mfa-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; }
.staff-mfa-codes code { display: block; padding: 10px 12px; font-size: 1.05rem; letter-spacing: 0.08em; text-align: center; background: var(--ll-cream); border: 1px solid var(--ll-line); border-radius: 10px; color: var(--ll-ink); }
.staff-mfa-subhead { margin: 30px 0 6px; font-size: 1.15rem; }
.staff-mfa-link { padding: 0; border: 0; background: none; color: var(--ll-green); text-decoration: underline; cursor: pointer; font: inherit; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 991px) {
  .auth-shell { padding-block: 44px 64px; }
  .auth-grid { grid-template-columns: minmax(0, 1fr); gap: 34px; max-width: 620px; }

  /* The panel explains what the account is for, so on a narrow screen it
     comes first — before a form the visitor has not yet decided to fill in. */
  .auth-aside { order: -1; padding-top: 0; }
  .auth-card { padding: 32px; }
}

@media (max-width: 767px) {
  .auth-shell { padding-block: 30px 48px; }
  .auth-card { padding: 24px; }
  .auth-row { grid-template-columns: 1fr; }
  .auth-panel { padding: 26px; }
  .auth-flash { width: 76px; height: 76px; top: -12px; right: -10px; }
  .auth-message { padding-block: 48px 64px; }
  .auth-message-inner { padding: 36px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page *,
  .auth-page *::before,
  .auth-page *::after { transition-duration: 0.01ms !important; }
}
