/* =====================================================
   assets/css/login.css  —  ULTRA PREMIUM v3
   ===================================================== */

/* ── Base Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ══════════════════════════════════════════════════════
   FULL-PAGE SHELL
══════════════════════════════════════════════════════ */
.auth-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.10), transparent 30%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.08), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #edf2f7 100%);
}

/* ── Subtle grid mesh ── */
.auth-mesh {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════
   CARD — GLASSMORPHISM HERO
══════════════════════════════════════════════════════ */
.auth-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;

  /* Glass base */
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);

  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  padding: 2.8rem 2.6rem 2.4rem;
  color: #0f172a;

  box-shadow:
    0 18px 50px rgba(15, 23, 42, 0.10),
    0 0 0 1px rgba(255, 255, 255, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);

  animation: none;

  /* Smooth tilt reset */
  transition: box-shadow 0.4s ease;
  will-change: transform;
}

.auth-card--single {
  max-width: 560px;
}

.auth-heading--compact { margin-bottom: 1.35rem; }

.input-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
}

.input-label-row label {
  color: #cbd5e1;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0;
}

.login-meta {
  gap: 1rem;
  font-size: 0.8rem;
}

.login-hint {
  color: #64748b;
  display: inline-flex;
  align-items: center;
}

.login-alert {
  padding: 1rem 1rem 0.9rem;
}

.login-alert-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fecaca;
  margin-bottom: 0.5rem;
}

.auth-card--single .auth-footer { margin-top: 1.1rem; }

/* ── Shimmering rainbow top border ── */
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 28px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(99,102,241,0.36), rgba(6,182,212,0.22), rgba(255,255,255,0.08));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ── Inner glow streak at top ── */
.auth-card::after {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148,163,184,0.35), transparent);
  border-radius: 50%;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════
   LOGO
══════════════════════════════════════════════════════ */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.6rem;
}

.logo-icon {
  position: relative;
  font-size: 2.6rem;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.35));
}

.logo-text {
  font-family: 'Poppins', sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, #e0d7ff 0%, #a5b4fc 40%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text small {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #475569;
  -webkit-text-fill-color: #475569;
  margin-top: 3px;
}

