/* Shared styling for the standalone, signed-out auth pages (login, forgot-password,
   reset-password). Uses the same design-system tokens as the app so the pages look
   like one product. Extracted from login.html in v5.16 so the three pages stay in
   sync. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--c-bg-app);
  color: var(--c-text-primary);
  font-family: 'Arimo', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color .2s ease, color .2s ease;
}
/* Ambient brand glow — theme-aware (deep purple on dark, faint wash on light) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 18% 0%, rgb(var(--c-brand-900-rgb) / .55) 0%, transparent 35%),
    radial-gradient(circle at 80% 100%, rgb(var(--c-brand-700-rgb) / .30) 0%, transparent 45%);
}
:root[data-theme="light"] body::before {
  background:
    radial-gradient(1100px 600px at 80% -5%, rgb(var(--c-brand-primary-rgb) / .06), transparent 60%),
    radial-gradient(900px 500px at -5% 8%, rgb(var(--c-brand-primary-rgb) / .05), transparent 55%);
}

/* Theme toggle — sun/moon icon button, top-right of the viewport */
.theme-toggle {
  position: fixed; top: 16px; right: 16px; z-index: 20;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  border-radius: 10px;
  border: 1px solid var(--c-border-default);
  background: rgb(var(--c-surface-1-rgb) / .6);
  color: var(--c-text-secondary);
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.theme-toggle:hover { background: rgb(var(--c-brand-500-rgb) / .14); color: var(--c-text-primary); border-color: var(--c-border-strong); }
.theme-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px rgb(var(--c-brand-violet-rgb) / .5); }
.theme-toggle svg { display: block; }
/* Show the icon for the theme you'd switch TO: sun on dark, moon on light */
.theme-toggle .ti-moon { display: none; }
:root[data-theme="light"] .theme-toggle .ti-sun  { display: none; }
:root[data-theme="light"] .theme-toggle .ti-moon { display: block; }

/* Centered content area */
.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.login-inner {
  width: 100%;
  max-width: 420px;
}

/* Brand stack */
.brand-stack { text-align: center; margin-bottom: 32px; }
.brand-stack img.wordmark {
  display: block; margin: 0 auto 14px;
  width: 220px; height: auto; max-width: 70%;
}
.brand-sub {
  font-size: 11px; color: var(--c-text-muted);
  letter-spacing: 2.4px; margin-top: 0;
  text-transform: uppercase; font-weight: 600;
}
.brand-tagline {
  font-size: 13px; color: var(--c-text-disabled);
  margin-top: 12px; font-style: italic;
}

/* Card */
.login-card {
  background: rgb(var(--c-surface-1-rgb) / .85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--c-border-subtle);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: var(--shadow-high);
}
.login-card h1 {
  font-size: 18px; font-weight: 700;
  margin: 0 0 4px; color: var(--c-text-primary);
}
.login-card p.lede {
  font-size: 13px; color: var(--c-text-muted);
  margin: 0 0 24px;
}

/* Form fields */
.field { margin-bottom: 14px; }
.field.last { margin-bottom: 22px; }
.field label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--c-text-secondary); margin-bottom: 6px;
}
.input {
  background: var(--c-bg-sunken);
  border: 1px solid var(--c-border-default);
  color: var(--c-text-primary);
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 16px;       /* 16px prevents iOS auto-zoom on focus */
  width: 100%;
  font-family: inherit;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus {
  border-color: rgb(var(--c-brand-primary-rgb) / .6);
  outline: none;
  box-shadow: 0 0 0 3px rgb(var(--c-brand-primary-rgb) / .2);
}
.input::placeholder { color: var(--c-text-disabled); }

.btn-primary {
  background: linear-gradient(180deg, var(--c-brand-700) 0%, var(--c-brand-900) 100%);
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 0 rgba(255,255,255,.10) inset, 0 1px 4px rgba(0,0,0,.35);
  width: 100%;
  transition: background .12s ease, transform .06s ease;
  font-family: inherit;
  display: block;
}
.btn-primary:hover { background: linear-gradient(180deg, var(--c-brand-600) 0%, var(--c-brand-800) 100%); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .7; cursor: default; }

.err {
  margin-bottom: 16px; padding: 10px 12px;
  background: rgb(var(--c-danger-rgb) / .10);
  border: 1px solid rgb(var(--c-danger-rgb) / .30);
  border-radius: 6px; color: var(--c-risk-critical-fg); font-size: 13px;
}
.notice {
  margin-bottom: 16px; padding: 10px 12px;
  background: rgb(var(--c-risk-low-rgb) / .12);
  border: 1px solid rgb(var(--c-risk-low-rgb) / .30);
  border-radius: 6px; color: var(--c-text-primary); font-size: 13px;
}

.footnote {
  text-align: center; font-size: 11px;
  color: var(--c-text-disabled); margin: 24px 0 0;
}
/* An inline link within the auth card (e.g. "Forgot password?", "Back to sign in"). */
.auth-link { color: var(--c-brand-violet); text-decoration: none; font-weight: 600; }
.auth-link:hover { text-decoration: underline; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 13px; }

/* Page footer */
.page-foot {
  text-align: center; padding: 16px;
  font-size: 11px; color: var(--c-text-disabled);
  border-top: 1px solid var(--c-border-subtle);
}
.page-foot strong { font-weight: 700; letter-spacing: 2px; color: var(--c-text-muted); }

@media (prefers-reduced-motion: reduce) {
  body, .theme-toggle, .input, .btn-primary { transition: none; }
}
