:root {
  --bg-dark: #0a0a0a;
  --bg-dark-2: #111111;
  --accent: #e5e7eb;
  --accent-hover: #d1d5db;
  --text: #f5f5f5;
  --muted: #9ca3af;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-stroke: rgba(255, 255, 255, 0.18);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 6px 16px rgba(0, 0, 0, 0.35);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--text);
  background: var(--bg-dark);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-gradient {
  background: 
    radial-gradient(800px 500px at 20% 15%, rgba(31, 41, 55, 0.6) 0%, rgba(31, 41, 55, 0) 60%),
    radial-gradient(900px 600px at 80% 10%, rgba(31, 41, 55, 0.5) 0%, rgba(31, 41, 55, 0) 65%),
    radial-gradient(700px 500px at 30% 80%, rgba(31, 41, 55, 0.4) 0%, rgba(31, 41, 55, 0) 60%),
    linear-gradient(180deg, var(--bg-dark-2) 0%, var(--bg-dark) 85%);
  z-index: -3;
}

.bg-noise {
  opacity: .12;
  background-image: repeating-radial-gradient(circle at 0 0, rgba(255,255,255,.06), rgba(255,255,255,.06) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: overlay;
  z-index: -2;
}

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 16px 0;
  backdrop-filter: blur(12px);
  background: linear-gradient(to bottom, rgba(17,17,17,.85), rgba(17,17,17,0.6));
  border-bottom: 1px solid rgba(255,255,255,.08);
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.4));
}

.nav-title {
  font-family: "Nunito", sans-serif;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: .2px;
}

.login-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 60px;
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-stroke);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.login-header {
  margin-bottom: 32px;
  text-align: center;
}

.login-header h1 {
  font-family: "Nunito", sans-serif;
  font-weight: 900;
  font-size: 32px;
  background: linear-gradient(135deg, #ffffff 0%, #d1d5db 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-error {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--error-bg);
  border: 1px solid var(--error);
  border-radius: 12px;
  color: var(--error);
  font-size: 14px;
  margin-bottom: 24px;
  animation: shake 0.4s ease;
}

.login-error:not([hidden]) {
  display: flex;
}

.login-error svg {
  flex-shrink: 0;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s ease;
  outline: none;
}

.form-group input::placeholder {
  color: var(--muted);
}

.form-group input:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 231, 235, 0.1);
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  padding-right: 90px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
  border-radius: 6px;
}

.password-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.password-toggle:active {
  transform: scale(0.95);
}

.btn {
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .3s ease;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  outline: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-dark);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.loader {
  animation: spin 1s linear infinite;
}

[hidden] {
  display: none !important;
}

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

.footer {
  padding: 24px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(to top, rgba(17,17,17,.85), rgba(17,17,17,0.6));
  backdrop-filter: blur(12px);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-content p {
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 640px) {
  .login-card {
    padding: 32px 24px;
  }

  .login-header h1 {
    font-size: 28px;
  }

  .login-container {
    padding: 80px 16px 40px;
  }
}
