/* 14-login.css — Sign-in screens (login, first setup, password and sign-in links), the same look as
   MPR One Office: the logo draws itself on a calm background with a slow red glow, below it a card of
   dark glass with a red line drawn after the logo. Always the MPR One look, never a customer's brand. */

body.signed-out {
  background: radial-gradient(1200px 600px at 50% -10%, #ffffff 0%, #eef0f2 55%, #e3e6e9 100%);
  overflow-x: hidden;
}
:root[data-theme="dark"] body.signed-out { background: radial-gradient(1200px 600px at 50% -10%, #23282e 0%, #15191d 60%, #0e1114 100%); }

/* Two slow, faint glows: red top left, grey bottom right. */
body.signed-out::before,
body.signed-out::after {
  content: "";
  display: block;
  position: fixed;
  inset: auto;
  z-index: 0;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.16;
  pointer-events: none;
  animation: login-glow 26s ease-in-out infinite alternate;
}
body.signed-out::before { background: #98151b; top: -30vmax; left: -20vmax; }
body.signed-out::after { background: #59616a; bottom: -34vmax; right: -22vmax; animation-delay: -13s; }
:root[data-theme="dark"] body.signed-out::before { opacity: 0.22; }

body.signed-out main { position: relative; z-index: 1; }
body.signed-out .view-host { max-width: 520px; }

.auth-screen { display: grid; gap: 28px; justify-items: center; }
.auth-screen > .auth-card { width: 100%; max-width: 440px; box-sizing: border-box; }

/* ---------- The logo ---------- */
.drawn-logo { width: min(460px, 88vw); height: auto; overflow: visible; }
.drawn-logo .ink { fill: none; stroke: #15191c; stroke-linejoin: miter; }
.drawn-logo .ink-red { fill: none; stroke: #8c0606; stroke-linejoin: round; }
.drawn-logo .shine { fill: none; stroke: url(#wai-logo-shine); stroke-linejoin: round; }
.drawn-logo .heavy { stroke-width: 19; }
.drawn-logo .medium { stroke-width: 16.5; }
.drawn-logo .light { stroke-width: 5.5; }
:root[data-theme="dark"] .drawn-logo .ink { stroke: #eef0f2; }
:root[data-theme="dark"] .drawn-logo .ink-red { stroke: #c4262d; }

.drawn-logo.drawing [pathLength] {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: login-draw var(--duration, 0.7s) cubic-bezier(0.55, 0.1, 0.3, 1) forwards;
  animation-delay: var(--delay, 0s);
}

/* ---------- The card: dark glass ---------- */
.auth-screen .auth-card {
  position: relative;
  overflow: hidden;
  color: #f7f8f9;
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(20, 24, 29, 0.9);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 30px 80px rgba(13, 17, 21, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: login-rise 0.45s ease-out both;
}
.auth-screen .auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: #98151b;
  transform-origin: left;
  transform: scaleX(0);
  animation: login-line 0.7s cubic-bezier(0.6, 0, 0.2, 1) 2.2s forwards;
}
/* A later card on the same screen (forgot password, back to sign in) does not wait for the logo. */
.auth-screen .auth-card.auth-card-next::before { animation-delay: 0.1s; }
.auth-screen .auth-card h1,
.auth-screen .auth-card .field-label,
.auth-screen .auth-card strong { color: #f7f8f9; }
.auth-screen .auth-card p,
.auth-screen .auth-card .muted,
.auth-screen .auth-card .hint { color: #b7bec6; }
.auth-screen .auth-card .form-error { color: #ffb4b8; }
.auth-screen .auth-card .form-error:empty { display: none; }

.auth-screen .auth-card input:not([type="checkbox"], [type="hidden"]) {
  color: #f1f3f5;
  border: 1px solid #3a4148;
  background: #0f1215;
}
.auth-screen .auth-card input::placeholder { color: #6b737b; }
.auth-screen .auth-card input:-webkit-autofill { -webkit-text-fill-color: #f1f3f5; box-shadow: 0 0 0 40px #0f1215 inset; }
.auth-screen input:focus-visible,
.auth-screen button:focus-visible {
  outline: 3px solid rgba(196, 38, 45, 0.35);
  outline-offset: 2px;
  border-color: #c4262d;
}

.auth-screen .auth-card .btn-primary {
  justify-content: center;
  color: #ffffff;
  border-color: #98151b;
  background: #98151b;
  box-shadow: 0 10px 24px rgba(152, 21, 27, 0.24);
}
.auth-screen .auth-card .btn-primary:hover:not(:disabled) { border-color: #b71d25; background: #b71d25; box-shadow: 0 12px 28px rgba(152, 21, 27, 0.32); }
.auth-screen .auth-card .btn-secondary { color: #e6e9ec; border-color: #59616a; background: transparent; box-shadow: none; }
.auth-screen .auth-card .btn-secondary:hover:not(:disabled) { border-color: #89919a; background: #22272d; }
.auth-screen .auth-card .btn-link { color: #b7bec6; background: none; box-shadow: none; }
.auth-screen .auth-card .btn-link:hover { color: #ffffff; }
.auth-screen .auth-card .notice { color: #e6e9ec; background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); }
.auth-screen .auth-or { color: #8a929b; }
.auth-screen .auth-or::before, .auth-screen .auth-or::after { background: #3a4148; }

.auth-screen .auth-card.shake { animation: login-shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97); }

.auth-footer { margin: -12px 0 0; color: #7b838b; font-size: 12.5px; letter-spacing: 0.02em; }
:root[data-theme="dark"] .auth-footer { color: #8a929b; }

@keyframes login-draw { to { stroke-dashoffset: 0; } }
@keyframes login-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes login-line { to { transform: scaleX(1); } }
@keyframes login-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes login-glow { to { transform: translate(14vmax, 10vmax) scale(1.15); } }

@media (max-height: 640px) {
  .auth-screen { gap: 14px; }
  .drawn-logo { width: min(340px, 80vw); }
}

@media (prefers-reduced-motion: reduce) {
  body.signed-out::before,
  body.signed-out::after,
  .auth-screen .auth-card,
  .auth-screen .auth-card.shake,
  .drawn-logo.drawing [pathLength] { animation: none; stroke-dashoffset: 0; }
  .auth-screen .auth-card::before { animation: none; transform: none; }
}
