:root {
  --bg: #0a1014;
  --panel: rgba(15, 22, 28, 0.78);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #e8ece9;
  --muted: #9aadb8;
  --accent: #00c2a8;
  --danger: #e05252;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.splash-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    url("/splash.png") center / cover no-repeat,
    var(--bg);
  transform: scale(1.04);
  transition: transform 2.4s ease-out;
}

body.splash-ready .splash-bg {
  transform: scale(1);
}

.splash-veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(180deg, rgba(6, 12, 16, 0.35) 0%, rgba(6, 12, 16, 0.72) 100%);
  opacity: 0.55;
  transition: opacity 0.7s ease;
}

body.splash-ready .splash-veil {
  opacity: 1;
}

.login-page {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-form {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 24px 22px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  pointer-events: none;
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
}

body.splash-ready .login-form {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.login-title {
  margin: 0 0 8px;
  font-size: 1.65rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

input {
  width: 100%;
  background: rgba(10, 16, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
}

input::placeholder {
  color: var(--muted);
}

input:focus {
  outline: none;
  border-color: rgba(0, 194, 168, 0.65);
  box-shadow: 0 0 0 3px rgba(0, 194, 168, 0.18);
}

button.primary {
  width: 100%;
  background: var(--accent);
  color: #06231d;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
}

button.primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

button.primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
  min-height: 0;
  margin: 0;
  text-align: center;
}

.error:empty {
  display: none;
}

.login-footer {
  margin: 8px 0 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.login-footer span {
  color: var(--muted);
  font-size: 0.8rem;
}

.login-footer a {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.login-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .splash-bg,
  .splash-veil,
  .login-form {
    transition: none;
  }

  .splash-bg {
    transform: none;
  }
}
