/* =========================================================================
   Login page — uses the main design system tokens from styles.css
   ========================================================================= */

/* The shell mirrors index.html's body but centers the panel on screen.
   Background, text, border, and accent come from styles.css tokens so the
   page respects light/dark theming automatically via the
   prefers-color-scheme media query at the bottom of this file. */
body.login-page {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 100vh;
}

.login-panel {
  background: var(--bg);
  border: 0.5px solid var(--bd2);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--acc);
  margin-bottom: 8px;
}
.login-brand img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.login-h1 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 16px 0 8px;
  color: var(--tx);
}

.login-sub {
  color: var(--tx3);
  font-size: 14px;
  margin: 0 0 24px;
  line-height: 1.5;
}

/* OAuth error surface — reuses the coral palette from styles.css that
   .sync-error / proposal-card-error also use, so the visual language
   stays consistent across the app. */
.login-err {
  background: var(--coral-bg);
  color: var(--coral-tx);
  border: 0.5px solid rgba(216, 90, 48, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.4;
}

/* The primary action — Sendel Moss filled, white text. Same shape as
   .btn-primary in styles.css. Hover/focus mirror the dashboard's primary
   button so users transitioning from login to dashboard feel continuity. */
.login-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: var(--acc);
  color: #fff;
  border: 1px solid var(--acc);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font-main);
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}
.login-signin:hover {
  background: #1A3D2B;
  border-color: #1A3D2B;
}
.login-signin:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
}
.login-signin:active {
  transform: translateY(1px);
}
.login-signin svg {
  flex-shrink: 0;
}

.login-note {
  margin-top: 24px;
  color: var(--tx3);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

/* Dark mode handled via the same [data-theme="dark"] flip used in the
   main app, AND via prefers-color-scheme as a fallback so users who
   haven't yet signed in (and therefore haven't toggled the avatar menu's
   dark-mode switch) still get a respectful first impression in dark OS. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink-rgb: 255, 255, 255;
    --bg: #0D1A12;
    --acc: #2E9F62;
    --acc-tx: #6FC893;
    --coral-bg: rgba(216, 90, 48, 0.2);
    --coral-tx: #F2A589;
  }
  :root:not([data-theme="light"]) .login-signin:hover {
    background: #1A3D2B;
    border-color: #1A3D2B;
  }
}

/* Respect OS-level reduced-motion preference. Same suppression block as
   the main app — kept here rather than relying on styles.css in case
   styles.css fails to load (we'd rather have a working button than a
   bouncing one). */
@media (prefers-reduced-motion: reduce) {
  .login-signin {
    transition: none;
  }
}
