:root {
  --bg: #0b1020;
  --bg-elevated: rgba(18, 24, 48, 0.82);
  --border: rgba(148, 163, 255, 0.18);
  --text: #eef2ff;
  --muted: #9aa6c8;
  --blue: #4f7cff;
  --blue-2: #6ea8ff;
  --purple: #8b5cf6;
  --purple-2: #a78bfa;
  --green: #34d399;
  --red: #f87171;
  --shadow: 0 18px 50px rgba(8, 12, 30, 0.45);
  --radius: 18px;
  --sans: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  font-family: var(--sans);
  color: var(--text);
  background:
    linear-gradient(rgba(11, 16, 32, 0.55), rgba(11, 16, 32, 0.72)),
    url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?ixlib=rb-4.0.3&auto=format&fit=crop&w=3840&q=85')
      no-repeat center center fixed;
  background-size: cover;
  line-height: 1.45;
}

.bg-glow {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(11, 16, 32, 0.7) 100%);
  opacity: 0.9;
}

.login-page {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 100vh;
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.hero-content {
  max-width: 520px;
}

.logo-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 12px 36px rgba(79, 124, 255, 0.35);
  margin-bottom: 28px;
}

.logo-mark svg { width: 30px; height: 30px; }

.hero-content h1 {
  margin: 0 0 14px;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-tagline {
  margin: 0 0 36px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 440px;
}

.hero-art svg {
  width: 100%;
  max-width: 460px;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(8, 12, 30, 0.5));
}

.form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px;
  background: rgba(11, 16, 32, 0.45);
  border-left: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.form-card {
  width: 100%;
  max-width: 400px;
  padding: 38px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.form-header { margin-bottom: 28px; }
.form-header h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  font-weight: 700;
}
.form-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-form { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #c7d2fe;
}
.field input {
  appearance: none;
  border: 1px solid rgba(110, 168, 255, 0.25);
  background: rgba(11, 16, 32, 0.55);
  color: var(--text);
  border-radius: 12px;
  padding: 13px 15px;
  font: inherit;
  font-size: 0.96rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder { color: #5f6b9a; }
.field input:focus {
  border-color: rgba(167, 139, 250, 0.75);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

.error-message {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  font-size: 0.9rem;
  font-weight: 600;
}

.submit-btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 6px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  cursor: pointer;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 10px 30px rgba(79, 124, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 38px rgba(79, 124, 255, 0.45); }
.submit-btn:disabled { opacity: 0.7; cursor: wait; transform: none; }

.btn-text { line-height: 1; }
.btn-spinner {
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
}
.btn-spinner svg { width: 100%; height: 100%; display: block; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hidden { display: none !important; }

.login-footer {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .hero-panel { display: none; }
  .form-panel {
    border-left: none;
    padding: 28px;
  }
}

@media (max-width: 480px) {
  .form-card { padding: 28px 22px; }
}
