  /* The page's own layout and login_v2's controls. Its palette (the
     background, the card, the brand reds) is sign-in.css's, on
     body.sign-in; the card's light tokens in dark are components.css's.
     This block follows the stylesheet's link, so where login_v2 differs
     from V3 (the input's red focus ring) its rules, with the same
     selectors, win. */
  html, body { margin: 0; padding: 0; }
  body {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
  }
  /* The background, drawn: a pale dot grid denser at the centre, a soft
     glow where the card sits, and the corners faded for depth. */
  body::before, body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
  }
  body::before {
    background-image: radial-gradient(circle, var(--bg-dot) 1px, transparent 1.6px);
    background-size: 22px 22px;
    background-position: center;
    opacity: 0.55;
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at center, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 45%, transparent 75%);
            mask-image: radial-gradient(ellipse 90% 80% at center, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 45%, transparent 75%);
  }
  body::after {
    background:
      radial-gradient(ellipse 900px 700px at 50% 45%, var(--bg-center-glow) 0%, transparent 70%),
      linear-gradient(135deg, transparent 0%, transparent 40%, var(--bg-fade) 100%),
      linear-gradient(315deg, transparent 0%, transparent 40%, var(--bg-fade) 100%);
  }
  header, main, footer { position: relative; z-index: 1; }

  header { padding: 16px 24px; }
  /* The wordmark: Ubuntu 500 (login_v2 sets 400; we set what we have),
     in the Red 11 to Ruby 11 gradient. */
  .wordmark {
    font-family: var(--font-brand);
    font-weight: 500;
    font-size: 30px;
    line-height: 1;
    background: linear-gradient(to top right, var(--radix-red-11) 0%, var(--radix-ruby-11) 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
            color: transparent;
  }

  main {
    flex: 1 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 24px 80px;
  }
  .login-wrap { width: 100%; max-width: 580px; }
  /* A light card in both schemes, frosted over the background. */
  .card {
    background: var(--card-surface);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 40px 56px;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    box-shadow: var(--card-shadow);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
  }
  @media (max-width: 480px) { .card { padding: 32px 24px; } }
  .card h1 { font-size: 18px; font-weight: 600; color: var(--ink-strong); margin: 0 0 24px; }
  .card h2 { font-size: 15px; font-weight: 600; color: var(--ink-strong); margin: 0 0 8px; }
  .card p { margin: 0 0 14px; }
  .card a { color: var(--accent-link); }
  .card a:hover { color: var(--accent-link-hover); }

  .sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); border: 0;
  }
  /* login_v2's input: V3's .form-input with a margin below and the
     brand red's focus ring. */
  .form-input {
    display: block;
    width: 100%;
    margin: 0 0 14px;
    padding: 12px 14px;
    background: var(--surface-app);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    color: var(--ink-strong);
    font-family: var(--font-sans);
    font-size: 15px;
  }
  .form-input:focus {
    outline: none;
    border-color: var(--radix-red-11);
    box-shadow: 0 0 0 3px var(--radix-red-3);
  }

  /* The primary button: Red 11 at rest, fading to the Red 11 to Ruby 11
     gradient on hover. */
  .btn-primary, .btn-secondary {
    display: block;
    width: 100%;
    margin: 8px 0 0;
    padding: 13px 24px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    border-radius: 999px;
    cursor: pointer;
  }
  .btn-primary {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--radix-red-11);
    color: var(--surface-app);
    border: none;
    box-shadow: 0 8px 24px -8px var(--radix-red-glow), inset 0 1px 0 color-mix(in srgb, var(--surface-app) 15%, transparent);
    transition: box-shadow 320ms var(--ease-out), transform 80ms var(--ease-out);
  }
  .btn-primary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top right, var(--radix-red-11) 0%, var(--radix-ruby-11) 100%);
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    transition: opacity 320ms var(--ease-out);
  }
  .btn-primary:hover { box-shadow: 0 12px 32px -8px var(--radix-ruby-glow), inset 0 1px 0 color-mix(in srgb, var(--surface-app) 15%, transparent); }
  .btn-primary:hover::before { opacity: 1; }
  .btn-primary:active { transform: translateY(1px); }
  .btn-secondary {
    background: var(--ink);
    color: var(--surface-app);
    border: 1px solid var(--ink);
    transition: background 180ms var(--ease-out), transform 80ms var(--ease-out);
  }
  .btn-secondary:hover { background: var(--slate-11); }
  .btn-secondary:active { transform: translateY(1px); }

  /* What the page says, left-aligned in the card: a refusal is the
     stylesheet's .notice--error (login_v2's error box), any other word a
     neutral box. */
  .notice { text-align: left; white-space: pre-wrap; }
  .notice:not(.notice--error) {
    background: var(--surface-muted);
    border-color: var(--border-subtle);
    color: var(--ink);
  }

  #qr { margin: 0 auto 14px; width: 200px; height: 200px; }
  #qr svg { width: 100%; height: 100%; }
  code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; color: var(--ink-strong); }
  /* app.pulse's reset link and its note (decision 9 of 387): shown only by
     its presentation's block below, never on the view sign-in. */
  .forgot, .forgot-help { display: none; }
  /* Forgot your password? (issue 482) and the reset steps' own links: buttons
     that look like the card's links. */
  /* Scoped to .card so it outranks `.card p` (margin 0 0 14px), which
     otherwise leaves the link flush under its button. */
  .card .reset-offer { margin: 28px 0 14px; text-align: center; }
  .card .reset-offer + .reset-offer { margin-top: 14px; }
  .link-button {
    padding: 0;
    background: none;
    border: 0;
    color: var(--accent-link);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
  }
  .link-button:hover { color: var(--accent-link-hover); }
  /* The remembered accounts (issue 536). */
  .accounts { list-style: none; margin: 0 0 6px; padding: 0; text-align: left; }
  /* Each row a bordered tile with a chevron, so it reads as a button, and
     a round close icon beside it for Remove. */
  .accounts li { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
  .account-pick {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface-app);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 180ms var(--ease-out), border-color 180ms var(--ease-out);
  }
  .account-pick:hover { background: var(--surface-muted); border-color: var(--ink-soft); }
  .account-pick:active { transform: translateY(1px); }
  .account-pick:focus-visible, .account-remove:focus-visible { outline: 2px solid var(--radix-red-11); outline-offset: 2px; }
  .account-text { flex: 1; min-width: 0; }
  .account-text span { display: block; overflow-wrap: anywhere; }
  .account-pick .icon { color: var(--ink-soft); }
  .account-pick:hover .icon { color: var(--ink-strong); }
  .account-remove {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 999px;
    color: var(--ink-soft);
    cursor: pointer;
  }
  .account-remove:hover { background: var(--surface-muted); color: var(--ink-strong); }
  .account-name, .account-current { color: var(--ink-strong); font-weight: 500; }
  .account-when, .card .accounts-note { color: var(--ink-soft); font-size: 13px; }
  .card .accounts-note { margin: 14px 0 0; text-align: left; }
  /* Issue 482's show/hide button and rules (components.css), in this
     page's red. The input's margin falls outside .pw-field. */
  .pw-toggle:focus-visible { outline-color: var(--radix-red-11); }
  .card .pw-rules { margin: -6px 0 14px; font-size: 13px; text-align: left; }

  footer {
    flex-shrink: 0;
    padding: 36px 24px 32px;
    color: var(--page-ink-soft);
    font-size: 14px;
    text-align: center;
  }
  footer p { margin: 3px 0; }
  .footer-name { color: var(--page-ink); font-size: 15px; margin: 0 0 8px; }
  .footer-name span { font-family: var(--font-brand); font-weight: 500; }
