/*
 * The plain pages (sign in, the sign-in link's button, Payment received, Your
 * devices, a guide that didn't open, the site's own not-found page, and the
 * pages src/lib/cat-pages.ts's plainHtml() writes: "Something went wrong", "We
 * could not find that test" and the rest): what they need on top of the
 * student area's own stylesheet, lab.css, which each of them loads first (its
 * fonts, colours, dark mode, .card, .sr). Every colour here is one of its
 * tokens, so the pages follow the area's light and dark looks (payments day
 * dress rehearsal, 5 Nov 2026). Every rule starts at .plain, so it wins over
 * lab.css's single-class and bare-element rules whichever loads first.
 *
 * One file in public/ (it was src/app/globals.css until R89, 21 Nov 2026), so
 * the root layout and plainHtml()'s whole documents link the same rules.
 */

/* ---------- the brand bar and the page column ---------- */
/* the bar: the sign-in pages' floating pill (W2, welcome.css), not a dark band (owner's walkthrough, W27) */
.plain {
  --pp-bar: rgba(255, 255, 255, .62); --pp-bar-solid: rgba(255, 255, 255, .92);
  --pp-ring: rgba(255, 255, 255, .7); --pp-shadow: 0 10px 30px -14px rgba(22, 17, 47, .25);
  --pp-day: block; --pp-night: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .plain {
    --pp-bar: rgba(16, 10, 42, .55); --pp-bar-solid: rgba(16, 10, 42, .92);
    --pp-ring: rgba(255, 255, 255, .12); --pp-shadow: 0 10px 30px -14px rgba(0, 0, 0, .5);
    --pp-day: none; --pp-night: block;
  }
}
:root[data-theme="dark"] .plain {
  --pp-bar: rgba(16, 10, 42, .55); --pp-bar-solid: rgba(16, 10, 42, .92);
  --pp-ring: rgba(255, 255, 255, .12); --pp-shadow: 0 10px 30px -14px rgba(0, 0, 0, .5);
  --pp-day: none; --pp-night: block;
}
.plain-bar {
  position: sticky; top: 14px; z-index: 20;
  width: min(1200px, 100% - 32px);
  margin: 14px auto 0;
}
.plain-pill {
  display: flex; align-items: center;
  min-height: 62px; padding: 12px 24px; border-radius: 999px;
  background: var(--pp-bar);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: inset 0 0 0 1px var(--pp-ring), var(--pp-shadow);
}
.plain-pill img { height: 26px; width: auto; }
/* the logo goes home to Today (R89); signed out, Today sends a visitor to sign in */
.plain-pill .pp-home { display: inline-flex; align-items: center; border-radius: 10px; }
.plain-pill .pp-home:focus-visible { outline: 2px solid var(--act); outline-offset: 4px; }
.plain-pill .pp-day { display: var(--pp-day); }
.plain-pill .pp-night { display: var(--pp-night); }
@media (max-width: 960px) {
  .plain-pill { min-height: 56px; padding: 8px 18px; background: var(--pp-bar-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .plain-pill img { height: 22px; }
}
@media (max-width: 639.98px) {
  .plain-bar { top: 12px; width: calc(100% - 24px); margin-top: 12px; }
}
@media (max-width: 420px) { .plain-pill img { height: 20px; } }

.plain .plain-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  outline: none;
}

@media (min-width: 1024px) {
  .plain .plain-page { padding-top: 48px; }
}

/* ---------- words ---------- */
.plain h1 { font-size: 1.75rem; font-weight: 800; line-height: 1.15; margin: 0 0 16px; }
.plain h2 { font-size: 1.25rem; font-weight: 800; line-height: 1.2; margin: 24px 0 8px; }
.plain p { margin: 8px 0; }
.plain strong { font-family: var(--font-head); font-weight: 700; }

.plain .muted { color: var(--muted); font-size: .9375rem; }
.plain .ok { color: var(--good-deep); font-weight: 600; }
.plain .bad { color: var(--bad-deep); font-weight: 600; }
.plain .warn { color: var(--warn-deep); }

/* the links along the top of a page (Today, Account) */
.plain nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.plain nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .875rem;
  color: var(--act-deep);
  text-decoration: none;
  background: var(--act-tint);
}
.plain nav a:hover { text-decoration: underline; }

/* ---------- cards ---------- */
.plain .card { margin: 12px 0; padding: 20px; }
.plain .card > :first-child { margin-top: 0; }
.plain .card > :last-child { margin-bottom: 0; }
.plain .card.warn {
  color: var(--ink);
  background: var(--warn-tint);
  border-color: color-mix(in oklab, var(--warn) 35%, transparent);
  box-shadow: none;
}
.plain .card.warn .muted { color: var(--ink-2); }

/* ---------- forms: the area's fields and buttons ---------- */
.plain label {
  display: block;
  margin: 0 0 6px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .9375rem;
  color: var(--ink);
}

.plain input, .plain select, .plain textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.0625rem;           /* 17px: a phone does not zoom in on a field of 16px or more */
}
.plain input::placeholder { color: var(--muted); }
.plain input:focus-visible, .plain select:focus-visible, .plain textarea:focus-visible {
  outline: 2px solid var(--act);
  outline-offset: 1px;
  border-color: var(--act);
}

.plain button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .9375rem;
  transition: transform .15s var(--out), background .2s, border-color .2s;
}
.plain button:hover { border-color: var(--act); }
.plain button:active { transform: scale(.97); }
.plain button.primary {
  min-height: 48px;
  background: var(--act-fill);
  border-color: var(--act-fill);
  color: var(--act-ink);
  box-shadow: var(--btn-shadow);
}
.plain button.primary:hover { background: var(--act-fill-hover); border-color: var(--act-fill-hover); }
.plain button:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.plain button:focus-visible, .plain a:focus-visible { outline: 2px solid var(--act); outline-offset: 2px; }

/* a form's main button fills a phone's width */
@media (max-width: 639.98px) {
  .plain form button { width: 100%; }
}

/* the robot check's frame, when Cloudflare shows one */
.plain [data-robot-check] { margin: 12px 0 0; }
.plain [data-robot-check]:empty { margin: 0; }

.plain .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }

/* ---------- old developer pages (unreachable since the paid area words audit, M4; kept for when videos return) ---------- */
.plain .card p.ask { padding-left: 1.35em; text-indent: -1.35em; }
.plain .card p.ask::before { content: "\27A4"; display: inline-block; width: 1.35em; text-indent: 0; color: var(--muted); font-size: .9em; }
.plain pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
  font-size: 12px;
  max-height: 340px;
}
.plain table { border-collapse: collapse; width: 100%; font-size: .875rem; }
.plain th, .plain td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
