/* Sign-in and activate screens (TV QR and code; desk and phone password, or a code for another
   device). ES5-era CSS only: flex is the newest layout used, and the TV (Chromium 53) never
   takes the desk split. */

.login-tv {
  margin: 24px auto 0;
  max-width: 1400px;
  text-align: left;
}

.login-card {
  display: block;
  overflow: hidden;
  padding: 24px 32px;
  border: 2px solid var(--sky-plum);
  background: var(--sky-top);
}

.login-card .qr {
  float: left;
  width: 280px;
  height: 280px;
  background: var(--ink);
}

.login-card .qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.login-card .txt {
  margin-left: 320px;
  padding-top: 24px;
}

.login-card .pin-label {
  margin: 0;
  font-size: 28px;
  color: var(--ink-muted);
  font-family: var(--font-terminal);
}

.login-card .pin {
  margin: 8px 0 16px;
  font-size: 72px;
  line-height: 1;
  color: var(--marquee);
  letter-spacing: 0.08em;
  font-family: var(--font-terminal);
}

.login-card .host {
  margin: 0;
  font-size: 28px;
  color: var(--ink-muted);
  font-family: var(--font-terminal);
}

.login-tv + .btns,
#login-btns {
  margin-top: 28px;
}

.activate-pin {
  margin: 16px 0 8px;
  font-size: 48px;
  line-height: 1;
  color: var(--marquee);
  letter-spacing: 0.08em;
  font-family: var(--font-terminal);
}

html:has(.stage-phone),
body:has(.stage-phone) {
  overflow: auto;
  height: auto;
  min-height: 100%;
}

.stage-phone {
  /* Phone and laptop: fluid stage, not the 1920×1080 TV fit. */
  position: relative !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 100vh;
  transform: none !important;
  overflow: visible;
}

.stage-phone .dark {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  min-height: 100vh;
  box-sizing: border-box;
}

.stage-phone .dark .centre,
.stage-phone .centre {
  position: relative;
  left: auto;
  top: auto;
  width: auto;
  max-width: 100%;
  transform: none;
  padding: 32px 20px 64px;
  box-sizing: border-box;
}

.stage-phone .dark svg,
.stage-phone .dark .mark,
.stage-phone .mark-phone {
  width: 100%;
  max-width: 420px;
  height: auto;
}

/* The OPEN 24H sign is one object: Monoton stays at 48px and the whole sign scales to the
   phone, as the player's signed-out screen does (ziggy-surface.css). The negative side margins
   let the 520px sign centre in a narrower line (.centre is text-align:center). Phone only: the
   laptop line holds the sign at full size. */
html[data-surface="phone"] .stage-phone .neon {
  margin: -12px -50% 24px;
  transform: scale(0.62);
  transform-origin: 50% 50%;
}

.stage-phone .dark .line {
  max-width: 100%;
  font-size: 22px;
}

.stage-phone .dark .fine { font-size: 16px; }

.stage-phone .statusline {
  font-size: 22px;
  letter-spacing: 0.06em;
}

.stage-phone .line {
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}

.stage-phone .btn {
  display: inline-block;
  text-decoration: none;
  margin: 8px 6px;
}

.login-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  max-width: 420px;
  margin: 24px auto 0;
}

.login-field {
  display: block;
  margin: 0;
  text-align: left;
}

.login-field span {
  display: block;
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 24px;
  color: var(--ink-muted);
  font-family: var(--font-terminal);
}

.login-input {
  border-radius: var(--radius-field);
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 2px solid var(--sky-plum);
  /* the fill is barely off the ground, so an ink-muted base rule (12:1) marks the field */
  border-bottom-color: var(--ink-muted);
  background: var(--sky-top);
  color: var(--ink);
  font-size: 20px;
  font-family: var(--font-terminal);
}

.login-input:focus {
  outline: none;
  border-color: var(--neon-pink);
  box-shadow: var(--focus-ring);
}

.login-form .btn {
  margin: 0;
}

/* Phone and laptop: the ring follows real keyboard focus (the TV uses the .focus class instead).
   Chromium 53 has no :focus-visible, so the second rule is simply dropped there. */
