/* The house style, for the pages that are served as files.
 *
 * The manager and the TV are each one self-contained document and carry their
 * own copy of this; these pages are static, there are several of them, and
 * they are the first thing anybody sees, so they share a stylesheet instead.
 * The tokens are the manager's, value for value, on purpose — two sign-in
 * screens that are nearly the same gold as the rest of the site look like a
 * mistake, and the only way to be sure they are not is to not have a second
 * set of numbers.
 */

:root {
  --accent: #C9A96A;
  --accent-light: #D9BE85;
  --accent-dark: #B08F52;
  --on-accent: #000000;

  --bg: #0A0B0D;
  --surface: #16171B;
  --surface-hi: #1E2026;
  --text: #F5F4F1;
  --text-2: #9A968E;
  --text-3: #7D7A73;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.14);

  --destructive: #FF6961;

  --r-xs: 6px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-full: 999px;
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* The heavy face the television page sets its name and its headings in
     (#logo and the v2 skin in views/tv/index.html). --serif stays defined
     for anything that still asks for it; the doors stopped asking. */
  --display: "SF Pro Display", -apple-system, "Segoe UI Variable Display", "Helvetica Neue", Inter, system-ui, sans-serif;

  --shadow-card: 0 24px 60px rgba(0, 0, 0, .55);
  --shadow-lift: 0 10px 30px rgba(0, 0, 0, .40);

  /* One duration for the small state changes below — a hover, a border
     lighting up. Named so it reads as "the standard speed" rather than as a
     number that happens to match its neighbours; every place that used to
     spell out .15s ease now points here instead, value for value. */
  --transition-fast: .15s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Said once for every door: native scrollbars, form controls and the
 * autofill menu draw dark instead of flashing a white one, and a tap on a
 * button is not delayed waiting to see whether it is a double-tap zoom or
 * lit with the browser's grey highlight on top of our own pressed state. */
:root { color-scheme: dark; }
.btn, .linkish, .field { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* An author rule like `.btn { display: flex }` beats the browser's own
 * `[hidden] { display: none }`, so every hidden button stayed on screen. Said
 * once here rather than guarded at each place something is shown or hidden. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px max(20px, env(safe-area-inset-left)) calc(24px + env(safe-area-inset-bottom));
  position: relative;
  overflow-x: hidden;
}

/* The light that everything else sits under. Two layers: a warm bloom from
 * above, and a cool floor that keeps the bottom of a tall page from going
 * flat black. Fixed, so scrolling a long page does not drag it along. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 82vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(112% 74% at 50% -6%, rgba(201, 169, 106, .34) 0%, rgba(201, 169, 106, .09) 42%, transparent 72%),
    linear-gradient(180deg, rgba(176, 143, 82, .14), transparent 62%);
}
body::after {
  content: "";
  position: fixed;
  inset: auto 0 0 0;
  height: 40vh;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(0deg, rgba(30, 32, 38, .38), transparent 100%);
}

/* ---------- the sheet everything is written on ---------- */

.sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.sheet.wide { max-width: 820px; }

.card {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: 34px 30px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}
/* color-mix and backdrop-filter are both recent; without them the card is a
 * plain solid surface, which is the same design one layer flatter. */
@supports not (backdrop-filter: blur(1px)) {
  .card { background: var(--surface); }
}
/* A hairline of the accent along the top edge, the same touch the manager's
 * own cards carry (app/manager/console.css's .card::before) — two pixels of
 * colour that stop a dark rounded rectangle reading as a plain box, on the
 * one screen a stranger sees before anything else on the site. */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    color-mix(in srgb, var(--accent) 55%, transparent) 22%,
    color-mix(in srgb, var(--accent) 20%, transparent) 60%,
    transparent);
}
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .card::before { display: none; }
}

/* ---------- the signature ---------- */

/* One heavy uppercase word with CAST in the accent — the mark the television
 * page has carried since its 2026 skin. The doors set it in an italic serif
 * until then, so the name changed typeface between the sign-in screen and the
 * page it opened onto. The capitals are drawn here; the text is "AutoCastNow". */
.mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 25px;
  line-height: 1;
  letter-spacing: -.022em;
  text-transform: uppercase;
  white-space: nowrap;
  font-variant-ligatures: none;
}
.mark b { font-weight: inherit; color: var(--accent); }
.rule {
  width: 40px;
  height: 1.5px;
  background: var(--accent);
  margin: 20px auto 22px;
  border-radius: 2px;
}

