.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: Manrope, 'DM Sans', sans-serif;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(224, 176, 255, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 100%, rgba(224, 176, 255, 0.22), transparent 50%),
    var(--page-bg);
  position: relative;
  overflow: hidden;
}

.login-page::before,
.login-page::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  animation: loginFloat 12s ease-in-out infinite alternate;
}

.login-page::before {
  width: 320px;
  height: 320px;
  top: -80px;
  right: 10%;
  background: rgba(224, 176, 255, 0.25);
}

.login-page::after {
  width: 260px;
  height: 260px;
  bottom: -60px;
  left: 8%;
  background: rgba(224, 176, 255, 0.18);
  animation-delay: -4s;
}

@keyframes loginFloat {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(24px) scale(1.05); }
}

.login-theme {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 5;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: min(620px, calc(100vh - 48px));
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow:
    0 24px 64px -24px rgba(42, 26, 51, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  animation: loginReveal 0.5s ease both;
}

@keyframes loginReveal {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.login-hero {
  position: relative;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  text-align: center;
  background:
    linear-gradient(155deg, rgba(224, 176, 255, 0.42) 0%, rgba(245, 232, 255, 0.95) 45%, var(--surface) 100%);
  overflow: hidden;
}

html[data-theme="dark"] .login-hero {
  background:
    linear-gradient(155deg, rgba(224, 176, 255, 0.14) 0%, rgba(26, 18, 36, 0.98) 55%, var(--surface) 100%);
}

.login-hero-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  top: -40px;
  right: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 176, 255, 0.55), transparent 70%);
  pointer-events: none;
}

.login-hero-illustration {
  position: relative;
  z-index: 1;
  width: 220px;
  height: 220px;
}

.login-hero-circle {
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 24px 48px -20px rgba(224, 176, 255, 0.65);
}

.login-hero-badge {
  position: absolute;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface);
  color: var(--brand);
  font-size: 20px;
  box-shadow: 0 12px 24px -10px rgba(224, 176, 255, 0.7);
}

.login-hero-badge-top {
  top: 6px;
  right: -6px;
}

.login-hero-badge-bottom {
  bottom: 6px;
  left: -6px;
  border-radius: 50%;
}

.login-hero-copy {
  position: relative;
  z-index: 1;
}

.login-hero h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  max-width: 18ch;
  margin-inline: auto;
}

.login-hero > .login-hero-copy > p {
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 34ch;
}

.login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 44px;
}

.login-form-inner {
  width: min(380px, 100%);
  margin: 0 auto;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  margin-bottom: 28px;
}

.login-brand strong {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.login-brand span {
  font-size: 14px;
  color: var(--muted);
}

.login-field {
  margin-bottom: 18px;
}

.login-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.login-field-head label {
  margin-bottom: 0;
}

.login-forgot {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.login-forgot:hover {
  text-decoration: underline;
}

.login-field-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.login-optional {
  font-weight: 500;
  color: var(--muted);
}

.login-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--field-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(224, 176, 255, 0.2);
}

.login-input-wrap i {
  color: var(--muted);
  font-size: 18px;
  flex-shrink: 0;
}

.login-input-wrap input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 13px 0;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  outline: none;
  min-width: 0;
}

.login-toggle-visibility {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 4px;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.login-toggle-visibility:hover {
  color: var(--ink);
}

.login-actions {
  margin-top: 4px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.login-submit {
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 0;
  padding: 14px 20px !important;
  border-radius: 14px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  box-shadow: 0 10px 28px -10px rgba(224, 176, 255, 0.9);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.login-submit-icon {
  font-size: 18px;
  opacity: 0.85;
  transition: transform 0.15s ease;
}

.login-submit:hover:not(:disabled) .login-submit-icon {
  transform: translateX(2px);
}

.login-submit:disabled .login-submit-icon {
  display: none;
}

.login-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px -8px rgba(224, 176, 255, 1);
}

.login-submit:disabled {
  opacity: 0.72;
  cursor: wait;
}

.login-submit .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(42, 26, 51, 0.2);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: loginSpin 0.7s linear infinite;
  vertical-align: -3px;
  margin-right: 8px;
}

@keyframes loginSpin {
  to { transform: rotate(360deg); }
}

.login-notice {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.login-notice:empty {
  display: none;
  margin-bottom: 0;
}

.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
}

.login-alert[hidden] {
  display: none !important;
}

.login-alert i {
  font-size: 18px;
  margin-top: 1px;
  flex-shrink: 0;
}

.login-alert.error {
  background: rgba(185, 28, 28, 0.08);
  color: #b91c1c;
  border: 1px solid rgba(185, 28, 28, 0.15);
}

.login-alert.ok {
  background: rgba(22, 163, 74, 0.08);
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.15);
}

.login-alert.info {
  background: var(--brand-soft);
  color: var(--ink);
  border: 1px solid var(--line);
}

.login-copyright {
  margin: 24px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-hero {
    display: none;
  }

  .login-form-panel {
    padding: 36px 28px 40px;
  }
}

@media (max-width: 480px) {
  .login-page {
    padding: 16px;
    align-items: flex-start;
    padding-top: 72px;
  }

  .login-shell {
    border-radius: 22px;
  }

  .login-form-panel {
    padding: 28px 20px 32px;
  }

  .login-form-panel h1 {
    font-size: 26px;
  }
}
