/* Sign-in journey (login, MFA, password reset) in the simsonic.com v2 style
   (design brief v2, 27 Oct 2026): true black, Inter 400/500/600, neutral
   greys, a white pill button and one flat pink accent.

   This is a documented, scoped exception to the app-wide brand tokens in
   brand_tokens.css: these pages ignore the Brand / Dark Mono theme and
   always render this one look. Every colour below is a --signin-* token;
   rules never use raw literals. signin_globe.js reads --signin-accent-rgb
   for the canvas traffic dots. Used only via site/_signin_base.html.
   See ADMIN_DESIGN.md "Sign-in pages" and DESIGN_SYSTEM.md. */

.signin-page {
  --signin-bg: #000;
  --signin-box: #0c0c0d;
  --signin-line: rgba(255, 255, 255, .12);
  --signin-line-soft: rgba(255, 255, 255, .08);
  --signin-line-strong: rgba(255, 255, 255, .16);
  --signin-ink: #f5f5f7;
  --signin-ink-2: #86868b;
  --signin-ink-3: #6e6e73;
  --signin-btn-text: #0b0b0d;
  --signin-btn-hover: #fff;
  --signin-accent: #ff2ec4;
  --signin-accent-rgb: 255, 46, 196;
  --signin-error-line: rgba(255, 107, 107, .45);
  --signin-orbit: rgba(150, 190, 255, .10);
  --signin-route: rgba(255, 255, 255, .14);
  --signin-ping: rgba(255, 255, 255, .7);
  --signin-sat-panel: rgba(255, 255, 255, .55);
  --signin-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --signin-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --signin-r-card: 18px;
  --signin-r-small: 10px;
  --signin-r-pill: 999px;
}

html.signin-html, html.signin-html body { margin: 0; min-height: 100%; background: #000; }
.signin-page, .signin-page * { box-sizing: border-box; }
.signin-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: flex-end;
  padding: 0 clamp(24px, 7vw, 140px);
  background: var(--signin-bg);
  color: var(--signin-ink);
  font-family: var(--signin-sans);
  font-size: 15px;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}
:where(.signin-page) :where(h1, h2, p) { margin: 0; }