/* The headings follow the mark into the interface face, at the weight and
 * tracking the television page gives its own ("Nothing on the shelves yet",
 * the title over a film being found), so a door and the room behind it read
 * as one product. */
h1 {
  font-family: var(--display);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin-bottom: 10px;
  text-wrap: balance;
}
.lede {
  text-wrap: pretty;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 34ch;
  margin: 0 auto;
}
.sheet.wide .lede { max-width: 52ch; }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--text-3);
}

/* ---------- things to press ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  padding: 14px 22px;
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: .1px;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  cursor: pointer;
  text-decoration: none;
  transition: filter var(--transition-fast), transform .12s ease, border-color var(--transition-fast), background var(--transition-fast);
}
.btn:active { transform: scale(.985); filter: brightness(.96); }
/* A finger has no hover: on a phone the last button touched kept its lifted
 * look until the next tap. Hover is only drawn where a pointer can hover. */
@media (hover: hover) {
  .btn:hover { filter: brightness(1.07); }
}
/* Disabled and busy are the same state on every button in this house — the
 * only time a button here is unusable is while something is in flight — so a
 * quiet pulse stands in for a spinner without a second element to lay out
 * around the icon and the label. */
.btn:disabled {
  opacity: .5;
  cursor: default;
  filter: none;
  transform: none;
  animation: btnBusy 1.3s ease-in-out infinite;
}
.btn svg { width: 19px; height: 19px; flex: none; }

.btn.google { background: #FFFFFF; color: #1F1F1F; box-shadow: var(--shadow-lift); }
.btn.google:active { box-shadow: var(--shadow-lift); }
@media (hover: hover) {
  .btn.google:hover { box-shadow: 0 14px 34px rgba(0, 0, 0, .45); }
}
.btn.accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.accent:active { background: var(--accent-dark); border-color: var(--accent-dark); }
@media (hover: hover) {
  .btn.accent:hover {
    box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 35%, transparent);
  }
}
.btn.quiet {
  background: transparent;
  color: var(--text);
  border-color: var(--hairline-strong);
}
/* A border lighting up on its own reads as the background reacting rather
   than the control — the background is what a thumb or a cursor is actually
   over. Kept faint enough that `.btn.accent` beside it still reads as the
   one that is filled. */
.btn.quiet:active { border-color: var(--accent); background: rgba(255, 255, 255, .07); filter: none; }
@media (hover: hover) {
  .btn.quiet:hover { border-color: var(--accent); background: rgba(255, 255, 255, .04); filter: none; }
}

@keyframes btnBusy { 0%, 100% { opacity: .5; } 50% { opacity: .74; } }

/* A keyboard has to be able to see where it is. The ring is the accent so it
 * reads as part of the design rather than as the browser's default outline. */
.btn:focus-visible,
.linkish:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.linkish {
  display: inline-block;
  background: none;
  border: 0;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 12px 8px;
  margin-top: 10px;
  min-height: 44px;
  border-radius: var(--r-xs);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--hairline-strong);
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}
.linkish:active { color: var(--text); text-decoration-color: var(--accent); }
@media (hover: hover) {
  .linkish:hover { color: var(--text); text-decoration-color: var(--accent); }
}

/* ---------- fields ---------- */

.field {
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  padding: 14px 20px;
  font: inherit;
  font-size: 16px;          /* below 16px and iOS zooms the page on focus */
  text-align: center;
  color: var(--text);
  background: var(--surface-hi);
  border: 1px solid var(--hairline);
  border-radius: var(--r-full);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.field::placeholder { color: var(--text-3); }
.field:hover { border-color: var(--hairline-strong); }
/* Browsers paint an autofilled field pale yellow, which on this ground is a
 * white-ish slab in the middle of a dark card. Held on the field's own
 * surface with an inset shadow, the only property autofill does not override. */
.field:-webkit-autofill,
.field:-webkit-autofill:hover,
.field:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px var(--surface-hi) inset;
  transition: background-color 9999s ease-out 0s;
}
.field[aria-invalid="true"] {
  border-color: color-mix(in srgb, var(--destructive) 60%, transparent);
}
.field[aria-invalid="true"]:focus {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 18%, transparent);
}
.field:disabled { opacity: .55; cursor: default; }
.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
/* `.field:focus` above beats the shared `input:focus-visible` rule on
   specificity (two classes vs. one element + pseudo), so a field tabbed
   into lost the ring every other control gets and fell back to the
   border-colour change alone — a weaker cue, and the only one a field had.
   Same specificity as the rule above and declared after it, so this wins
   for a keyboard focus without disturbing what a mouse click does. */
