/* ============================================================================
 * Howzit Buddy, the school doors: staff sign-in (auth.php), registering a
 * school and asking for a new code (register-school.php), activating a school
 * (verify-school.php) and making a new code (new-code.php).
 *
 * They wear the front page's look (index.php, assets/landing.css): the petrol
 * wall from the mascot artwork with its lit floor, white rounded cards, the
 * sun-yellow button with its darker lip, Schibsted Grotesk headings, Nunito
 * for reading and Fredoka only for what the characters say. The values are
 * copied here rather than shared, so the front page can change without
 * moving these pages, and these pages never load the app's stylesheet.
 *
 * Phone first. 320px wide upward, no sideways scroll; on a laptop the card
 * sits on the left and a character stands on the floor beside it.
 * ========================================================================== */

:root {
  --wall: #014f76; --wall-glow: #0a6a98; --wall-edge: #013f60; --deep: #072a41;
  --paper: #fff; --mist: #eef6fa; --line: #d7e7ef; --field: #b9d1de;
  --ink: #0a2536; --ink-2: #3f5b6b;
  --sun: #fda002; --sun-hi: #ffb42e; --sun-lt: #ffd366;
  --blue: #0167fe; --blue-t: #0157d6;
  --green: #53bc96; --green-t: #1b7a5a; --green-lt: #7fd6b4;
  --amber-t: #9a5a00;
  --coral: #fc5338; --coral-t: #c8381f;
  --f-head: 'Schibsted Grotesk', 'Segoe UI', system-ui, sans-serif;
  --f-body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --f-voice: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --gutter: 16px;
  --focus: #0157d6;
}
@media (min-width: 700px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.door {
  margin: 0; min-height: 100vh; min-height: 100svh;
  font: 400 16px/1.6 var(--f-body); color: #fff; -webkit-font-smoothing: antialiased;
  overflow-x: hidden; position: relative; isolation: isolate;
  background-color: var(--wall-edge);
  background-image:
    radial-gradient(70% 45% at 50% 30%, rgba(10,106,152,.9) 0%, rgba(10,106,152,0) 70%),
    radial-gradient(130% 100% at 50% 20%, var(--wall) 0%, var(--wall-edge) 60%, var(--deep) 100%);
  background-attachment: fixed;
}
/* The plaster grain of the artwork's wall, as on the front page. */
body.door::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .35; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg, picture { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--f-head); margin: 0; letter-spacing: -0.02em; line-height: 1.12; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* Visible keyboard focus: yellow on the wall, blue inside the white cards. */
:focus-visible { outline: 3px solid var(--sun-lt); outline-offset: 3px; border-radius: 10px; }
.sheet :focus-visible { outline-color: var(--focus); }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--sun); color: var(--ink);
        font-weight: 800; padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }

.door-wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }

