/**
 * EduNova Portal — Eye-catching Premium Login
 * Mesh gradients · ambient orbs · glass card · micro-motion
 */

:root {
  --bg-deep: #020c08;
  --brand-primary: #008751;
  --brand-secondary: #024a2d;
  --brand-accent: #10b981;
  --brand-lime: #34d399;
  --brand-gold: #fbbf24;
  --text-light: #f8fafc;
  --text-muted: #94a3b8;
  --glass-border: rgba(255, 255, 255, 0.14);
  --card-bg: rgba(255, 255, 255, 0.97);
  --card-text: #0f172a;
  --card-muted: #64748b;
  --card-border: #e2e8f0;
  --input-bg: #f1f5f9;
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shadow-card:
    0 0 0 1px rgba(255, 255, 255, 0.6) inset,
    0 30px 60px -15px rgba(2, 74, 45, 0.28),
    0 12px 24px -8px rgba(0, 0, 0, 0.12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
  overflow: hidden;
}

body.login-page {
  margin: 0;
  padding: 0;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  font-family: var(--font);
  color: var(--text-light);
  background: var(--bg-deep);
  overflow: hidden !important;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  position: fixed;
  inset: 0;
  width: 100%;
  touch-action: manipulation;
}

/* ========== Ambient full-page backdrop ========== */
.login-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 100% 80% at 10% -10%, rgba(0, 135, 81, 0.45), transparent 50%),
    radial-gradient(ellipse 80% 60% at 100% 100%, rgba(2, 74, 45, 0.55), transparent 45%),
    radial-gradient(ellipse 50% 40% at 70% 20%, rgba(16, 185, 129, 0.2), transparent 50%),
    linear-gradient(165deg, #031510 0%, #0a1f16 40%, #0f172a 100%);
}

.login-ambient__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(16, 185, 129, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 20%, transparent 75%);
  opacity: 0.7;
}

.login-ambient__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: orbFloat 12s ease-in-out infinite alternate;
}

.login-ambient__orb--1 {
  width: 420px;
  height: 420px;
  top: -8%;
  left: -5%;
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
  animation-duration: 14s;
}

.login-ambient__orb--2 {
  width: 360px;
  height: 360px;
  bottom: -10%;
  right: -5%;
  background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
  opacity: 0.28;
  animation-duration: 16s;
  animation-delay: -4s;
}

.login-ambient__orb--3 {
  width: 280px;
  height: 280px;
  top: 40%;
  left: 45%;
  background: radial-gradient(circle, #fbbf24 0%, transparent 70%);
  opacity: 0.12;
  animation-duration: 18s;
  animation-delay: -8s;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -24px) scale(1.08); }
}

/* ========== Shell ========== */
.login-shell,
#pagewrapper.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* ========== Brand panel (desktop) ========== */
.login-brand {
  position: relative;
  display: none;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 4vh, 48px) clamp(28px, 4vw, 56px);
  background: linear-gradient(155deg, #013220 0%, #008751 42%, #059669 72%, #0d9488 100%);
  overflow: hidden;
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
}

.login-brand__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 85%, rgba(251, 191, 36, 0.18), transparent 35%),
    radial-gradient(circle at 90% 15%, rgba(255, 255, 255, 0.14), transparent 30%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.2), transparent 50%);
  animation: meshPulse 10s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes meshPulse {
  0% { opacity: 0.85; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.04); }
}

.login-brand__glow {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.15) 100%);
  pointer-events: none;
}

.login-brand__rings {
  position: absolute;
  right: -80px;
  top: 50%;
  transform: translateY(-50%);
  width: 420px;
  height: 420px;
  pointer-events: none;
}

.login-brand__rings span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: ringPulse 8s ease-in-out infinite;
}

.login-brand__rings span:nth-child(2) {
  inset: 12%;
  animation-delay: -2s;
  border-color: rgba(255, 255, 255, 0.1);
}

.login-brand__rings span:nth-child(3) {
  inset: 26%;
  animation-delay: -4s;
  border-color: rgba(255, 255, 255, 0.08);
}

@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.06); opacity: 1; }
}

