:root {
  --login-bg: #07111f;
  --login-bg-alt: #0b172b;
  --login-surface: rgba(11, 23, 43, 0.84);
  --login-surface-strong: rgba(14, 28, 52, 0.96);
  --login-border: rgba(84, 124, 189, 0.16);
  --login-text: #edf3ff;
  --login-muted: #8ea4c7;
  --login-accent: #4b7dff;
  --login-accent-soft: rgba(75, 125, 255, 0.16);
  --login-shadow: 0 28px 65px rgba(2, 8, 20, 0.32);
  --login-shadow-soft: 0 14px 30px rgba(2, 8, 20, 0.22);
  --login-radius-xl: 32px;
  --login-radius-lg: 26px;
  --login-radius-md: 18px;
  --login-danger: #ff7b81;
}

* {
  box-sizing: border-box;
}

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

html {
  background: #07111f;
}

body.login-page {
  font-family: 'Manrope', sans-serif;
  color: var(--login-text);
  background:
    radial-gradient(circle at 12% 20%, rgba(75, 125, 255, 0.18), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(40, 119, 223, 0.16), transparent 22%),
    linear-gradient(180deg, #07111f 0%, #0a1628 100%);
  position: relative;
  overflow-x: hidden;
}

body.login-page::before,
body.login-page::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

body.login-page::before {
  inset: auto auto -14rem -12rem;
  width: 30rem;
  height: 30rem;
  background: radial-gradient(circle, rgba(108, 220, 190, 0.18) 0%, rgba(108, 220, 190, 0) 72%);
  filter: blur(16px);
}

body.login-page::after {
  inset: -16rem -8rem auto auto;
  width: 30rem;
  height: 30rem;
  background: radial-gradient(circle, rgba(86, 96, 255, 0.24) 0%, rgba(86, 96, 255, 0) 72%);
  filter: blur(20px);
}

.login-shell {
  position: relative;
  z-index: 1;
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.login-showcase,
.login-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--login-radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--login-shadow);
}

.login-showcase {
  padding: 34px;
  min-height: 620px;
  background:
    linear-gradient(135deg, rgba(8, 17, 33, 0.94), rgba(12, 24, 46, 0.94));
  color: #edf3ff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
}

.login-showcase::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(75, 125, 255, 0.26), transparent 20%),
    radial-gradient(circle at 84% 20%, rgba(40, 119, 223, 0.18), transparent 18%);
  opacity: 0.92;
  z-index: -1;
}

.login-status,
.login-chip,
.feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-status {
  align-self: flex-start;
  color: #cfd4ff;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

.login-copy h1 {
  margin: 18px 0 16px;
  max-width: 8ch;
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.login-copy h1 span {
  color: #7db2ff;
}

.login-copy p {
  margin: 0;
  max-width: 30ch;
  color: rgba(237, 243, 255, 0.7);
  line-height: 1.6;
}

.showcase-card,
.showcase-feature {
  border-radius: var(--login-radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(84, 124, 189, 0.14);
  box-shadow: var(--login-shadow-soft);
  backdrop-filter: blur(18px);
}

.showcase-card strong,
.showcase-feature strong {
  display: block;
  margin-top: 12px;
  font-size: 1rem;
}

.showcase-card span:last-child,
.showcase-feature p {
  display: block;
  margin-top: 6px;
  color: rgba(237, 243, 255, 0.7);
  line-height: 1.6;
  font-size: 0.93rem;
}

.showcase-footer {
  display: grid;
  gap: 16px;
}

.showcase-feature {
  padding: 20px;
}

.feature-chip {
  color: #bfd2ff;
  background: rgba(75, 125, 255, 0.10);
  border: 1px solid rgba(75, 125, 255, 0.16);
}

.showcase-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.showcase-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: rgba(237, 243, 255, 0.78);
  line-height: 1.6;
}

.showcase-list .material-symbols-outlined {
  margin-top: 2px;
  color: #7db2ff;
}

.login-card {
  padding: 34px;
  background: linear-gradient(180deg, rgba(11, 23, 43, 0.92), rgba(14, 28, 52, 0.92));
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.login-card::before {
  content: '';
  position: absolute;
  inset: auto auto -8rem -6rem;
  width: 18rem;
  height: 18rem;
  background: radial-gradient(circle, rgba(86, 96, 255, 0.10) 0%, rgba(86, 96, 255, 0) 72%);
}

.login-card .glow {
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(84, 124, 189, 0.18);
  pointer-events: none;
}

.login-card-header {
  position: relative;
  z-index: 1;
}

.login-chip {
  color: #bfd2ff;
  background: rgba(75, 125, 255, 0.10);
  border: 1px solid rgba(75, 125, 255, 0.16);
}

.login-card h2 {
  margin: 18px 0 12px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.login-card p {
  margin: 0;
  color: var(--login-muted);
  line-height: 1.55;
}

#login_form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  margin-top: 30px;
}

.field-block {
  display: grid;
  gap: 9px;
}

.field-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #dbe6ff;
}

.input-shell {
  position: relative;
}

.input-shell .material-symbols-outlined,
.password-toggle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.input-shell .material-symbols-outlined {
  left: 16px;
  color: #8ea4c7;
  pointer-events: none;
}

.input-shell input {
  width: 100%;
  min-height: 58px;
  padding: 0 54px 0 50px;
  border-radius: var(--login-radius-md);
  border: 1px solid var(--login-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--login-text);
  font-size: 1rem;
  font-family: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, transform 180ms ease;
}

.input-shell input:focus {
  outline: none;
  border-color: rgba(75, 125, 255, 0.42);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 4px rgba(75, 125, 255, 0.12);
}

.password-toggle {
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #8ea4c7;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(75, 125, 255, 0.10);
  color: var(--login-accent);
  outline: none;
}

.login-actions {
  display: grid;
  gap: 14px;
  margin-top: 4px;
}

#login_form button[type='submit'] {
  min-height: 58px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #183563 0%, #28539b 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 20px 35px rgba(10, 24, 51, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

#login_form button[type='submit']:hover,
#login_form button[type='submit']:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 26px 42px rgba(10, 24, 51, 0.34);
  outline: none;
}

#login_form button[type='submit'][disabled] {
  opacity: 0.75;
  cursor: wait;
  transform: none;
}

.login-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--login-muted);
  font-size: 0.92rem;
}

.login-meta strong {
  color: var(--login-text);
}

#login_error {
  min-height: 20px;
  color: var(--login-danger);
  font-size: 0.95rem;
  font-weight: 700;
}

.fade-up {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 600ms ease forwards;
}

.fade-up.delay-1 { animation-delay: 80ms; }
.fade-up.delay-2 { animation-delay: 160ms; }
.fade-up.delay-3 { animation-delay: 240ms; }
.fade-up.delay-4 { animation-delay: 320ms; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
    padding: 18px 0 28px;
  }

  .login-showcase {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .login-shell {
    width: min(100% - 20px, 100%);
    gap: 18px;
  }

  .login-showcase,
  .login-card {
    padding: 22px;
    border-radius: 28px;
  }

  .login-copy h1 {
    max-width: 12ch;
    font-size: clamp(2.5rem, 14vw, 3.8rem);
  }

  .login-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-up,
  .input-shell input,
  #login_form button[type='submit'],
  .password-toggle {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