/* ══════════════════════════════════════════════════════
   ROLE BADGE SWITCHER
══════════════════════════════════════════════════════ */
.role-info {
  display: flex;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-radius: 999px;
  padding: 6px;
  gap: 6px;
  margin-bottom: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 
    0 10px 30px rgba(15, 23, 42, 0.04), 
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.role-badge {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 10px 8px;
  border-radius: 50px;
  color: #334155;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.role-badge i { margin-right: 5px; font-size: 0.72rem; }

.role-badge:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

/* Active states with glow */
.role-badge.active.admin {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37,99,235,0.28), inset 0 1px 0 rgba(255,255,255,0.18);
  transform: none;
}
.role-badge.active.staff {
  background: linear-gradient(135deg, #ea580c, #ff781f);
  color: #fff;
  box-shadow: 0 8px 18px rgba(234,88,12,0.26), inset 0 1px 0 rgba(255,255,255,0.18);
  transform: none;
}
.role-badge.active.warden {
  background: linear-gradient(135deg, #6d28d9, #8b5cf6);
  color: #fff;
  box-shadow: 0 8px 18px rgba(139,92,246,0.26), inset 0 1px 0 rgba(255,255,255,0.18);
  transform: none;
}
.role-badge.active.student {
  background: linear-gradient(135deg, #047857, #10b981);
  color: #fff;
  box-shadow: 0 8px 18px rgba(16,185,129,0.26), inset 0 1px 0 rgba(255,255,255,0.18);
  transform: none;
}

/* ══════════════════════════════════════════════════════
   AUTH HEADING
══════════════════════════════════════════════════════ */
.auth-heading {
  text-align: center;
  margin-bottom: 1.8rem;
}

.auth-heading h2 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.55rem;
  margin-bottom: 0.45rem;
  color: #0f172a;
}

.auth-heading p {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 0;
  letter-spacing: 0.01em;
}

/* ══════════════════════════════════════════════════════
   FORM INPUTS
══════════════════════════════════════════════════════ */
.auth-input-group {
  position: relative;
  margin-bottom: 1.1rem;
}

/* Staggered entrance */
.auth-input-group:nth-of-type(1) { animation: fadeSlideUp 0.6s cubic-bezier(0.16,1,0.3,1) 0.30s both; }
.auth-input-group:nth-of-type(2) { animation: fadeSlideUp 0.6s cubic-bezier(0.16,1,0.3,1) 0.37s both; }
/* keep input motion subtle but not flashy */
.auth-input-group:nth-of-type(1),
.auth-input-group:nth-of-type(2) { animation: none; }

.auth-input-group .input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.82rem;
  pointer-events: none;
  transition: color 0.3s ease, transform 0.3s ease;
  z-index: 2;
}

.auth-input-group:focus-within .input-icon {
  color: #2563eb;
  transform: translateY(-50%) scale(1.1);
}

.auth-input-group .form-control {
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 13px 44px;
  color: #0f172a;
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.auth-input-group .form-control::placeholder { color: #94a3b8; }

.auth-input-group .form-control:focus {
  outline: none;
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
  color: #0f172a;
}

/* Subtle focus underline */
.auth-input-group::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 12%; right: 12%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  transform: scaleX(0);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.auth-input-group:focus-within::after {
  transform: scaleX(1);
  opacity: 1;
}

.auth-input-group .toggle-pw {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  font-size: 0.8rem;
  transition: color 0.25s ease, transform 0.25s ease;
  z-index: 2;
}

.auth-input-group .toggle-pw:hover {
  color: #2563eb;
  transform: translateY(-50%) scale(1.08);
}

/* ══════════════════════════════════════════════════════
   REMEMBER / FORGOT ROW
══════════════════════════════════════════════════════ */
.form-check-label {
  color: #475569 !important;
  font-size: 0.81rem;
  cursor: pointer;
  transition: color 0.2s;
}
.form-check-label:hover { color: #0f172a !important; }

.form-check-input {
  background-color: rgba(255,255,255,0.95);
  border-color: rgba(148,163,184,0.24);
}
.form-check-input:checked {
  background-color: #2563eb;
  border-color: #2563eb;
}

a.hover-white {
  transition: color 0.2s ease !important;
}
a.hover-white:hover { color: #1d4ed8 !important; }

/* ══════════════════════════════════════════════════════
   SUBMIT BUTTON
══════════════════════════════════════════════════════ */
.auth-btn {
  width: 100%;
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 12px;
  padding: 14px;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.03em;
  cursor: pointer;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  box-shadow:
    0 8px 22px rgba(37, 99, 235, 0.28),
    inset 0 1px 0 rgba(255,255,255,0.10);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.34), inset 0 1px 0 rgba(255,255,255,0.12);
}

.auth-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 5px 14px rgba(37,99,235,0.24);
}

.auth-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  animation: none;
}

/* ══════════════════════════════════════════════════════
   ALERTS
══════════════════════════════════════════════════════ */
.alert-danger {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.18);
  color: #991b1b;
  border-radius: 12px;
  font-size: 0.83rem;
}

/* ══════════════════════════════════════════════════════
   FOOTER LINK
══════════════════════════════════════════════════════ */
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.81rem;
  color: #64748b;
}

.auth-footer a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  position: relative;
  transition: color 0.25s ease;
}

.auth-footer a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.auth-footer a:hover { color: #1d4ed8; }
.auth-footer a:hover::after { transform: scaleX(1); }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 520px) {
  .auth-card  { padding: 2.2rem 1.5rem; border-radius: 22px; }
  .role-badge { font-size: 0.65rem; padding: 7px 4px; }
  .role-badge i { display: none; }
  .logo-text  { font-size: 1.4rem; }
}

@media (max-width: 720px) {
  .login-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Back Button */
.auth-back-btn {
  position: absolute;
  top: 24px;
  left: 26px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: color 0.2s ease, transform 0.2s ease;
  z-index: 100;
}
.auth-back-btn:hover {
  color: #0f172a;
  transform: translateX(-3px);
}
@media (max-width: 520px) {
  .auth-back-btn {
    top: 16px;
    left: 18px;
    font-size: 0.76rem;
  }
}
