/* ──────────────────────────────────────────────────────────────
   Auth theme — OnlyPipe-inspired dark login UI
   Shared across superadmin, admin, franchise, student login pages
   ────────────────────────────────────────────────────────────── */

:root {
  --auth-bg-dark: #0a0a0a;
  --auth-bg-input: #161616;
  --auth-border-subtle: #2a2a2a;
  --auth-text-primary: #ffffff;
  --auth-text-muted: #6b7280;
  --auth-accent: #7c3aed;
  --auth-radius-md: 12px;
  --auth-radius-lg: 16px;
  --auth-font: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* Reset minimal (scoped to body so we don't clobber bootstrap on other pages) */
body.auth-body, body.auth-body * { box-sizing: border-box; }
body.auth-body {
  margin: 0; padding: 0;
  height: 100vh; overflow: hidden;
  background: #111111;
  color: var(--auth-text-primary);
  font-family: var(--auth-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.auth-body::-webkit-scrollbar { display: none; }
body.auth-body { scrollbar-width: none; }

/* ── OUTER WRAPPER ── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100%;
  padding: 24px;
}

/* Animated border rotation */
@property --border-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes authRotateBorder { to { --border-angle: 360deg; } }
@keyframes authBreathe {
  0%, 100% { transform: scale(1) translateY(0); }
  50%      { transform: scale(1.25) translateY(-30px); }
}
@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes authSlideRight {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes authSlideLeft {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes authPop {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes authSpin { to { transform: rotate(360deg); } }

.auth-card-wrapper {
  position: relative;
  width: 100%;
  max-width: 1080px;
  height: min(92vh, 700px);
  border-radius: 24px;
  padding: 1px;
  background: conic-gradient(
    from var(--border-angle),
    rgba(147, 51, 234, 0.8) 0%,
    rgba(168, 85, 247, 0.5) 15%,
    transparent 40%,
    transparent 60%,
    rgba(124, 58, 237, 0.3) 85%,
    rgba(147, 51, 234, 0.8) 100%
  );
  animation: authRotateBorder 6s linear infinite;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.3),
    0 16px 48px rgba(0, 0, 0, 0.5),
    0 0 120px rgba(124, 58, 237, 0.06);
}

.auth-card {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  border-radius: 23px;
  overflow: hidden;
  background: linear-gradient(
    160deg,
    rgba(60, 60, 80, 0.25) 0%,
    rgba(20, 20, 25, 0.92) 30%,
    rgba(10, 10, 10, 0.97) 60%,
    rgba(15, 15, 20, 0.95) 100%
  );
  backdrop-filter: blur(20px);
}

/* Glossy sweep */
.auth-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 23px;
  background: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.06) 10%,
    rgba(255, 255, 255, 0.02) 25%,
    transparent 45%,
    transparent 70%,
    rgba(255, 255, 255, 0.015) 90%,
    rgba(255, 255, 255, 0.03) 100%
  );
  z-index: 10;
  pointer-events: none;
}
.auth-card::after {
  content: '';
  position: absolute;
  top: 0; left: 5%; right: 5%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 20%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0.15) 80%,
    transparent 100%
  );
  z-index: 11;
  pointer-events: none;
}

/* ── LEFT PANEL ── */
.auth-left {
  position: relative;
  width: 44%;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 24px 0 0 24px;
  animation: authSlideLeft 0.7s ease-out both;
}

.auth-left__bg {
  position: absolute;
  top: -50px; left: 0; right: 0; bottom: -50px;
  background:
    radial-gradient(ellipse 80% 45% at 50% 30%,
      var(--auth-role-color, #9333ea) 0%,
      var(--auth-role-color-dark, #5b21b6) 30%,
      #1a0533 60%, transparent 85%),
    var(--auth-bg-dark);
  animation: authBreathe 3s ease-in-out infinite;
}
.auth-left__bg::after {
  content: '';
  position: absolute; inset: 0;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  pointer-events: none;
}

.auth-left__content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px 36px;
}

.auth-left__logo {
  position: absolute;
  top: 32px; left: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}
.auth-left__logo img { height: 28px; width: auto; }
.auth-left__logo-text {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-left__title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  max-width: 280px;
  letter-spacing: -0.02em;
  animation: authFadeIn 0.6s ease-out 0.3s both;
}
.auth-left__subtitle {
  color: #cbd5e1;
  font-size: 0.85rem;
  margin-top: 10px;
  max-width: 270px;
  line-height: 1.55;
  animation: authFadeIn 0.6s ease-out 0.4s both;
}

.auth-left__steps {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-step {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 0.82rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  animation: authSlideRight 0.5s ease-out both;
}
.auth-step:nth-child(1) { animation-delay: 0.45s; }
.auth-step:nth-child(2) { animation-delay: 0.53s; }
.auth-step:nth-child(3) { animation-delay: 0.61s; }
.auth-step:nth-child(4) { animation-delay: 0.69s; }

.auth-step--active {
  background: #ffffff;
  color: var(--auth-bg-dark);
  font-weight: 600;
}
.auth-step--inactive {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #d1d5db;
}
.auth-step--inactive:hover {
  background: #1a1a1a;
  border-color: #333;
  color: #fff;
}

.auth-step__num {
  width: 22px; height: 22px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  flex-shrink: 0;
}
.auth-step--active .auth-step__num { background: var(--auth-bg-dark); color: #fff; }
.auth-step--inactive .auth-step__num { background: rgba(255, 255, 255, 0.08); color: #9ca3af; }

/* ── RIGHT PANEL ── */
.auth-right {
  width: 56%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 52px;
  background: var(--auth-bg-dark);
  border-radius: 0 24px 24px 0;
  position: relative;
  z-index: 1;
}

.auth-form {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: authFadeIn 0.5s ease-out 0.2s both;
}

.auth-form__heading { animation: authFadeIn 0.45s ease-out 0.3s both; }
.auth-form__title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--auth-text-primary);
  margin: 0;
}
.auth-form__subtitle {
  color: var(--auth-text-muted);
  font-size: 0.82rem;
  margin-top: 4px;
  line-height: 1.4;
}

/* ── INPUT ── */
.auth-input-group { display: flex; flex-direction: column; animation: authFadeIn 0.45s ease-out both; }
.auth-input-group:nth-of-type(1) { animation-delay: 0.37s; }
.auth-input-group:nth-of-type(2) { animation-delay: 0.45s; }

.auth-input-label {
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--auth-text-primary);
}
.auth-input-wrap { position: relative; }
.auth-input {
  width: 100%;
  background: var(--auth-bg-input);
  border: 1px solid var(--auth-border-subtle);
  border-radius: var(--auth-radius-md);
  padding: 11px 14px;
  color: var(--auth-text-primary);
  font-size: 0.85rem;
  font-family: var(--auth-font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-input::placeholder { color: #4b5563; }
.auth-input:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}
.auth-input--has-icon { padding-right: 44px; }

.auth-input-icon {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer;
  color: var(--auth-text-muted);
  display: flex;
  align-items: center; justify-content: center;
  padding: 4px;
  transition: color 0.2s;
}
.auth-input-icon:hover { color: #cbd5e1; }

.auth-input-helper { color: var(--auth-text-muted); font-size: 0.72rem; margin-top: 5px; }

/* ── CTA ── */
.auth-btn {
  width: 100%;
  height: 46px;
  background: #ffffff;
  color: var(--auth-bg-dark);
  font-weight: 700;
  font-size: 0.9rem;
  font-family: var(--auth-font);
  border-radius: var(--auth-radius-md);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  transition: box-shadow 0.2s, transform 0.2s;
  animation: authPop 0.4s ease-out 0.55s both;
}
.auth-btn:hover:not(:disabled) {
  box-shadow: 0 4px 24px rgba(255, 255, 255, 0.15);
  transform: scale(1.01);
}
.auth-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.auth-btn__spinner { animation: authSpin 1s linear infinite; }

/* ── ERROR ── */
.auth-alert {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--auth-radius-md);
  font-size: 0.8rem;
  display: flex; align-items: center; gap: 8px;
  animation: authFadeIn 0.3s ease-out both;
}

/* ── FOOTER ── */
.auth-form__footer {
  text-align: center;
  font-size: 0.82rem;
  color: var(--auth-text-muted);
  animation: authFadeIn 0.45s ease-out 0.62s both;
}
.auth-form__footer a {
  color: var(--auth-text-primary);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}
.auth-form__footer a:hover { color: #a78bfa; }

/* ── BADGE (accent pill under title) ── */
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 999px;
  color: #c4b5fd;
  font-size: 0.72rem;
  font-weight: 500;
  margin-bottom: 12px;
  animation: authFadeIn 0.45s ease-out 0.28s both;
}
.auth-badge__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #a78bfa;
  flex-shrink: 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  body.auth-body { height: auto; overflow: auto; }
  .auth-page { padding: 0; height: auto; min-height: 100vh; align-items: stretch; }
  .auth-card-wrapper {
    max-width: none; height: auto; min-height: 100vh;
    border-radius: 0; padding: 0;
  }
  .auth-card { flex-direction: column; border-radius: 0; }
  .auth-left {
    width: 100%; height: 180px;
    border-radius: 0; flex-shrink: 0;
  }
  .auth-left__content {
    flex-direction: row; align-items: center;
    justify-content: flex-start; gap: 16px;
    padding: 20px 24px; padding-top: 52px;
  }
  .auth-left__logo { top: 18px; left: 24px; }
  .auth-left__title { font-size: 1.25rem; max-width: none; }
  .auth-left__subtitle, .auth-left__steps { display: none; }
  .auth-right {
    width: 100%; flex: 1;
    padding: 32px 24px 48px;
    border-radius: 0;
    align-items: flex-start;
  }
  .auth-input { font-size: 16px; }
}
