:root {
  --login-surface: #070b10;
  --login-surface-mid: #101820;
  --login-surface-deep: #0b1218;
  --login-panel: #0f1c30;
  --login-line: rgba(148, 163, 184, 0.18);
  --login-line-strong: rgba(148, 163, 184, 0.28);
  --login-brand: #5eead4;
  --login-accent: #157078;
  --login-ink: #f8fafc;
  --login-muted: rgba(226, 232, 240, 0.68);
}

html, body {
  min-height: 100%;
  background: var(--login-surface) !important;
  color: var(--login-ink);
  font-family: system-ui;
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: #475569 #070b10;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar { width: 10px; height: 10px; }
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track { background: #070b10; }
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 999px;
  border: 2px solid #070b10;
}

[x-cloak] { display: none !important; }

.login-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
  overflow: hidden;
  background-color: #070b10;
  background-image:
    radial-gradient(circle at 76% -10%, rgba(20, 184, 166, 0.13), transparent 34rem),
    radial-gradient(ellipse 80% 50% at 0% -10%, rgba(20, 184, 166, 0.16) 0%, transparent 52%),
    radial-gradient(ellipse 55% 40% at 100% 0%, rgba(37, 99, 235, 0.10) 0%, transparent 48%),
    linear-gradient(180deg, #0b1218 0%, #070b10 40rem);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    165deg,
    transparent 30%,
    rgba(94, 234, 212, 0.025) 50%,
    transparent 70%
  );
  background-size: 240% 280%;
  animation: sr-bg-sheen 36s ease-in-out infinite;
}

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

@keyframes sr-bg-sheen {
  0%, 100% { background-position: 18% 0%; }
  50% { background-position: 82% 100%; }
}

.login-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26.5rem;
  animation: login-rise 0.55s ease-out both;
}

@keyframes login-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.25rem;
}

.login-brand a {
  display: block;
}

.login-brand img {
  height: clamp(2.75rem, 6vw, 3.35rem);
  width: auto;
  object-fit: contain;
  filter: brightness(1.05);
}

.login-panel {
  border: 1px solid var(--login-line-strong);
  border-radius: 1.15rem;
  background: rgba(15, 28, 48, 0.92);
  box-shadow:
    0 24px 60px -36px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 1.5rem 1.35rem 1.4rem;
}

@media (min-width: 480px) {
  .login-panel { padding: 1.75rem 1.7rem 1.55rem; }
}

.login-panel-title {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--login-ink);
  text-align: center;
}

.login-panel-sub {
  margin: 0 0 1.35rem;
  font-size: 0.875rem;
  color: var(--login-muted);
  text-align: center;
}

.login-field {
  margin-bottom: 1rem;
}

.login-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  font-weight: 550;
  color: rgba(226, 232, 240, 0.82);
}

.login-label .req {
  color: #fca5a5;
  margin-left: 0.15rem;
}

.login-input-wrap {
  position: relative;
}

.login-input {
  width: 100%;
  height: 2.85rem;
  border-radius: 0.7rem;
  border: 1px solid var(--login-line);
  background: rgba(15, 23, 42, 0.55);
  color: var(--login-ink);
  padding: 0.65rem 0.95rem;
  font-size: 0.9375rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-input::placeholder {
  color: rgba(148, 163, 184, 0.55);
}

.login-input:focus {
  border-color: rgba(94, 234, 212, 0.55);
  box-shadow: 0 0 0 3px rgba(21, 112, 120, 0.35);
  background: rgba(15, 23, 42, 0.75);
}

.login-input--password {
  padding-right: 2.75rem;
}

.login-eye {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
}

.login-eye:hover { color: var(--login-brand); }

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.15rem 0 1.25rem;
  flex-wrap: wrap;
}

.login-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.84rem;
  color: var(--login-muted);
  cursor: pointer;
  user-select: none;
}

.login-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--login-accent);
  cursor: pointer;
}

.login-link {
  font-size: 0.84rem;
  font-weight: 550;
  color: var(--login-brand);
  text-decoration: none;
}

.login-link:hover { color: #99f6e4; }

.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 2.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.7rem;
  background: var(--login-accent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.login-submit:hover:not(:disabled) {
  background: #12656c;
}

.login-submit:active:not(:disabled) {
  transform: translateY(1px);
}

.login-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.login-status {
  min-height: 1.25rem;
  margin-top: 0.7rem;
  font-size: 0.84rem;
  color: var(--login-muted);
  text-align: center;
}

.login-status.is-error {
  color: #fca5a5;
}

.login-status.is-ok {
  color: var(--login-brand);
}

.login-alert {
  margin: 0 0 1.15rem;
  padding: 0.85rem 0.95rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(252, 165, 165, 0.28);
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
  font-size: 0.875rem;
  text-align: center;
  line-height: 1.45;
}

.login-alert.is-ok {
  border-color: rgba(94, 234, 212, 0.28);
  background: rgba(15, 118, 110, 0.18);
  color: #99f6e4;
}

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

.login-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: login-spin 0.85s linear infinite;
  margin-right: 0.5rem;
}

@keyframes login-spin {
  to { transform: rotate(360deg); }
}

.login-foot {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.7);
}

.login-foot .sep {
  margin: 0 0.35rem;
  color: rgba(148, 163, 184, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  .login-page::before,
  .login-shell { animation: none; }
}