.stage-phone .btn:focus {
  outline: none;
  border-color: var(--neon-pink);
  box-shadow: var(--focus-ring);
}
.stage-phone .btn:focus:not(:focus-visible) {
  border-color: var(--sky-plum);
  box-shadow: none;
}

/* TV: the .focus class is the one ring; the browser's own outline would be a second */
.btn.focus:focus { outline: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 720px) {
  .login-card .qr {
    float: none;
    width: min(70vw, 240px);
    height: min(70vw, 240px);
    margin: 0 auto 16px;
  }

  .login-card .txt {
    margin-left: 0;
    padding-top: 0;
    text-align: center;
  }

  .login-card .pin {
    font-size: 48px;
  }
}

/* ---------- ZIG-36 Phase 2: sign in with another device ---------- */

/* Sections and headings start hidden by attribute; nothing here may show them by accident. */
.login-split [hidden],
.login-col[hidden] {
  display: none !important;
}

.login-h {
  margin: 0 0 16px;
  font-size: 28px;
  font-weight: normal;
  letter-spacing: 0.06em;
  color: var(--ink);
  font-family: var(--font-terminal);
}

.login-link-status {
  margin: 16px 0 4px;
  font-size: 24px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-family: var(--font-terminal);
}

/* Error variant: colour on this first line only, never a fill, glow or border. */
.login-link-status.err {
  color: var(--error);
}

.login-link-line {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--ink-muted);
  font-family: var(--font-terminal);
}

/* Desk: the code on the left, the password on the right, side by side. */
html[data-surface="desk"] .login-split {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  max-width: 1120px;
  margin: 24px auto 0;
  text-align: left;
}

html[data-surface="desk"] .login-col {
  flex: 1 1 0;
  min-width: 0;
}

html[data-surface="desk"] .login-link {
  padding-right: 48px;
}

html[data-surface="desk"] .login-pw {
  border-left: 1px solid var(--sky-plum);
  padding-left: 48px;
}

html[data-surface="desk"] .login-pw .login-form {
  margin: 0;
}

html[data-surface="desk"] .login-tv {
  margin: 0;
}

/* Phone: the password first, then the code for another device when asked for. */
html[data-surface="phone"] .login-split {
  display: flex;
  flex-direction: column;
}

html[data-surface="phone"] .login-pw { order: 1; }
html[data-surface="phone"] .login-link { order: 2; margin-top: 24px; }

.login-other {
  display: block;
  margin: 16px auto 0;
}

/* The code card inside a column: the QR above the code, so a narrow column still fits. */
html[data-surface="desk"] .login-card .qr,
html[data-surface="phone"] .login-card .qr {
  float: none;
  width: 240px;
  height: 240px;
  margin: 0 auto 16px;
}

html[data-surface="desk"] .login-card .txt,
html[data-surface="phone"] .login-card .txt {
  margin-left: 0;
  padding-top: 0;
  text-align: center;
}

html[data-surface="desk"] .login-card .pin,
html[data-surface="phone"] .login-card .pin {
  font-size: 48px;
}

@media (max-width: 720px) {
  html[data-surface="desk"] .login-split {
    flex-direction: column;
  }

  html[data-surface="desk"] .login-link {
    padding-right: 0;
  }

  html[data-surface="desk"] .login-pw {
    border-left: 0;
    padding-left: 0;
    margin-top: 32px;
  }
}

/* ---------- /activate: the device card, the three codes, the confirmation ---------- */

.activate-card {
  max-width: 420px;
  margin: 16px auto 8px;
  padding: 16px 20px;
  border: 2px solid var(--sky-plum);
  background: var(--sky-top);
  text-align: left;
}

.activate-card .kind {
  margin: 0 0 4px;
  font-size: 24px;
  color: var(--ink);
  font-family: var(--font-terminal);
}

.activate-card .meta {
  margin: 0;
  font-size: 20px;
  color: var(--ink-muted);
  font-family: var(--font-terminal);
}

.activate-choices {
  max-width: 420px;
  margin: 16px auto 0;
}

.activate-choices .btn {
  display: block;
  margin: 0 0 12px;
  font-size: 32px;
  letter-spacing: 0.08em;
  font-family: var(--font-terminal);
}

.activate-entry .login-input {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