.login-brand__floaters {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.floater {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  animation: floaterBob 6s ease-in-out infinite;
}

.floater--1 { top: 14%; right: 18%; animation-delay: 0s; }
.floater--2 { top: 32%; right: 8%; animation-delay: -1.5s; font-size: 1.5rem; }
.floater--3 { bottom: 28%; right: 22%; animation-delay: -3s; }
.floater--4 { bottom: 16%; right: 10%; animation-delay: -4.5s; width: 44px; height: 44px; }

@keyframes floaterBob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-14px) rotate(4deg); }
}

.login-brand__inner {
  position: relative;
  z-index: 2;
  max-width: 460px;
  max-height: 100%;
  overflow: hidden;
  animation: brandIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes brandIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.login-brand__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ecfdf5;
  margin-bottom: 28px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.login-brand__badge-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6ee7b7;
  box-shadow: 0 0 0 0 rgba(110, 231, 183, 0.7);
  animation: livePulse 2s ease-out infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(110, 231, 183, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(110, 231, 183, 0); }
  100% { box-shadow: 0 0 0 0 rgba(110, 231, 183, 0); }
}

.login-brand__title {
  margin: 0 0 clamp(10px, 1.5vh, 18px);
  font-size: clamp(1.55rem, 2.8vw, 2.65rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: #fff;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.login-brand__title-accent {
  display: inline-block;
  background: linear-gradient(90deg, #fde68a 0%, #6ee7b7 45%, #a7f3d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.login-brand__lead {
  margin: 0 0 clamp(14px, 2vh, 24px);
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  line-height: 1.5;
  color: rgba(236, 253, 245, 0.9);
  font-weight: 450;
  max-width: 28em;
}

.login-brand__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: clamp(14px, 2vh, 24px);
}

.stat-pill {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  min-width: 96px;
  transition: transform 0.25s ease, background 0.25s ease;
}

.stat-pill:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.18);
}

.stat-pill strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.stat-pill span {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(236, 253, 245, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-brand__points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-brand__points li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ecfdf5;
}

.login-brand__icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 900;
  color: #a7f3d0;
}

.login-brand__footer {
  margin-top: clamp(16px, 3vh, 36px);
  font-size: 0.82rem;
  color: rgba(236, 253, 245, 0.7);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-brand__footer-mark {
  color: var(--brand-gold);
  font-size: 0.65rem;
}

/* ========== Mobile hero strip ========== */
.login-mobile-hero {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
  flex-shrink: 0;
  animation: cardIn 0.5s ease both;
}

.login-mobile-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a7f3d0;
  backdrop-filter: blur(10px);
}

.login-mobile-hero__badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
  animation: livePulse 2s ease-out infinite;
}

/* ========== Auth column ========== */
.login-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* ========== Card ========== */
.login-card,
.page-container {
  width: 100%;
  max-width: 400px;
  max-height: min(640px, calc(100dvh - 24px));
  background: var(--card-bg);
  color: var(--card-text);
  border-radius: var(--radius-xl);
  padding: clamp(16px, 2.5vh, 28px) clamp(18px, 3vw, 28px) clamp(14px, 2vh, 24px);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.85);
  position: relative;
  z-index: 10;
  overflow: hidden;
  flex-shrink: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: cardIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

.login-card__shine {
  position: absolute;
  top: -40%;
  left: -20%;
  width: 60%;
  height: 80%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), transparent 60%);
  pointer-events: none;
  transform: rotate(-12deg);
  opacity: 0.7;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-card__header {
  text-align: center;
  margin-bottom: clamp(12px, 2vh, 22px);
  position: relative;
  flex-shrink: 0;
}

.login-card__header--logo-only {
  margin-bottom: clamp(8px, 1.5vh, 16px);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-card__logo-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: clamp(8px, 1.5vh, 14px);
}

.login-card__logo-ring {
  position: absolute;
  width: clamp(68px, 12vh, 88px);
  height: clamp(68px, 12vh, 88px);
  border-radius: 50%;
  background: conic-gradient(from 180deg, #008751, #34d399, #fbbf24, #10b981, #008751);
  animation: logoSpin 8s linear infinite;
  opacity: 0.9;
  z-index: 0;
}

.login-card__logo-ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #fff;
}

@keyframes logoSpin {
  to { transform: rotate(360deg); }
}

