/* ============================================================================
   The way in — sign in, the emailed code, request an account, request sent.

   FOUR SCREENS, ONE PAGE, NO APP CHROME. These are their own page: no panel,
   no breadcrumb, no bottom bar. A parent meets them before they have an
   account, so the shell would be furniture for a room they cannot enter yet.

   Only the CARD GRAMMAR changed from the pre-redesign screens, and in two
   ways: 18px corners and the shell shadow instead of a hairline border, and
   50px controls instead of 44. Everything else is the same screen.

   ⚠️ Colours come from tokens, including the warm gradient and the two soft
   discs behind the card: --hero-warm, --surface-warm and --callout-warm are
   the canvas's #FFFBEF / #FAF9F5 / #FFF7DB, already in tokens.css. No hex
   entered the system for this page.

   ⚠️ 50px controls are ABOVE the 44px touch minimum (DESIGN.md § 9), not a
   restatement of it. This is a phone-first screen for an audience that is
   mostly on phones, often one-handed, often in a hurry at a school gate.
   ========================================================================= */

.pe {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}
.pe *, .pe *::before, .pe *::after { box-sizing: border-box; }
.pe [hidden] { display: none !important; }
.pe button { font-family: inherit; }

.pe-stage {
  min-height: 100vh;
  background: linear-gradient(160deg,
              var(--hero-warm) 0%,
              var(--surface-warm) 55%,
              var(--callout-warm) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  position: relative;
  overflow: hidden;
}
/* Decorative only, and aria-hidden in the markup: they carry no meaning and a
   screen reader announcing two empty circles is noise before a sign-in. */
.pe-disc {
  position: absolute;
  border-radius: var(--radius-full);
  background: var(--brand-yellow);
  pointer-events: none;
}
.pe-disc-a { top: -60px; right: -60px; width: 190px; height: 190px; opacity: 0.16; }
.pe-disc-b { bottom: -80px; left: -50px; width: 210px; height: 210px; opacity: 0.10; }

.pe-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 358px;
  background: var(--surface-default);
  border-radius: var(--shell-radius);
  box-shadow: var(--shadow-lg);
  padding: 26px 20px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* The real wordmark, the same file login.html serves and at the same 190px —
   these four cards are the same front door for a different audience, so a
   parent who reaches them from a school link should not meet a different mark.
   No rail state here: the entry screens never collapse. */
.pe-wordmark {
  width: 190px;
  height: auto;
  margin: 2px auto 10px;
  display: block;
}

.pe-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}
.pe-lede {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.pe-field { text-align: left; }
.pe-row { display: flex; gap: 10px; }
.pe-row > * { flex: 1; min-width: 0; }
.pe-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 5px;
}
.pe-input {
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--surface-default);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}
.pe-input:focus-visible {
  outline: 2px solid var(--brand-yellow);
  outline-offset: 0;
  box-shadow: var(--shadow-focus);
  border-color: var(--ink);
}

.pe-btn {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.pe-btn-primary {
  background: var(--brand-yellow);
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(252, 200, 1, 0.35);
}
.pe-btn-secondary {
  background: var(--surface-default);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  font-weight: 500;
}
.pe-btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.pe-btn:focus-visible {
  outline: 2px solid var(--brand-yellow);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

/* The six code boxes. A single input under the hood — see parent-entry.js for
   why — with these drawn as its visible stand-in. */
.pe-code {
  display: flex;
  gap: 7px;
  position: relative;
}
.pe-code-box {
  flex: 1;
  height: 52px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--surface-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}
.pe-code-box.is-filled { border-color: var(--ink); }
/* The real field, stretched over the boxes and invisible, so one tap opens the
   numeric keypad and the browser's own SMS/autofill still works. */
.pe-code-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  font-size: 16px;      /* 16px or iOS Safari zooms the page on focus */
  letter-spacing: 2em;
  background: transparent;
}
.pe-code-input:focus-visible + .pe-code-boxes .pe-code-box:first-child,
.pe-code:focus-within .pe-code-box.is-next {
  outline: 2px solid var(--brand-yellow);
  outline-offset: 1px;
}

.pe-note {
  margin-top: 4px;
  padding: 12px 13px;
  background: var(--surface-subtle);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: left;
}
.pe-note strong { color: var(--ink); }

/* An error a parent can act on. Never used to say whether an address is known
   — that is the one thing these screens must not disclose. */
.pe-error {
  display: flex;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  font-size: 12px;
  line-height: 1.55;
  text-align: left;
}

.pe-tick {
  align-self: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--callout-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0;
  color: var(--warning);
}

@media (prefers-reduced-motion: reduce) {
  .pe * { transition: none !important; }
}
