/* Copyright Advanced Software and AI Solutions LLC */
:root {
  --pulse-bg0: #0f1419;
  --pulse-bg1: #1a2332;
  --pulse-fg: #e8eef6;
  --pulse-muted: #9aabbc;
  --pulse-accent: #2a9d8f;
  --pulse-accent-hi: #3dbaab;
  --pulse-danger: #c45c5c;
  --pulse-radius: 6px;
  --pulse-font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --pulse-bg0: #f3f6f9;
    --pulse-bg1: #ffffff;
    --pulse-fg: #14202b;
    --pulse-muted: #5a6b7c;
    --pulse-accent: #1f7a6f;
    --pulse-accent-hi: #2a9d8f;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  max-width: 100%;
  overflow-x: clip;
}

.pulse-login-body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
  font-family: var(--pulse-font);
  color: var(--pulse-fg);
  background:
    radial-gradient(1200px 600px at 10% -10%, #1f3a45 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #24304a 0%, transparent 50%),
    linear-gradient(160deg, var(--pulse-bg0), var(--pulse-bg1));
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(1.5rem, env(safe-area-inset-top, 0px))
    max(1.5rem, env(safe-area-inset-right, 0px))
    max(1.5rem, env(safe-area-inset-bottom, 0px))
    max(1.5rem, env(safe-area-inset-left, 0px));
}

.pulse-login {
  width: min(100%, 22rem);
  min-width: 0;
  max-width: 100%;
}

.pulse-login__brand {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.35rem;
  overflow-wrap: anywhere;
}

.pulse-login__sub {
  margin: 0 0 1.5rem;
  color: var(--pulse-muted);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pulse-login__label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: var(--pulse-muted);
}

.pulse-login__input {
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--pulse-fg) 18%, transparent);
  border-radius: var(--pulse-radius);
  background: color-mix(in srgb, var(--pulse-bg1) 80%, transparent);
  color: var(--pulse-fg);
  font: inherit;
  margin-bottom: 1rem;
  max-width: 100%;
}

.pulse-login__input:focus {
  outline: 2px solid var(--pulse-accent);
  outline-offset: 2px;
}

.pulse-login__btn {
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: var(--pulse-radius);
  background: var(--pulse-accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
}

.pulse-login__btn:hover,
.pulse-login__btn:focus-visible {
  background: var(--pulse-accent-hi);
}

.pulse-login__btn:focus-visible {
  outline: 2px solid var(--pulse-accent-hi);
  outline-offset: 2px;
}

.pulse-login__err {
  color: var(--pulse-danger);
  font-size: 0.9rem;
  margin: 0 0 1rem;
  min-height: 1.2em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (prefers-reduced-motion: no-preference) {
  .pulse-login {
    animation: pulse-fade 220ms ease-out;
  }
}

@keyframes pulse-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