.login-card__logo {
  position: relative;
  z-index: 1;
  width: clamp(56px, 10vh, 72px);
  height: clamp(56px, 10vh, 72px);
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(2, 74, 45, 0.18);
  border: 2px solid #fff;
  margin: 6px;
}

.login-card__eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-primary);
}

.login-card__eyebrow-line {
  display: block;
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-accent), transparent);
}

.login-card__school,
.logo-area h1 {
  margin: 0;
  font-size: clamp(1.1rem, 2.5vh, 1.35rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--card-text);
  line-height: 1.25;
  background: none;
  -webkit-text-fill-color: unset;
}

.login-card__tagline,
.logo-area p {
  margin: 6px 0 0;
  font-size: clamp(0.78rem, 1.6vh, 0.88rem);
  color: var(--card-muted);
  font-weight: 550;
}

.login-demo-badge {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, #d97706, #f59e0b);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.35);
}

.login-demo-links {
  margin-top: 8px;
  font-size: 11px;
  color: var(--card-muted);
}

.login-demo-links a {
  color: var(--brand-primary);
  font-weight: 700;
  text-decoration: none;
  margin: 0 4px;
}

/* ========== Form ========== */
.login-form {
  text-align: left;
  position: relative;
}

.form-group {
  margin-bottom: clamp(10px, 1.6vh, 16px);
  text-align: left;
}

.login-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  display: flex;
  pointer-events: none;
  z-index: 1;
  transition: color 0.2s ease;
}

.login-input-wrap:focus-within .login-input-icon {
  color: var(--brand-primary);
}

.login-input,
input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: clamp(46px, 7vh, 52px);
  padding: 12px 48px 12px 46px;
  background: var(--input-bg);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-family: inherit;
  font-weight: 550;
  color: var(--card-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.login-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.login-input:hover {
  background: #fff;
  border-color: #cbd5e1;
}

.login-input:focus,
input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--brand-primary);
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(0, 135, 81, 0.14),
    0 8px 20px -8px rgba(0, 135, 81, 0.25);
}

.login-eye {
  position: absolute;
  right: 8px;
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  color: #94a3b8;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.login-eye:hover {
  color: var(--brand-primary);
  background: rgba(0, 135, 81, 0.1);
}

/* ========== Submit CTA ========== */
.login-submit,
button#submit-btn {
  position: relative;
  width: 100%;
  min-height: clamp(46px, 7vh, 52px);
  margin-top: 6px;
  padding: 14px 22px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #047857 0%, #008751 40%, #10b981 100%);
  background-size: 160% 160%;
  color: #fff;
  font-size: 1.02rem;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow:
    0 14px 30px -10px rgba(0, 135, 81, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  animation: ctaGlow 3.5s ease-in-out infinite;
}

@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 14px 30px -10px rgba(0, 135, 81, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.12) inset; }
  50% { box-shadow: 0 16px 36px -8px rgba(16, 185, 129, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.18) inset; }
}

.login-submit__glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 20%,
    rgba(255, 255, 255, 0.28) 45%,
    transparent 70%
  );
  transform: translateX(-120%);
  animation: shimmer 3.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0%, 40% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

.login-submit__arrow {
  font-size: 1.15rem;
  transition: transform 0.2s ease;
  opacity: 0.9;
}

.login-submit:hover:not(:disabled),
button#submit-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  filter: brightness(1.05);
}

.login-submit:hover:not(:disabled) .login-submit__arrow {
  transform: translateX(4px);
}

.login-submit:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

.login-submit:disabled {
  opacity: 0.8;
  cursor: wait;
  animation: none;
}

.btn-loader {
  display: none;
  align-items: center;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.75s linear infinite;
}

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

/* ========== Row options (remember + help) ========== */
.login-row-opts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 10px;
  flex-wrap: wrap;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 650;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.login-remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-primary);
  margin: 0;
}

.login-help-tip {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-primary);
  cursor: help;
  border-bottom: 1px dashed rgba(0, 135, 81, 0.4);
}

.login-hint {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  font-size: 0.78rem;
  color: #166534;
  line-height: 1.45;
  font-weight: 550;
}

.login-hint strong {
  font-weight: 800;
  color: #14532d;
}