.field:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- small pieces ---------- */

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 16px;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}
.divider span {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-3);
}

.msg {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--destructive);
}
/* Empty, it should hold a line's worth of space so nothing jumps when a
   message appears — but not the gap it was leaving when it held none. */
.msg:empty { margin-top: 0; height: 10px; }
.msg.ok { color: var(--text-2); }
/* A line of text sitting directly on the card reads as an afterthought; a
 * quiet pill around it reads as a status the page is reporting on purpose.
 * Only once there is something to say — an empty message stays the plain
 * spacer above, or a page with nothing wrong would open on a boxed-in blank. */
.msg:not(:empty) {
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--destructive) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--destructive) 24%, transparent);
}
.msg.ok:not(:empty) {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .msg:not(:empty) { padding: 0; background: none; border: 0; }
}

.msg:not(:empty) { animation: msgIn .22s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes msgIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

.fine {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-3);
  margin-top: 14px;
}

/* Who is signed in, as a row you can read at a glance. */
.identity {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--surface-hi);
  border: 1px solid var(--hairline);
}
.identity img {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--hairline);
  object-fit: cover;
}
.identity .name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.identity > div { min-width: 0; }
.identity .mail {
  font-size: 12.5px; color: var(--text-3); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* The pairing code, which somebody has to read off a screen and type. */
.codewell {
  margin-top: 18px;
  padding: 16px 18px 18px;
  border-radius: var(--r-lg);
  background: var(--surface-hi);
  border: 1px solid var(--hairline);
}
.code {
  font-family: var(--mono);
  font-size: clamp(28px, 8vw, 36px);
  font-weight: 600;
  letter-spacing: .22em;
  text-indent: .22em;        /* letter-spacing pads the right; put it back */
  color: var(--accent);
  margin-top: 8px;
  line-height: 1.2;
}
/* Typed rather than read off a screen. It has to look like somewhere a code
   goes: as a borderless line of dots it read as decoration, and nobody tapped
   it. */
input.code {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  text-align: center;
  text-transform: uppercase;
  caret-color: var(--accent);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
input.code:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
input.code:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input.code::placeholder { color: var(--text-3); }

/* The QR square. White ground and a dark code, because that is the way round
 * every scanner expects and half of them will not invert. */
.qr {
  width: 100%;
  max-width: 232px;
  aspect-ratio: 1;
  flex: none;
  margin: 0 auto;
  padding: 12px;
  background: #FFFFFF;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.qr svg { display: block; width: 100%; height: 100%; }
/* aspect-ratio is recent enough to want a floor under it. */
@supports not (aspect-ratio: 1) {
  .qr { height: 232px; }
}

/* Numbered steps beside the square. */
.steps { text-align: left; }
.step {
  display: flex;
  align-items: baseline;
  gap: 11px;
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 8px;
}
.step b {
  flex: none;
  width: 22px; height: 22px;
  line-height: 20px;
  border-radius: 50%;
  background: var(--surface-hi);
  border: 1px solid var(--hairline);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--text-3);
  align-self: flex-start;
}
.where {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
  margin: 2px 0 18px 33px;
}

/* ---------- arriving ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.card, .sheet > .mark, .sheet > .rule { animation: rise .42s cubic-bezier(.2, .7, .3, 1) both; }
.sheet > .rule { animation-delay: .04s; }
.card { animation-delay: .07s; }

/* A short phone, or a television reporting a small viewport: the card keeps
 * its air but stops spending a quarter of the screen on padding. */
@media (max-width: 380px) {
  .card { padding: 28px 22px; border-radius: var(--r-lg); }
  .mark { font-size: 22px; }
  h1 { font-size: 22px; }
}
@media (max-height: 520px) {
  body { align-items: flex-start; }
  .rule { margin: 14px auto 16px; }
}

@media (forced-colors: active) {
  .btn, .field, .card { border: 1px solid CanvasText; }
  .btn.accent { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .btn:active { transform: none; }
}