/* Background: the night globe on the left, darkening to black under the form. */
.signin-scene { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.signin-scene::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--signin-bg), rgba(0, 0, 0, 0) 6%), linear-gradient(270deg, var(--signin-bg), rgba(0, 0, 0, 0) 8%);
}
.signin-world { position: absolute; inset: 0; }
.signin-world img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; }
/* The turning Earth fades in over the Europe still once its map has loaded (login page only). */
.signin-earth { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s ease; }
.signin-world.is-turning .signin-earth { opacity: 1; }
.signin-world::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, .6) 68%, rgba(0, 0, 0, .92) 82%),
    linear-gradient(180deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, .65));
}
/* A slow band of light sweeps across the city lights (login page only). */
.signin-world .signin-glow {
  mix-blend-mode: screen; filter: brightness(1.2); opacity: .3;
  -webkit-mask-image: linear-gradient(115deg, transparent 35%, #000 50%, transparent 65%);
  mask-image: linear-gradient(115deg, transparent 35%, #000 50%, transparent 65%);
  -webkit-mask-size: 300% 100%; mask-size: 300% 100%;
  animation: signin-sweep 14s linear infinite;
}
.signin-world.is-turning .signin-glow { display: none; }
@keyframes signin-sweep {
  from { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
  to { -webkit-mask-position: 0 0; mask-position: 0 0; }
}

/* Live layer (login page only): cities, routes, planes, satellites, traffic. */
.signin-live {
  --signin-door-edge: calc(100% - clamp(24px, 7vw, 140px) - min(440px, 34vw));
  position: absolute; inset: 0;
  /* Fades out before the form column so nothing moves behind the fields. */
  -webkit-mask-image: linear-gradient(90deg, #000 calc(var(--signin-door-edge) - 110px), transparent calc(var(--signin-door-edge) - 16px));
  mask-image: linear-gradient(90deg, #000 calc(var(--signin-door-edge) - 110px), transparent calc(var(--signin-door-edge) - 16px));
}
.signin-sky { position: absolute; inset: 0; width: 100%; height: 100%; }
/* signin_globe.js draws these on its canvas so they can turn with the Earth. */
.signin-live.is-live .signin-sky .route, .signin-live.is-live .signin-sky .city { display: none; }
.signin-sky .orbit { fill: none; stroke: var(--signin-orbit); stroke-width: 1.4; }
.signin-sky .orbit.far { stroke-width: 1; opacity: .65; }
.signin-sky .route { fill: none; stroke: var(--signin-route); stroke-width: 2; stroke-dasharray: 5 10; animation: signin-flow 5s linear infinite; }
@keyframes signin-flow { to { stroke-dashoffset: -150; } }
.signin-sky .city circle { fill: var(--signin-ink); }
.signin-sky .city.home circle { fill: var(--signin-accent); }
.signin-fly { position: absolute; inset: 0; }
.signin-fly .traffic { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.signin-fly .pl { position: absolute; left: 0; top: 0; width: 16px; height: 16px; margin: -8px 0 0 -8px; will-change: transform; }
.signin-fly .pl svg { width: 16px; height: 16px; display: block; }
.signin-fly .pl svg path { fill: var(--signin-ink); }
.signin-fly .pl i { position: absolute; right: 11px; top: 7px; width: 46px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .75)); }
.signin-fly .pl.pk svg path { fill: var(--signin-accent); }
.signin-fly .pl.pk i { background: linear-gradient(90deg, rgba(var(--signin-accent-rgb), 0), rgba(var(--signin-accent-rgb), .8)); }
.signin-fly .sat { position: absolute; left: 0; top: 0; width: 30px; height: 14px; margin: -7px 0 0 -15px; will-change: transform, opacity; }
.signin-fly .sat-in { position: absolute; inset: 0; }
.signin-fly .sat.leo .sat-in { transform: scale(.68); opacity: .85; }
.signin-fly .sat.geo .sat-in { transform: scale(1.25); }
.signin-fly .sat.geo b { animation-duration: 4.8s; }
.signin-fly .sat svg { display: block; width: 30px; height: 14px; }
.signin-fly .sat .panel { fill: var(--signin-sat-panel); }
.signin-fly .sat .body { fill: var(--signin-ink); }
.signin-fly .sat b { position: absolute; left: 13px; top: 5px; width: 4px; height: 4px; border-radius: 50%; background: var(--signin-btn-hover); animation: signin-blink 2.4s steps(1) infinite; }
@keyframes signin-blink { 50% { opacity: .15; } }
.signin-fly .pw { position: absolute; left: 0; top: 0; }
.signin-fly .pg { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--signin-ping); animation: signin-ping 3s cubic-bezier(.23, 1, .32, 1) infinite; will-change: transform, opacity; }
@keyframes signin-ping { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(3.4); } }

/* Chrome: wordmark and tagline top left, legal links bottom right. */
.signin-brand { position: absolute; z-index: 3; top: 40px; left: clamp(24px, 4vw, 56px); }
.signin-logo { display: block; line-height: 0; }
.signin-logo img { height: 26px; width: auto; }
.signin-tagline { margin-top: 8px; font-size: 13.5px; line-height: 1.4; color: var(--signin-ink-2); }
.signin-foot { position: absolute; z-index: 3; bottom: 36px; right: clamp(24px, 4vw, 56px); display: flex; gap: 18px; font-size: 12.5px; color: var(--signin-ink-3); }
.signin-foot a { color: inherit; text-decoration: none; }
.signin-foot a:hover { color: var(--signin-ink); }

/* The door: the form column on the right. */
.signin-door {
  position: relative; z-index: 2;
  width: min(440px, 34vw);
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 112px 0 104px;
}
.signin-title { font-size: clamp(30px, 2.7vw, 42px); font-weight: 600; letter-spacing: -.045em; line-height: 1.04; text-wrap: balance; }
.signin-title em { display: block; font-style: normal; color: var(--signin-ink-2); }
.signin-sub { margin-top: 12px; font-size: 15px; line-height: 1.5; color: var(--signin-ink-2); max-width: 36ch; text-wrap: balance; }
.signin-sub strong { color: var(--signin-ink); font-weight: 500; }

.signin-form { margin-top: 34px; display: flex; flex-direction: column; gap: 8px; }
.signin-form + .signin-form { margin-top: 12px; }
.signin-field { display: flex; flex-direction: column; gap: 8px; }
.signin-field + .signin-field { margin-top: 10px; }
.signin-label, .signin-page label { font-size: 13px; font-weight: 500; color: var(--signin-ink-2); }
.signin-page input[type="text"], .signin-page input[type="password"], .signin-page input[type="email"] {
  width: 100%; height: 50px; padding: 0 16px;
  background: var(--signin-box); border: 1px solid var(--signin-line); border-radius: var(--signin-r-card);
  color: var(--signin-ink); font: inherit; font-size: 15px; outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.signin-page input:focus { border-color: var(--signin-accent); box-shadow: 0 0 0 3px rgba(var(--signin-accent-rgb), .2); }
.signin-page input.signin-code { font-family: var(--signin-mono); font-size: 20px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.signin-help { font-size: 12.5px; line-height: 1.5; color: var(--signin-ink-3); }
.signin-help ul { margin: 4px 0 0; padding-left: 18px; }

/* "Signing in as" row with its Change link. */
.signin-who { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 50px; padding: 0 6px 0 16px; background: var(--signin-box); border: 1px solid var(--signin-line); border-radius: var(--signin-r-card); font-size: 14.5px; }
.signin-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signin-who a { flex: none; font-size: 12.5px; color: var(--signin-ink-2); text-decoration: none; padding: 7px 12px; border-radius: var(--signin-r-pill); }
.signin-who a:hover { color: var(--signin-ink); background: var(--signin-line-soft); }

/* Buttons: one white primary pill per view, quiet secondary. */
.signin-btn, .signin-btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  height: 50px; padding: 0 22px; border-radius: var(--signin-r-pill);
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .12s, background .15s, border-color .15s, color .15s;
}
.signin-btn { margin-top: 18px; border: 0; background: var(--signin-ink); color: var(--signin-btn-text); }
.signin-btn:hover { background: var(--signin-btn-hover); }
.signin-btn-secondary { border: 1px solid var(--signin-line-strong); background: transparent; color: var(--signin-ink); font-weight: 500; }
.signin-btn-secondary:hover { border-color: var(--signin-ink-2); }
.signin-btn:active, .signin-btn-secondary:active { transform: scale(.985); }
.signin-btn.is-pending, .signin-btn-secondary.is-pending { opacity: .7; cursor: progress; }
.signin-page button:focus-visible, .signin-page a:focus-visible { outline: 2px solid var(--signin-accent); outline-offset: 3px; }

.signin-links { margin-top: 18px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; font-size: 13px; }
.signin-links a, .signin-link { color: var(--signin-ink-2); text-decoration: none; }
.signin-links a:hover, .signin-link:hover { color: var(--signin-ink); }
.signin-or { margin-top: 22px; display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--signin-ink-3); }
.signin-or::before, .signin-or::after { content: ""; flex: 1; height: 1px; background: var(--signin-line-soft); }
.signin-or + .signin-btn-secondary, .signin-or + form { margin-top: 14px; }
.signin-or + form .signin-btn-secondary, .signin-door > .signin-btn-secondary { width: 100%; }

/* Alerts: neutral box, a red hairline for errors, white text. */
.signin-alert { margin-top: 20px; padding: 12px 16px; border-radius: var(--signin-r-card); background: var(--signin-box); border: 1px solid var(--signin-line); color: var(--signin-ink); font-size: 13.5px; line-height: 1.5; }
.signin-alert.is-error { border-color: var(--signin-error-line); }
.signin-alert ul { margin: 0; padding-left: 18px; }
.signin-alert + .signin-alert { margin-top: 8px; }

/* MFA setup: QR code and manual key. */
.signin-qr { margin-top: 28px; display: flex; gap: 18px; align-items: center; }
.signin-qr img { flex: none; width: 132px; height: 132px; border-radius: var(--signin-r-small); background: var(--signin-btn-hover); padding: 6px; }
.signin-key { display: block; margin-top: 6px; padding: 8px 12px; background: var(--signin-box); border: 1px solid var(--signin-line); border-radius: var(--signin-r-small); font-family: var(--signin-mono); font-size: 12.5px; letter-spacing: .06em; color: var(--signin-ink); word-break: break-all; }
.signin-code-list { list-style: none; margin: 16px 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.signin-qr .signin-help + .signin-help { margin-top: 8px; }
.signin-qr .signin-step { margin-bottom: 4px; }
.signin-step { font-family: var(--signin-mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--signin-ink-3); }

@media (max-width: 960px) {
  .signin-page { justify-content: flex-start; padding: 0 32px; }
  .signin-world { opacity: .45; }
  .signin-earth { display: none; }
  .signin-live { display: none; }
  .signin-door { width: 100%; max-width: 440px; justify-content: flex-start; padding: 128px 0 112px; }
  .signin-brand { top: 44px; left: 32px; }
  .signin-foot { left: 32px; right: 32px; bottom: max(32px, env(safe-area-inset-bottom)); justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .signin-fly { display: none; }
  .signin-world .signin-glow, .signin-sky .route { animation: none; }
}
.signin-door > .signin-btn { margin-top: 28px; }