.login-link-home {
  display: block;
  text-align: center;
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  text-decoration: none;
}

.login-link-home:hover {
  color: var(--brand-primary);
}

/* Allow form column to scroll when mobile keyboard opens */
.login-main {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ========== Alert ========== */
.login-alert,
#error-msg {
  display: none;
  color: #b91c1c;
  background: linear-gradient(135deg, #fef2f2, #fff1f2);
  border: 1px solid #fecaca;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  line-height: 1.4;
  animation: shakeIn 0.4s ease;
}

@keyframes shakeIn {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ========== Divider & links ========== */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: clamp(10px, 1.8vh, 18px) 0 clamp(8px, 1.2vh, 12px);
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  flex-shrink: 0;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

.login-links,
.links-area {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-link-secondary,
.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: clamp(42px, 6.5vh, 48px);
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  color: #334155;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  background: linear-gradient(180deg, #fff, #f8fafc);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.login-link-icon {
  font-size: 1.05rem;
}

.login-link-secondary:hover,
.btn-outline:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: #f0fdf4;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -10px rgba(0, 135, 81, 0.35);
}

.login-card__footer {
  margin-top: clamp(12px, 2vh, 20px);
  padding-top: clamp(10px, 1.5vh, 16px);
  border-top: 1px solid #f1f5f9;
  text-align: center;
  position: relative;
  flex-shrink: 0;
}

.login-trust {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--card-muted);
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f0fdf4;
  color: #047857;
}

.login-legal {
  margin: 0;
  font-size: 0.7rem;
  color: #94a3b8;
  line-height: 1.5;
}

.login-legal a {
  color: var(--brand-primary);
  font-weight: 700;
  text-decoration: none;
}

.login-legal a:hover {
  text-decoration: underline;
}

/* ========== Desktop split ========== */
@media (min-width: 960px) {
  .login-shell,
  #pagewrapper.login-shell {
    grid-template-columns: minmax(360px, 1.1fr) minmax(400px, 1fr);
  }

  .login-brand {
    display: flex;
  }

  .login-mobile-hero {
    display: none;
  }

  .login-main {
    height: 100%;
    max-height: 100dvh;
    padding: 24px 32px;
    background: transparent;
    overflow: hidden;
  }

  .login-card,
  .page-container {
    max-width: 420px;
    max-height: calc(100dvh - 32px);
  }
}

@media (max-width: 959px) {
  .login-card,
  .page-container {
    max-width: 100%;
    max-height: calc(100dvh - 56px);
    border-radius: 22px;
  }
}

/* Short phones: compress vertical spacing harder */
@media (max-height: 700px) {
  .login-card__tagline,
  .login-card__eyebrow-line,
  .login-brand__points li:nth-child(3),
  .login-brand__footer {
    display: none !important;
  }
  .login-card__eyebrow {
    margin-bottom: 4px;
  }
  .login-brand__stats {
    margin-bottom: 10px;
  }
  .login-card__footer {
    margin-top: 8px;
    padding-top: 8px;
  }
  .login-trust {
    margin-bottom: 4px;
    padding: 4px 10px;
  }
}

@media (max-height: 580px) {
  .login-mobile-hero,
  .login-divider,
  .login-legal,
  .login-brand__stats {
    display: none !important;
  }
  .login-card__logo-wrap {
    margin-bottom: 4px;
  }
}

/* Keep AI chat in viewport; no page scroll */
#ai-chatbot {
  position: fixed;
  right: 16px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 1000;
  max-height: calc(100dvh - 16px);
}

/* ========== AI Chat ========== */
#ai-chat-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #008751, #10b981, #34d399);
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: white;
  font-size: 22px;
  cursor: pointer;
  box-shadow:
    0 12px 32px rgba(0, 135, 81, 0.5),
    0 0 0 0 rgba(16, 185, 129, 0.4);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: chatPulse 3s ease-in-out infinite;
}

@keyframes chatPulse {
  0%, 100% { box-shadow: 0 12px 32px rgba(0, 135, 81, 0.5), 0 0 0 0 rgba(16, 185, 129, 0.35); }
  50% { box-shadow: 0 12px 32px rgba(0, 135, 81, 0.55), 0 0 0 12px rgba(16, 185, 129, 0); }
}

