/* =============================================
   Auth Pages — Modern Glassmorphism Theme
   Used by login.php & register.php
   ============================================= */

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

/* ---------- Root Tokens ---------- */
:root {
  --auth-bg-from: #0a1628;
  --auth-bg-to: #1e293b;
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.35);
  --input-bg: rgba(255, 255, 255, 0.07);
  --input-border: rgba(255, 255, 255, 0.15);
  --input-focus-border: var(--accent);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body.auth-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--auth-bg-from), var(--auth-bg-to));
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
}

/* ---------- Animated Background Shapes ---------- */
.auth-bg-shapes {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.auth-bg-shapes span {
  position: absolute;
  display: block;
  border: 2px solid rgba(59, 130, 246, 0.15);
  border-radius: 6px;
  animation: float-shape linear infinite;
  opacity: 0;
}

.auth-bg-shapes span:nth-child(1)  { width: 80px;  height: 80px;  top: 10%; left: 5%;   animation-duration: 18s; animation-delay: 0s;   }
.auth-bg-shapes span:nth-child(2)  { width: 50px;  height: 50px;  top: 70%; left: 15%;  animation-duration: 22s; animation-delay: 2s;   }
.auth-bg-shapes span:nth-child(3)  { width: 120px; height: 120px; top: 30%; left: 80%;  animation-duration: 25s; animation-delay: 4s;   }
.auth-bg-shapes span:nth-child(4)  { width: 60px;  height: 60px;  top: 85%; left: 70%;  animation-duration: 20s; animation-delay: 1s;   }
.auth-bg-shapes span:nth-child(5)  { width: 40px;  height: 40px;  top: 50%; left: 45%;  animation-duration: 28s; animation-delay: 3s;   }
.auth-bg-shapes span:nth-child(6)  { width: 90px;  height: 90px;  top: 15%; left: 55%;  animation-duration: 24s; animation-delay: 5s;   }
.auth-bg-shapes span:nth-child(7)  { width: 70px;  height: 70px;  top: 60%; left: 90%;  animation-duration: 19s; animation-delay: 0.5s; }
.auth-bg-shapes span:nth-child(8)  { width: 100px; height: 100px; top: 40%; left: 25%;  animation-duration: 26s; animation-delay: 6s;   }

@keyframes float-shape {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-120vh) rotate(720deg); opacity: 0; }
}

/* ---------- Card ---------- */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 1.5rem;
  padding: 2.5rem 2.25rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: fadeSlideUp 0.6s ease-out both;
}

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

/* ---------- Logo ---------- */
.auth-logo {
  display: block;
  margin: 0 auto 1.25rem;
  height: 72px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.3));
}

/* ---------- Headings ---------- */
.auth-title {
  font-size: 1.625rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 1.75rem;
}

/* ---------- Form Groups ---------- */
.auth-field {
  position: relative;
  margin-bottom: 1.25rem;
}

.auth-field .field-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1rem;
  transition: color 0.2s;
  pointer-events: none;
}

.auth-field input,
.auth-field select {
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 2.75rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}

.auth-field select option {
  background: #1e293b;
  color: var(--text-primary);
}

.auth-field input::placeholder {
  color: var(--text-secondary);
}

.auth-field input:focus,
.auth-field select:focus {
  border-color: var(--input-focus-border);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-field input:focus ~ .field-icon,
.auth-field select:focus ~ .field-icon {
  color: var(--accent);
}

/* Password toggle */
.auth-field .toggle-password {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.05rem;
  padding: 0;
  transition: color 0.2s;
}

.auth-field .toggle-password:hover {
  color: var(--accent);
}

/* ---------- Checkbox ---------- */
.auth-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-remember input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.auth-remember label {
  cursor: pointer;
  margin: 0;
}

/* ---------- Submit Button ---------- */
.auth-btn {
  display: block;
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.25s, filter 0.25s;
  box-shadow: 0 4px 15px var(--accent-glow);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
  filter: brightness(1.1);
}

.auth-btn:active {
  transform: translateY(0);
}

/* ---------- Alerts ---------- */
.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  text-align: center;
  animation: fadeSlideUp 0.4s ease-out both;
}

.auth-alert.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.auth-alert.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

/* ---------- Links ---------- */
.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 2;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-back-link:hover {
  color: var(--accent);
}

/* ---------- Footer ---------- */
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .auth-card {
    padding: 2rem 1.5rem;
    margin: 1rem;
  }

  .auth-logo {
    height: 56px;
  }

  .auth-title {
    font-size: 1.375rem;
  }
}
