/*
  The two login pages (2026-09-25; moved out of fastmath.css). One card: a
  chalkboard panel with the brand's voice on the left, the form on the right.
  Student and Teacher are tabs across the top of the form, but each tab is its
  own page, so each keeps its own role check.
*/

.auth-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 150px);
}

/* The card and the student standing on its top edge, over the board. */
.auth-stage {
  position: relative;
  width: min(1000px, 100%);
}

.auth-cast {
  left: 44px;
}

.auth-card {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  width: 100%;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 26px;
  /* The board's colour, under a paper form column: no light seam in the board's rounded corners. */
  background: #1f1d18;
  box-shadow: 0 10px 0 var(--ink);
}

/* The chalkboard, as on the landing page. Decoration only. */
.auth-board {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 40px;
  border-right: 3px solid var(--ink);
  background: #1f1d18;
  color: var(--cream);
}

.auth-board-tag {
  font-family: "Bungee", var(--font-label);
  font-size: 0.75rem;
  color: var(--yellow);
}

.auth-board-sums {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: var(--font-hand);
  font-size: 1.8rem;
  line-height: 1.2;
  color: rgba(255, 246, 218, 0.55);
}

.auth-board-big {
  font-size: 3.2rem;
  line-height: 1;
  color: var(--yellow);
}

/* The landing page's answer box (2026-10-30): square, chalk-edged, with Kalam's
   "?" nudged to its optical centre (landing.css measures the nudge). */
.auth-board-gap {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  margin: 0 0.16em;
  border: 3px dashed var(--chalk);
  border-radius: 10px;
  line-height: 1;
  vertical-align: -0.2em;
}

.auth-board-gap-mark {
  display: block;
  line-height: 1;
  transform: translate(-0.071em, 0.15em);
}

.auth-board p {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  line-height: 1.35;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 40px 48px;
  background: var(--paper);
}

.auth-form h1 {
  margin: 4px 0 0;
  font-size: clamp(2.5rem, 3.6vw, 3.4rem);
  line-height: 1;
}

.auth-lede {
  margin: -6px 0 0;
  color: var(--ink-soft);
  font-size: 1.06rem;
  line-height: 1.5;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-weight: 600;
  font-size: 0.95rem;
}

.field input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  font-family: inherit;
  font-size: 1.06rem;
  font-weight: 500;
  color: var(--ink);
}

.field input:focus {
  outline: none;
  border-width: 3px;
  box-shadow: 0 0 0 4px var(--yellow-soft);
}

/* Password visibility toggle (2026-08-21) — the button sits inside the field,
   right-aligned, over the input's own padding. */
.password-field {
  position: relative;
}

.password-field input {
  padding-right: 84px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  min-height: 40px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--yellow-soft);
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  cursor: pointer;
}

.password-toggle:hover {
  background: var(--yellow);
}

/* Full width, but otherwise the same tile as every other button. */
.auth-submit {
  width: 100%;
  min-height: 56px;
  margin-top: 4px;
  font-size: 0.95rem;
  cursor: pointer;
}

/* An ink-bordered box that says what to do next, not a pale pink band. */
.auth-error {
  display: none;
  margin: 0;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--danger);
  font-weight: 600;
  line-height: 1.4;
}

.auth-error.visible {
  display: block;
}

.auth-help {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}

.auth-help a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 860px) {
  .auth-shell {
    min-height: 0;
  }

  .auth-card {
    grid-template-columns: 1fr;
  }

  /* On a narrow screen the board would push the form below the fold; the form
     is the job, so the board goes. */
  .auth-board {
    display: none;
  }
}

/* style.css stacks .site-header on narrow screens for the landing page's
   longer nav; here there is one link, so it stays on the brand's row. */
@media (max-width: 860px) {
  .site-header {
    flex-direction: row;
    align-items: center;
    margin-bottom: 24px;
  }
}