#ai-chat-toggle:hover {
  transform: scale(1.1) rotate(-6deg);
}

#ai-chat-window {
  position: absolute;
  bottom: 68px;
  right: 0;
  width: min(340px, calc(100vw - 32px));
  height: min(420px, calc(100dvh - 100px));
  max-height: calc(100dvh - 100px);
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  box-shadow: 0 28px 56px -12px rgba(0, 0, 0, 0.55);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: chatPop 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chatPop {
  0% { opacity: 0; transform: scale(0.9) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.chat-header {
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(0, 135, 81, 0.35), rgba(0, 0, 0, 0.25));
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header .status {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: livePulse 2s ease-out infinite;
}

.chat-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
}

.chat-close:hover {
  color: white;
}

.chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 85%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.msg-ai {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #e2e8f0;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg-user {
  background: linear-gradient(135deg, #008751, #10b981);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-input-area {
  padding: 12px;
  background: rgba(0, 0, 0, 0.28);
  border-top: 1px solid var(--glass-border);
  display: flex;
  gap: 10px;
}

.chat-input-area input {
  flex: 1;
  min-height: 44px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--glass-border);
  padding: 10px 14px;
  border-radius: 20px;
  color: white;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.chat-input-area input:focus {
  border-color: var(--brand-accent);
}

.chat-input-area button {
  background: linear-gradient(135deg, #008751, #10b981);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.typing-indicator {
  font-size: 12px;
  color: var(--text-muted);
  display: none;
  margin: 0 16px 8px;
}

.chat-body::-webkit-scrollbar {
  width: 6px;
}
.chat-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

/* ========== Demo one-tap role login (EduNova Nexus hub) ========== */
.demo-quick-login {
  margin: 0 0 18px;
  padding: 14px 12px 12px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(236, 253, 245, 0.95), rgba(255, 247, 237, 0.92));
  border: 1px solid #bbf7d0;
  box-shadow: 0 10px 28px -18px rgba(2, 74, 45, 0.35);
}

.demo-quick-login__title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 800;
  color: #024a2d;
  text-align: center;
  letter-spacing: 0.01em;
}

.demo-quick-login__sub {
  margin: 4px 0 12px;
  font-size: 0.72rem;
  color: #64748b;
  text-align: center;
}

.demo-quick-login__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.demo-quick-login__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 92px;
  padding: 10px 8px;
  border-radius: 14px;
  border: 1.5px solid #d1fae5;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.demo-quick-login__btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #34d399;
  box-shadow: 0 10px 22px -12px rgba(0, 135, 81, 0.45);
}

.demo-quick-login__btn:active:not(:disabled) {
  transform: translateY(0);
}

.demo-quick-login__btn.is-active {
  border-color: #008751;
  background: linear-gradient(180deg, #ecfdf5, #fff);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.demo-quick-login__btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.demo-quick-login__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.demo-quick-login__label {
  font-size: 0.8rem;
  font-weight: 800;
  color: #0f172a;
}

.demo-quick-login__hint {
  font-size: 0.62rem;
  font-weight: 600;
  color: #64748b;
}

.demo-quick-login__user {
  font-size: 0.58rem;
  font-weight: 600;
  color: #94a3b8;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-quick-login__btn--student { border-color: #bfdbfe; }
.demo-quick-login__btn--teacher { border-color: #bbf7d0; }
.demo-quick-login__btn--head { border-color: #fde68a; }
.demo-quick-login__btn--bursary { border-color: #ddd6fe; }

.login-demo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 8px auto 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #065f46;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
}

@media (max-width: 380px) {
  .demo-quick-login__grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .demo-quick-login__btn {
    min-height: 84px;
    padding: 8px 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-card,
  .login-brand__inner,
  .login-ambient__orb,
  .floater,
  .login-card__logo-ring,
  .login-submit,
  .login-submit__glow,
  .spinner,
  #ai-chat-window,
  #ai-chat-toggle,
  .login-brand__mesh,
  .login-brand__rings span,
  .demo-quick-login__btn {
    animation: none !important;
  }
  .login-submit:hover:not(:disabled),
  .demo-quick-login__btn:hover:not(:disabled) {
    transform: none;
  }
}
