/* SenHub Observability Platform — centre-stage sign-in (variant B).
 * No colour literals: tokens from tokens.css and color-mix() only. */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--brand-navy);
  color: var(--ink-1);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  min-height: 100vh;
}

/* ---------- Logo theme toggling ---------- */

.logo--dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .logo--light {
    display: none;
  }
  html:not([data-theme="light"]) .logo--dark {
    display: inline-block;
  }
}

html[data-theme="dark"] .logo--light {
  display: none;
}
html[data-theme="dark"] .logo--dark {
  display: inline-block;
}
html[data-theme="light"] .logo--dark {
  display: none;
}

/* ---------- Stage, illustration, scrim ---------- */

.stage {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: var(--brand-navy);
}

.stage-motif {
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  /* The centred card zone is cut out of the motif: the mask is transparent
     where the card sits and opaque outside, so no grid line, link or node
     can ever pass underneath the card. */
  -webkit-mask-image: radial-gradient(ellipse 500px 520px at 50% 50%,
    transparent 62%,
    var(--brand-navy) 100%);
  mask-image: radial-gradient(ellipse 500px 520px at 50% 50%,
    transparent 62%,
    var(--brand-navy) 100%);
}

.illu {
  height: 100%;
  left: 0;
  object-fit: cover;
  position: absolute;
  top: 0;
  width: 100%;
}

.scrim {
  background: color-mix(in srgb, var(--brand-navy) 78%, var(--surface-1));
  inset: 0;
  position: absolute;
}

.stage-inner {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 420px;
  padding: var(--space-6) var(--space-4);
  position: relative;
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .illu {
    display: none;
  }
  .stage {
    background-image: url("illu-poster.jpg");
    background-position: center;
    background-size: cover;
  }
  /* Lighten the scrim so the poster stays visible behind the card. */
  .scrim {
    background: color-mix(in srgb, var(--brand-navy) 35%, transparent);
  }
  .pulse {
    animation: none;
  }
}

/* ---------- Motif primitives ---------- */

.motif-link {
  stroke: color-mix(in srgb, var(--brand-amber) 35%, var(--brand-navy));
  stroke-width: 1.5;
}

.motif-node {
  fill: color-mix(in srgb, var(--brand-amber) 55%, var(--brand-navy));
}

.motif-node--hot {
  fill: var(--brand-amber);
}

.motif-halo {
  fill: none;
  stroke: var(--brand-amber);
  stroke-width: 2;
}

.motif-dot {
  fill: color-mix(in srgb, var(--brand-amber) 22%, var(--brand-navy));
}

.pulse {
  animation: motif-pulse 2.8s ease-in-out infinite;
}

.pulse--2 {
  animation-delay: 0.9s;
}

.pulse--3 {
  animation-delay: 1.8s;
}

@keyframes motif-pulse {
  0%,
  100% {
    opacity: 0.9;
  }
  50% {
    opacity: 0.15;
  }
}

/* ---------- Card, providers, notice, footer ---------- */

.card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 400px;
  padding: var(--space-6);
  width: 100%;
}

.card--stage {
  border-top: 3px solid var(--brand-amber);
  box-shadow: var(--shadow-raised);
}

.product-name {
  color: var(--ink-1);
  font-size: var(--text-hero);
  font-weight: var(--weight-regular);
  line-height: var(--leading-tight);
  margin: 0;
}

.product-name-strong {
  font-weight: var(--weight-strong);
}

.stage-sub {
  color: var(--ink-2);
  font-size: var(--text-base);
  margin: calc(-1 * var(--space-3)) 0 0;
}

.providers {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.provider {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-2);
  color: var(--ink-1);
  display: flex;
  font-weight: var(--weight-strong);
  gap: var(--space-3);
  justify-content: flex-start;
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
}

.provider:hover {
  border-color: var(--action);
  text-decoration: none;
}

