/* Lighthouse sign-in page -- v0.2.7 craft pass
   Direction A: Split-screen. Form left, product presence right.
   Token-only: zero hardcoded color, spacing, radii, or shadow values.
   Auth flow preserved: POST /signin/auth, name=username, name=password, ?error=invalid. */

/* ==== Reset ==== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ==== Page shell ==== */
html, body {
  height: 100%;
  font-family: var(--lh-font-sans);
  color: var(--lh-text-default);
  font-size: 15px;
  line-height: var(--lh-leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--lh-bg-app);
}

/* ==== Skip link ==== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--lh-accent-default);
  color: var(--lh-text-on-accent);
  padding: var(--lh-space-2) var(--lh-space-4);
  border-radius: var(--lh-radius-sm);
  font-size: var(--lh-text-small);
  font-weight: var(--lh-weight-semibold);
  text-decoration: none;
}
.skip-link:focus {
  left: var(--lh-space-3);
  top: var(--lh-space-3);
}

/* ==== Two-column shell ==== */
.signin-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ==== Left: form column ==== */
.signin-form-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--lh-space-12) var(--lh-space-8);
  background-color: var(--lh-bg-panel);
  position: relative;
  /* Subtle right-edge separator */
  border-right: 1px solid var(--lh-border-soft);
  z-index: 1;
}

.signin-form-wrap {
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  gap: var(--lh-space-8);
}

/* ==== Brand mark ==== */
.signin-brand {
  display: flex;
  align-items: center;
}

.signin-brand img {
  height: 28px;
  width: auto;
  display: block;
}

/* ==== Heading block ==== */
.signin-heading {
  display: flex;
  flex-direction: column;
  gap: var(--lh-space-2);
}

.signin-title {
  font-size: var(--lh-text-hero);
  font-weight: var(--lh-weight-bold);
  color: var(--lh-text-heading-color);
  line-height: var(--lh-leading-tight);
  letter-spacing: var(--lh-tracking-tight);
}

.signin-subtitle {
  font-size: var(--lh-text-body);
  color: var(--lh-text-muted);
  line-height: var(--lh-leading-snug);
  font-weight: var(--lh-weight-regular);
}

/* ==== Form ==== */
.signin-form {
  display: flex;
  flex-direction: column;
  gap: var(--lh-space-5);
}

.signin-field {
  display: flex;
  flex-direction: column;
  gap: var(--lh-space-2);
}

.signin-label {
  font-size: var(--lh-text-small);
  font-weight: var(--lh-weight-semibold);
  color: var(--lh-text-heading-color);
  letter-spacing: var(--lh-tracking-normal);
}

.signin-input {
  height: var(--lh-input-height);
  background: var(--lh-bg-panel-muted);
  border: 1px solid var(--lh-border-input);
  border-radius: var(--lh-radius-md);
  padding: 0 var(--lh-space-4);
  font-family: var(--lh-font-sans);
  font-size: var(--lh-text-body);
  color: var(--lh-text-default);
  width: 100%;
  transition: border-color var(--lh-duration-fast) var(--lh-ease-standard),
              box-shadow var(--lh-duration-fast) var(--lh-ease-standard),
              background-color var(--lh-duration-fast) var(--lh-ease-standard);
  outline: none;
  -webkit-appearance: none;
}

.signin-input::placeholder {
  color: var(--lh-text-subtle);
}

.signin-input:focus {
  border-color: var(--lh-border-interactive);
  box-shadow: var(--lh-shadow-focus);
  background: var(--lh-bg-panel);
}

/* ==== Submit button ==== */
.signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--lh-button-height);
  width: 100%;
  background: var(--lh-brand-harbor);
  color: var(--lh-text-on-accent);
  border: 0;
  border-radius: var(--lh-radius-md);
  font-family: var(--lh-font-sans);
  font-size: var(--lh-text-body);
  font-weight: var(--lh-weight-semibold);
  cursor: pointer;
  transition: filter var(--lh-duration-fast) var(--lh-ease-standard),
              box-shadow var(--lh-duration-fast) var(--lh-ease-standard);
  letter-spacing: 0.01em;
  margin-top: var(--lh-space-1);
}

.signin-btn:hover {
  filter: brightness(1.08);
}

.signin-btn:focus-visible {
  outline: none;
  box-shadow: var(--lh-shadow-focus);
}

.signin-btn:active {
  filter: brightness(0.94);
}

/* ==== Error state ==== */
.signin-error {
  display: none;
  padding: var(--lh-space-3) var(--lh-space-4);
  background: var(--lh-critical-soft);
  border: 1px solid var(--lh-critical-default);
  border-radius: var(--lh-radius-sm);
  font-size: var(--lh-text-small);
  color: var(--lh-critical-strong);
  line-height: var(--lh-leading-snug);
}