/* ------------------------------------------------------------ top bar ---- */
.door-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; padding-top: 8px; }
.door-logo img { width: 150px; height: auto; filter: drop-shadow(0 8px 18px rgba(0,20,35,.35)); }
@media (min-width: 700px) { .door-logo img { width: 190px; } .door-bar { min-height: 92px; } }
.door-bar__links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  font: 700 14px/1 var(--f-head); text-decoration: none; white-space: nowrap; color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.5);
}
.pill:hover { box-shadow: inset 0 0 0 1.5px #fff; background: rgba(255,255,255,.06); }
@media (max-width: 379px) { .pill { padding: 0 11px; font-size: 13px; min-height: 36px; } .door-logo img { width: 124px; } }

/* --------------------------------------------------------------- layout -- */
/* Phone: the character's line, then the card(s). Laptop: card(s) on the left,
   the character standing on the lit floor to the right, staying in view. */
.door-main { padding-top: 8px; padding-bottom: 28px; overflow-x: clip; }
.door-grid { display: grid; gap: 0; }
.door-col { min-width: 0; }
.door-stage { display: none; }
@media (min-width: 1024px) {
  .door-main { padding-top: 18px; }
  .door-grid { grid-template-columns: minmax(0, var(--card-w, 560px)) minmax(0, 1fr); column-gap: 56px; align-items: start; }
  .door-stage { display: flex; justify-content: center; position: sticky; top: 24px; padding-top: 70px; container-type: inline-size; }
}

.door-head { margin: 4px 0 18px; }
.door-head h1 { font-size: clamp(28px, 7.4vw, 44px); font-weight: 800; text-wrap: balance; }
.door-head .lede { margin-top: 10px; font-size: 16px; line-height: 1.55; color: rgba(255,255,255,.92); max-width: 60ch; text-wrap: pretty; }
.door-head .lede strong { color: #fff; font-weight: 800; }
.door-head .lede em { font-style: normal; font-weight: 800; color: var(--green-lt); }
@media (min-width: 700px) { .door-head .lede { font-size: 18px; } }

/* --------------------------------------------------- the character ------ */
/* On a laptop: the cut-out on its own lit floor, with a speech bubble shaped
   like the logo's O, tail pointing at whoever is talking. */
.door-figure { position: relative; height: clamp(360px, calc(100svh - 260px), 520px); aspect-ratio: 657 / 800; }
.door-figure picture, .door-figure img { width: 100%; height: 100%; object-fit: contain; position: relative; z-index: 1; user-select: none; }
.door-figure::before {
  content: ''; position: absolute; left: -30%; right: -30%; bottom: -9%; height: 22%; z-index: 0;
  background: radial-gradient(closest-side, rgba(140,215,255,.42), rgba(126,206,255,.12) 55%, rgba(126,206,255,0) 100%);
}
.door-figure::after {
  content: ''; position: absolute; left: 2%; right: 0; bottom: -2.2%; height: 6%; z-index: 0;
  background: radial-gradient(closest-side, rgba(0,12,22,.62), rgba(0,12,22,0));
}
.bubble {
  position: absolute; z-index: 3; margin: 0;
  font: 500 18px/1.3 var(--f-voice); color: var(--ink); text-align: left; text-wrap: pretty;
  background: #fff; border-radius: 20px; padding: 12px 16px 13px;
  box-shadow: inset 0 -3px 0 rgba(1,79,118,.10);
  filter: drop-shadow(0 12px 16px rgba(0,16,28,.32));
}
.bubble b { font-weight: 600; }
.bubble .greet { color: var(--coral-t); }
.bubble::after { content: ''; position: absolute; width: 18px; height: 16px; background: inherit; }
.from-below::after { left: 24px; bottom: -12px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.door-figure .bubble { left: 44%; bottom: calc(92% + 6px); width: 250px; }
/* A small laptop: the stage column is narrower than a full-height figure, so
   the character is drawn smaller and the bubble stays inside the window. */
@media (min-width: 1024px) and (max-width: 1279px) {
  .door-figure { height: min(400px, calc(100svh - 240px), 112cqw); }
  .door-figure .bubble { left: auto; right: 0; width: 200px; font-size: 16.5px; }
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes pop  { 0% { opacity: 0; transform: translateY(10px) scale(.88); } 70% { opacity: 1; transform: scale(1.03); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .door-figure picture { animation: rise .8s cubic-bezier(.2,.8,.2,1) both; }
  .door-figure .bubble { animation: pop .55s .5s cubic-bezier(.2,.8,.2,1) both; transform-origin: 20% 100%; }
}

/* On a phone: a round window with the character's face and their line. */
.door-moment { display: flex; align-items: center; gap: 14px; margin: 2px 0 16px; }
.face {
  width: 78px; height: 78px; flex: none; border-radius: 50%; overflow: hidden; background: var(--wall);
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--key, var(--sun)), 0 14px 24px -12px rgba(0,16,28,.6);
}
.face img { width: 100%; height: 100%; object-fit: cover; }
.door-moment .bubble { position: relative; font-size: 16px; padding: 10px 14px 11px; filter: none;
                       box-shadow: inset 0 -3px 0 rgba(1,79,118,.10), 0 10px 22px -12px rgba(0,16,28,.5); }
.door-moment .bubble::after { left: -11px; top: calc(50% - 9px); width: 14px; height: 18px; clip-path: polygon(100% 0, 100% 100%, 0 50%); }
@media (max-width: 359px) { .face { width: 64px; height: 64px; } .door-moment .bubble { font-size: 15px; } }
@media (min-width: 1024px) { .door-moment { display: none; } }

/* ---------------------------------------------------------------- cards -- */
.sheet {
  background: var(--paper); color: var(--ink); border-radius: 24px; padding: 22px 18px 24px;
  box-shadow: 0 30px 60px -30px rgba(0,16,28,.75), inset 0 -4px 0 rgba(1,79,118,.08);
}
.sheet + .sheet { margin-top: 16px; }
@media (min-width: 480px) { .sheet { padding: 26px 26px 28px; } }
@media (min-width: 1024px) { .sheet { padding: 32px 34px 34px; border-radius: 28px; } }
.sheet h1, .sheet h2 { color: var(--ink); }
.sheet h1 { font-size: clamp(24px, 6vw, 32px); font-weight: 800; }
.sheet h2 { font-size: clamp(21px, 5vw, 26px); font-weight: 800; }
.sheet .intro { margin-top: 8px; font-size: 16px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.sheet .intro strong { color: var(--ink); }
.sheet a { color: var(--blue-t); font-weight: 800; text-underline-offset: 3px; }
.sheet a:hover { color: var(--ink); }
.sheet--center { text-align: center; }
.muted { color: var(--ink-2); }
.small { font-size: 14.5px; line-height: 1.55; }
.mt { margin-top: 14px; }

/* Section labels inside a card, in a letter colour of the logo. */
.kicker { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font: 800 12.5px/1.35 var(--f-body);
          letter-spacing: .14em; text-transform: uppercase; color: var(--key-t, var(--blue-t)); }
.kicker::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--key, var(--blue)); flex: none; }
.kicker + .intro { margin-top: -4px; }
.kicker--later { margin-top: 26px; }
.key-blue  { --key: var(--blue);  --key-t: var(--blue-t); }
.key-green { --key: var(--green); --key-t: var(--green-t); }
.key-amber { --key: var(--sun);   --key-t: var(--amber-t); }
.key-coral { --key: var(--coral); --key-t: var(--coral-t); }

/* ---------------------------------------------------------------- forms -- */
.field { margin-bottom: 14px; min-width: 0; }
.field-lbl { display: block; font: 700 15px/1.3 var(--f-head); color: var(--ink); margin: 0 0 6px; }
.input {
  display: block; width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 14px;
  background: #fff; color: var(--ink); font-size: 16px; font-weight: 600;
  border: 2px solid var(--field); box-shadow: inset 0 2px 0 rgba(1,79,118,.05);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: #7d97a6; font-weight: 600; opacity: 1; }
.input:hover { border-color: #8fb4c7; }
.input:focus { outline: none; border-color: var(--blue-t); box-shadow: 0 0 0 4px rgba(1,87,214,.18); }
.input[aria-invalid="true"] { border-color: var(--coral-t); }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a2536' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
.input--code { text-align: center; letter-spacing: 3px; font: 700 20px/1.2 var(--f-head); text-transform: uppercase; }
.input--code::placeholder { letter-spacing: 3px; }
.field-hint { font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 6px 0 0; line-height: 1.5; }
.field-err { color: var(--coral-t); font-size: 14px; font-weight: 800; line-height: 1.5; margin: 6px 0 0; }
.field-err:empty { display: none; }
.field-err:not(:empty) + .field-hint { display: none; }
@media (min-width: 700px) {
  .form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .form-2col .full { grid-column: 1 / -1; }
}

/* A checkbox with its sentence: the whole row is the label, so the sentence
   is something to tap too. */
.check {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 14px 16px; border-radius: 16px; background: var(--mist); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 15px; line-height: 1.5; color: var(--ink);
}
.check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--green-t); cursor: pointer; }
.check:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.check strong { font-weight: 800; }
.check--amber { background: #fff6e3; box-shadow: inset 0 0 0 1px #f5d9a0; }

/* -------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-align: center;
  min-height: 56px; padding: 10px 22px; border-radius: 14px; border: 0; cursor: pointer;
  font: 700 17px/1.2 var(--f-head); letter-spacing: -0.01em; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn[disabled] { opacity: .7; cursor: progress; transform: none; }
.btn--block { display: flex; width: 100%; }
.btn--sun {
  background: var(--sun); color: var(--ink);
  box-shadow: inset 0 -4px 0 rgba(120,60,0,.28), 0 14px 30px -12px rgba(253,160,2,.65);
}
.btn--sun:hover:not([disabled]) { background: var(--sun-hi); transform: translateY(-2px); }
.btn--sun:active { transform: translateY(1px); box-shadow: inset 0 -2px 0 rgba(120,60,0,.28); }
.btn--green { background: var(--green-lt); color: var(--ink); box-shadow: inset 0 -4px 0 rgba(0,70,45,.22), 0 14px 30px -14px rgba(83,188,150,.7); }
.btn--green:hover:not([disabled]) { background: #a3e6cc; transform: translateY(-2px); }
.btn--line { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--field); }
.btn--line:hover { box-shadow: inset 0 0 0 2px var(--ink-2); }
.btn--sm { min-height: 44px; padding: 8px 16px; font-size: 15px; }
.sheet a.btn { color: var(--ink); }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.form-err { color: var(--coral-t); font-weight: 800; font-size: 15px; line-height: 1.5; margin: 10px 0 0; }
.form-err:empty { display: none; }
.form-err.form-ok { color: var(--green-t); }
.form-ok:not(:empty) { padding: 12px 14px; border-radius: 14px; background: #e3f5ee; }

.links-row { margin-top: 16px; font-size: 15px; font-weight: 700; text-align: center; }

/* The honeypot: off screen, out of the tab order, hidden from screen
   readers and ignored by password managers. People never fill it in. */
.hb-trap { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------- "not on it yet?" ---- */
/* Bigger than the small print, in a card of its own: the way in for a school
   that landed on the sign-in page first. */
.door-new {
  margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px;
  padding: 20px 20px 22px; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, rgba(83,188,150,.24), rgba(83,188,150,.10));
  box-shadow: inset 0 0 0 2px rgba(127,214,180,.6), 0 20px 40px -30px rgba(0,16,28,.8);
}
.door-new__q { font: 800 21px/1.2 var(--f-head); letter-spacing: -0.015em; }
.door-new__free { display: block; margin-top: 4px; font: 700 16px/1.3 var(--f-body); color: var(--green-lt); }
.door-new .btn { flex: 1 1 220px; max-width: 100%; }
@media (min-width: 700px) { .door-new { padding: 22px 26px 24px; } .door-new__q { font-size: 23px; } .door-new .btn { flex: 0 0 auto; } }

/* ------------------------------------------------------- how it works --- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; }
.steps .num {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font: 700 19px/1 var(--f-voice); color: #fff; background: var(--c, var(--blue));
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18);
}
.steps li:nth-child(1) { --c: var(--blue); }
.steps li:nth-child(2) { --c: var(--coral); }
.steps li:nth-child(3) { --c: var(--green-t); }
.steps li:nth-child(4) { --c: var(--amber-t); }
.steps h3 { font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1.25; margin-top: 8px; }
.steps p { margin-top: 4px; font-size: 15px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.steps p strong { color: var(--ink); }
.steps .tip { margin-top: 8px; font-size: 14px; padding: 8px 12px; border-radius: 12px; background: var(--mist); }

/* -------------------------------------------- notes inside a card ------- */
.note { margin-top: 14px; padding: 14px 16px; border-radius: 16px; text-align: left; font-size: 15px; line-height: 1.55; }
.note--sun   { background: #fff6e3; box-shadow: inset 4px 0 0 var(--sun); }
.note--coral { background: #ffece8; box-shadow: inset 4px 0 0 var(--coral); }
.note--blue  { background: #e8f1ff; box-shadow: inset 4px 0 0 var(--blue); }
.note strong { color: var(--ink); }
.note ul { margin: 6px 0 0; padding-left: 20px; }

/* The one screen that shows an access code. On a phone the code stays on one
   line: a code split in two gets copied down wrong. */
.code-box { margin: 18px 0; padding: 22px 16px; border-radius: 20px; text-align: center;
            background: var(--mist); border: 2px dashed var(--green-t); }
.code-lbl { font: 800 12.5px/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.code-value { margin-top: 10px; font: 700 clamp(22px, 7.4vw, 40px)/1.15 var(--f-head); letter-spacing: 3px; color: var(--ink); white-space: nowrap; }
.big-ic { font-size: 46px; line-height: 1; }

.done-steps { list-style: none; padding: 0; margin: 16px auto 4px; max-width: 420px; text-align: left; }
.done-steps li { display: flex; gap: 12px; align-items: center; font-weight: 700; line-height: 1.5; margin: 0 0 10px; }
.done-steps b { flex: 0 0 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
                background: var(--sun); color: var(--ink); font: 700 16px/1 var(--f-voice); }

/* ------------------------------------------------------------- footer ---- */
.door-foot { padding: 6px 0 40px; text-align: center; font-size: 14.5px; line-height: 1.6; color: rgba(255,255,255,.86); }
.door-foot a { color: #fff; font-weight: 800; text-underline-offset: 3px; }
.door-foot .home { display: inline-block; margin-top: 10px; color: rgba(255,255,255,.75); font-weight: 700; }
.door-foot .home:hover { color: #fff; }
.on-wall { margin-top: 16px; text-align: center; font-size: 15px; font-weight: 700; color: rgba(255,255,255,.9); }
.on-wall a { color: #fff; font-weight: 800; text-underline-offset: 3px; }
.say { font-weight: 800; color: var(--coral-t); }
