:root {
  --login-ink: #1f4b45;
  --login-muted: rgba(40, 97, 88, 0.78);
  --login-line: rgba(255, 255, 255, 0.72);
  --login-glass: rgba(235, 250, 247, 0.23);
  --login-glass-deep: rgba(222, 244, 240, 0.1);
  --login-accent: #3b8e7f;
  --login-accent-2: #78c2b5;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body.login-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--login-ink);
  background:
    linear-gradient(115deg, rgba(15, 48, 91, 0.24), rgba(230, 241, 255, 0.08)),
    url('../../login/wood-desk-bg.jpg') center / cover no-repeat fixed;
  isolation: isolate;
}

body.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 49% 45%, rgba(255, 255, 255, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(16, 48, 88, 0.05), rgba(10, 38, 78, 0.18));
}

.login-shell {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 48px 20px;
  margin: 0;
}

.login-glass-card {
  position: relative;
  width: min(390px, calc(100vw - 32px));
  padding: 28px 34px 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.36), rgba(222, 238, 255, 0.14) 48%, rgba(255, 255, 255, 0.18)),
    var(--login-glass-deep);
  box-shadow:
    0 28px 80px rgba(17, 47, 86, 0.32),
    0 8px 24px rgba(24, 65, 116, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 1px 0 0 rgba(255, 255, 255, 0.42),
    inset 0 -1px 0 rgba(59, 142, 127, 0.14);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.login-glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.52), transparent 24%, transparent 72%, rgba(255, 255, 255, 0.2)),
    radial-gradient(circle at 16% 5%, rgba(255, 255, 255, 0.48), transparent 24%);
  opacity: 0.65;
  mix-blend-mode: screen;
}

.login-glass-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: 21px;
  border: 1px solid rgba(59, 142, 127, 0.14);
}

.login-glass-card > * {
  position: relative;
  z-index: 1;
}

.login-glass-card .bear-form {
  width: 100%;
  gap: 16px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.login-glass-card .bear-form > figure {
  position: relative;
  display: grid;
  place-items: center;
  width: 146px;
  height: 146px;
  margin: 0 auto 2px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.54), rgba(210, 231, 255, 0.2));
  box-shadow:
    0 14px 32px rgba(31, 83, 154, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(59, 142, 127, 0.18);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

.login-glass-card .bear-avatar,
.login-glass-card .bear-avatar::after {
  width: 130px;
  height: 130px;
}

.login-glass-card .bear-avatar {
  position: relative;
  display: block;
  flex: 0 0 130px;
  margin: 0;
  overflow: hidden;
  background-color: rgba(225, 239, 255, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.login-glass-card .bear-avatar::after {
  inset: 0;
}

/* The idle image is only a loading fallback. Once the sprite is ready it
   must disappear, otherwise overflow clipping paints it over the animation. */
.login-glass-card .bear-avatar.sprite::after {
  opacity: 0;
  visibility: hidden;
}

.login-copy {
  margin: -2px 0 2px;
  text-align: center;
}

.login-copy h1 {
  margin: 0;
  color: #286158;
  font-size: clamp(1.65rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.login-copy p {
  margin: 4px 0 0;
  color: var(--login-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.login-alerts {
  width: 100%;
}

.login-alerts .alert {
  margin: 0 0 2px;
  padding: 9px 38px 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 11px;
  background: rgba(255, 240, 240, 0.54);
  color: #7b2525;
  font-size: 0.8rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.login-field {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
}

.login-field label {
  display: block;
  margin: 0 0 6px;
  color: rgba(23, 58, 103, 0.88);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.login-input-shell {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.login-input-shell > i {
  position: absolute;
  left: 14px;
  z-index: 2;
  color: rgba(59, 142, 127, 0.82);
  font-size: 1rem;
  pointer-events: none;
}

.login-glass-card .bear-form input[type="text"],
.login-glass-card .bear-form input[type="password"] {
  width: 100%;
  height: 48px;
  padding: 0 46px 0 42px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 10px;
  outline: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.32), rgba(228, 240, 255, 0.14));
  color: #1f4b45;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 6px 18px rgba(59, 142, 127, 0.1);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.login-glass-card .bear-form input::placeholder {
  color: rgba(31, 75, 132, 0.48);
  font-weight: 500;
}

.login-glass-card .bear-form input:focus {
  border-color: rgba(59, 142, 127, 0.74);
  background: rgba(255, 255, 255, 0.48);
  box-shadow:
    0 0 0 3px rgba(59, 142, 127, 0.15),
    0 8px 22px rgba(59, 142, 127, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transform: translateY(-1px);
}

.login-glass-card .bear-form .password-visibility {
  position: absolute;
  right: 13px;
  bottom: 9px;
  z-index: 3;
  width: 30px;
  height: 30px;
  padding: 5px;
  border: 0;
  border-radius: 50%;
  color: #3b8e7f;
  background: rgba(255, 255, 255, 0.18);
  transform: none;
}

.login-glass-card .bear-form .password-visibility:hover {
  background: rgba(255, 255, 255, 0.38);
}

.login-glass-card .bear-form button[type="submit"] {
  width: auto;
  min-width: 132px;
  margin-top: 5px;
  padding: 10px 22px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 10px;
  background: linear-gradient(135deg, #78c2b5 0%, #3b8e7f 100%);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow:
    0 10px 24px rgba(50, 121, 109, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.login-glass-card .bear-form button[type="submit"]:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 14px 30px rgba(50, 121, 109, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
  filter: brightness(1.05);
}

.login-glass-card .bear-form button[type="submit"]:active {
  transform: translateY(0) scale(0.99);
}

.login-footer {
  margin-top: 18px;
  text-align: center;
  color: rgba(27, 60, 103, 0.72);
  font-size: 0.72rem;
  font-weight: 600;
}

@media (max-width: 575px) {
  body.login-page {
    background-attachment: scroll;
    background-position: 48% center;
  }

  .login-shell {
    padding: 22px 16px;
  }

  .login-glass-card {
    padding: 24px 22px 21px;
    border-radius: 20px;
    backdrop-filter: blur(18px) saturate(138%);
    -webkit-backdrop-filter: blur(18px) saturate(138%);
  }

  .login-glass-card .bear-form > figure {
    width: 146px;
    height: 146px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-glass-card *,
  .login-glass-card *::before,
  .login-glass-card *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