.signin-error.is-visible {
  display: block;
}

/* ==== Footer ==== */
.signin-footer {
  font-size: var(--lh-text-micro);
  color: var(--lh-text-subtle);
  line-height: var(--lh-leading-snug);
}

/* ==== Right: product stage column ==== */
.signin-stage {
  position: relative;
  background: var(--lh-brand-harbor);
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.signin-stage-inner {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--lh-space-12) var(--lh-space-10);
}

/* Atmospheric beacon glow — tokens canonicalized per Iris review MZM-2215 v0.2.7 */
.signin-stage-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 55% at 62% 38%, var(--lh-brand-beacon-glow-md) 0%, transparent 70%),
    radial-gradient(ellipse 80% 60% at 30% 70%, var(--lh-brand-beacon-glow-sm) 0%, transparent 65%),
    radial-gradient(ellipse 100% 100% at 50% 0%, var(--lh-brand-sea-glow-xs) 0%, transparent 55%);
  z-index: 0;
}

.signin-stage-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--lh-space-10);
  max-width: 26rem;
}

/* ==== Stage: brand mark ==== */
.signin-stage-mark {
  display: flex;
  align-items: center;
  gap: var(--lh-space-3);
}

.signin-stage-mark svg {
  display: block;
  flex-shrink: 0;
}

.signin-stage-wordmark {
  font-family: var(--lh-font-sans);
  font-size: var(--lh-text-heading);
  font-weight: var(--lh-weight-bold);
  color: var(--lh-ink-inverse);
  letter-spacing: var(--lh-tracking-tight);
  line-height: 1;
  opacity: 0.92;
}

/* ==== Stage: editorial statement ==== */
.signin-stage-statement {
  display: flex;
  flex-direction: column;
  gap: var(--lh-space-4);
}

.signin-stage-headline {
  font-size: var(--lh-text-display);
  font-weight: var(--lh-weight-bold);
  color: var(--lh-ink-inverse);
  line-height: var(--lh-leading-tight);
  letter-spacing: var(--lh-tracking-tight);
}

.signin-stage-body {
  font-size: var(--lh-text-body);
  color: var(--lh-brand-sea);
  line-height: 1.65;
  max-width: 22rem;
}

/* ==== Stage: stats row ==== */
.signin-stage-stats {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0;
  padding-top: var(--lh-space-6);
  border-top: 1px solid var(--lh-border-on-dark);
}

.signin-stage-stat {
  display: flex;
  flex-direction: column;
  gap: var(--lh-space-1);
  padding-right: var(--lh-space-6);
}

.signin-stage-stat--divider {
  padding-left: var(--lh-space-6);
  border-left: 1px solid var(--lh-border-on-dark);
}

.signin-stat-value {
  font-size: var(--lh-text-title);
  font-weight: var(--lh-weight-bold);
  color: var(--lh-ink-inverse);
  line-height: 1;
  letter-spacing: var(--lh-tracking-tight);
}

.signin-stat-label {
  font-size: var(--lh-text-micro);
  font-weight: var(--lh-weight-medium);
  color: var(--lh-brand-sea);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}

/* Health chip */
.signin-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--lh-space-2);
  font-size: var(--lh-text-small);
  font-weight: var(--lh-weight-semibold);
  line-height: 1;
}

.signin-stat-chip--healthy {
  color: var(--lh-positive-default);
}

.signin-stat-chip-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--lh-radius-pill);
  background: var(--lh-positive-default);
  flex-shrink: 0;
}

/* ==== Responsive: collapse to single-column at 768px ==== */
@media (max-width: 768px) {
  .signin-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  /* Stage moves to a compact header band on mobile */
  .signin-stage {
    order: -1;
    min-height: 0;
  }

  .signin-stage-inner {
    padding: var(--lh-space-8) var(--lh-space-6);
    justify-content: flex-start;
  }

  .signin-stage-content {
    gap: var(--lh-space-6);
    max-width: 100%;
  }

  .signin-stage-mark img {
    height: 28px;
  }

  .signin-stage-headline {
    font-size: var(--lh-text-hero);
  }

  .signin-stage-body,
  .signin-stage-stats {
    display: none;
  }

  .signin-form-col {
    border-right: none;
    border-top: 1px solid var(--lh-border-soft);
    padding: var(--lh-space-8) var(--lh-space-6);
    align-items: flex-start;
  }

  .signin-form-wrap {
    max-width: 100%;
    gap: var(--lh-space-6);
  }
}

/* ==== Reduced motion ==== */
@media (prefers-reduced-motion: reduce) {
  .signin-input,
  .signin-btn {
    transition: none;
  }
}
