@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

html, body {
  height: 100%;
  font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
  background: linear-gradient(135deg, #0d1b2a 0%, #162032 40%, #0d1b2a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f0f4f8;
}

/* Subtle grid overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── Card ─────────────────────────────────────────────────────────── */
.auth-container {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 2.75rem 2.5rem;
  width: 100%;
  max-width: 448px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(255, 255, 255, 0.07) inset;
}

/* ── Brand header ─────────────────────────────────────────────────── */
.auth-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-radius: 14px;
  font-size: 1.6rem;
  margin-bottom: 0.9rem;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
}

.auth-brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.4px;
  margin-bottom: 0.2rem;
}

.auth-brand p {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* ── Section headings ─────────────────────────────────────────────── */
.auth-container h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.4px;
  margin-bottom: 0.3rem;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.48);
  margin-bottom: 1.8rem;
}

/* ── Error alert ──────────────────────────────────────────────────── */
.auth-errors {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 9px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.3rem;
  font-size: 0.855rem;
  color: #fca5a5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Form groups ──────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label,
.auth-container p > label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Inputs — covers both .form-group children AND Django's {{ form.as_p }} output */
.auth-container input[type="text"],
.auth-container input[type="email"],
.auth-container input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 9px;
  color: #ffffff;
  font-size: 0.93rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.auth-container input[type="text"]:focus,
.auth-container input[type="email"]:focus,
.auth-container input[type="password"]:focus {
  outline: none;
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.auth-container input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

/* Django {{ form.as_p }} wraps each field in <p> */
.auth-container p {
  margin-bottom: 1.1rem;
}

/* ── Error lists (Django field errors) ─────────────────────────────── */
.auth-container .errorlist {
  list-style: none;
  padding: 0;
  margin: 0.3rem 0 0;
}

.auth-container .errorlist li {
  font-size: 0.79rem;
  color: #fca5a5;
}

/* ── Primary button ───────────────────────────────────────────────── */
.auth-container button[type="submit"] {
  width: 100%;
  padding: 0.82rem;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: 9px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  letter-spacing: 0.2px;
  transition: all 0.18s ease;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.42);
  margin-top: 0.4rem;
}

.auth-container button[type="submit"]:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.52);
}

.auth-container button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

/* ── Secondary button (Sign Up) ───────────────────────────────────── */
.btn-auth-secondary {
  display: block;
  width: 100%;
  padding: 0.72rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.18s ease;
}

.btn-auth-secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  text-decoration: none;
}

/* ── Divider ──────────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.4rem 0;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

/* ── Footer text ──────────────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  margin-top: 1.4rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.38);
}

/* ── Links ────────────────────────────────────────────────────────── */
.auth-container a {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.auth-container a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

/* ── Logout message ───────────────────────────────────────────────── */
.logout-message {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  color: #fcd34d;
  text-align: center;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-container {
    padding: 2rem 1.5rem;
    margin: 1rem;
    max-width: 100%;
    border-radius: 14px;
  }
}