/* Disabled provider (e.g. "coming soon"): reduced opacity, not-allowed
   cursor, and no hover change. Tokens only, no colour literal. */
.provider[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

.provider[aria-disabled="true"]:hover {
  border-color: var(--hairline);
  text-decoration: none;
}

.provider--primary {
  background: var(--action);
  border-color: var(--action);
  color: var(--on-action);
}

.provider--primary:hover {
  border-color: var(--focus-ring);
}

.note {
  color: var(--ink-2);
  font-size: var(--text-sm);
  margin: 0;
  text-align: center;
}

/* Banner slot: hidden until the server fills it in. */
.notice {
  align-items: center;
  background: color-mix(in srgb, var(--brand-amber) 14%, var(--surface-1));
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--brand-amber);
  border-radius: var(--radius-2);
  color: var(--ink-1);
  display: flex;
  font-size: var(--text-sm);
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-3) var(--space-4);
  width: 100%;
}

.notice[hidden] {
  display: none;
}

.notice .icon {
  color: var(--action);
}

.footer {
  align-items: center;
  color: color-mix(in srgb, var(--brand-amber) 80%, var(--brand-navy));
  display: flex;
  font-size: var(--text-sm);
  gap: var(--space-4);
}

.footer a {
  color: color-mix(in srgb, var(--brand-amber) 80%, var(--brand-navy));
}

.footer a:hover {
  color: var(--brand-amber);
}

.version {
  font-family: var(--font-mono);
}

.footer--center {
  justify-content: center;
}

/* ---------- Icons, focus ---------- */

.icon {
  flex-shrink: 0;
  height: 1.25em;
  width: 1.25em;
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .product-name {
    font-size: var(--text-lg);
  }
  .card {
    padding: var(--space-5);
  }
}

/* ---------- Variant C: offset card on the left ---------- */

.login-c-stage {
  align-items: center;
  display: flex;
  justify-content: flex-start;
  padding-left: 6vw;
}

/* The card zone moves to the left, so the motif mask moves with it. */
.login-c-stage .stage-motif {
  -webkit-mask-image: radial-gradient(ellipse 440px 580px at 12% 50%,
    transparent 60%,
    var(--brand-navy) 100%);
  mask-image: radial-gradient(ellipse 440px 580px at 12% 50%,
    transparent 60%,
    var(--brand-navy) 100%);
}

.login-c-inner {
  max-width: 400px;
  width: 400px;
}

.login-c-footer {
  justify-content: flex-start;
}

@media (max-width: 760px) {
  .login-c-stage {
    flex-direction: column;
    justify-content: flex-end;
    padding-left: 0;
  }
  /* Stronger scrim rising from the bottom, where the card now sits. */
  .login-c-scrim {
    background: linear-gradient(to top,
      color-mix(in srgb, var(--brand-navy) 94%, var(--surface-1)) 0%,
      color-mix(in srgb, var(--brand-navy) 65%, transparent) 55%,
      transparent 100%);
  }
  .login-c-inner {
    max-width: none;
    width: 100%;
  }
}

/* ---------- Variant D: solid navy side band ---------- */

.login-d-stage {
  align-items: stretch;
  display: flex;
}

.login-d-band {
  align-items: stretch;
  background: var(--brand-navy);
  border-right: 3px solid var(--brand-amber);
  color: var(--on-action);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: var(--space-4);
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-6);
  width: clamp(360px, 32vw, 480px);
}

/* On the navy band the body ink must stay light in both themes:
   --on-action is light on light surfaces, --ink-1 is light on dark ones. */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .login-d-band {
    color: var(--ink-1);
  }
}
html[data-theme="dark"] .login-d-band {
  color: var(--ink-1);
}

/* The form sits flush on the band: no card surface, no shadow. */
.login-d-card {
  background: transparent;
  border: none;
  box-shadow: none;
  max-width: none;
  padding: 0;
}

.login-d-band .product-name {
  color: inherit;
}

/* Secondary text on navy: amber is allowed as text on navy surfaces. */
.login-d-band .stage-sub,
.login-d-band .note {
  color: color-mix(in srgb, var(--brand-amber) 75%, var(--brand-navy));
}

.login-d-footer {
  justify-content: flex-start;
}

/* The video fills the rest of the screen, uncovered. */
.login-d-illu {
  align-self: stretch;
  flex: 1 1 0;
  height: auto;
  left: 0;
  min-width: 0;
  position: relative;
  top: 0;
  width: auto;
}

@media (max-width: 760px) {
  .login-d-stage {
    flex-direction: column;
  }
  .login-d-band {
    border-bottom: 3px solid var(--brand-amber);
    border-right: none;
    min-height: 0;
    width: 100%;
  }
  .login-d-illu {
    flex: 0 0 auto;
    height: 40vh;
    width: 100%;
  }
}

/* ---------- Review fixes for variants C and D ---------- */

/* C: the scrim must be fully transparent BEFORE the middle of the screen,
   so the video's centre focal point is never veiled. */
.login-c-scrim {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--brand-navy) 90%, var(--surface-1)) 0%,
    color-mix(in srgb, var(--brand-navy) 62%, transparent) 30%,
    transparent 42%);
}

/* D: the decorative motif must never paint over the solid navy band;
   it is confined to the video area by hiding it on this variant. */
.login-d-stage .stage-motif {
  display: none;
}

/* D narrow layout: let the band size to its content and the page scroll
   if needed, so the footer is never pushed off-screen. */
@media (max-width: 760px) {
  .login-d-stage {
    min-height: 0;
  }
  .login-d-band {
    flex: 0 0 auto;
    min-height: 0;
    padding: var(--space-5) var(--space-4);
  }
  .login-d-illu {
    flex: 0 0 40vh;
    height: 40vh;
  }
}

/* Reduced motion: the poster must stay visible as the background on
   variant C too, so the lightened scrim wins over the C gradient. */
@media (prefers-reduced-motion: reduce) {
  .login-c-scrim {
    background: color-mix(in srgb, var(--brand-navy) 35%, transparent);
  }
  .login-d-stage {
    background-image: url("illu-poster.jpg");
    background-position: center;
    background-size: cover;
  }
  .login-d-illu {
    display: none;
  }
}

/* On the navy band the navy focus ring would vanish: yellow there. */
.login-d-band a:focus-visible, .login-d-band :focus-visible { outline-color: var(--brand-amber); }

/* The band is navy in both themes: it always takes the dark-surface roles,
   whatever the page theme, so the logo and the buttons stay visible. */
.login-d-band {
  color-scheme: dark;
  --surface-1: color-mix(in srgb, var(--brand-navy) 88%, white);
  --surface-2: var(--brand-navy);
  --ink-1: white;
  --ink-2: color-mix(in srgb, white 70%, var(--brand-navy));
  --hairline: color-mix(in srgb, white 18%, var(--brand-navy));
  --action: var(--brand-amber);
  --on-action: var(--brand-navy);
  --focus-ring: var(--brand-amber);
  color: var(--ink-1);
}
.login-d-band .logo--light { display: none !important; }
.login-d-band .logo--dark { display: block !important; }

/* Without motion the poster carries the page: the fallback node grid would
   draw over it. */
@media (prefers-reduced-motion: reduce) {
  .stage-motif { display: none; }
}
body { margin: 0; background: var(--brand-navy); }

/* Phones: everything inside the screen, with a 16 px gutter. */
.product-name { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .product-name { font-size: clamp(26px, 8vw, 36px); }
  .login-c-stage { padding: 0 max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
  .login-c-inner, .login-c-stage .card { width: 100%; max-width: none; box-sizing: border-box; }
  .login-d-band { width: 100%; box-sizing: border-box; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
  .login-d-band .card, .login-d-card { width: 100%; max-width: none; box-sizing: border-box; padding-left: 0; padding-right: 0; }
}
