@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

/* --- Brand Typography Colors matching Home Page exactly --- */
.brand-hive {
  background: linear-gradient(135deg, #4aa7eb 0%, #2575d6 60%, #0a52b8 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  color: #2575d6 !important;
  font-weight: 900 !important;
  letter-spacing: -0.02em !important;
  display: inline-block !important;
}

.brand-genius {
  background: linear-gradient(135deg, #ffbe1a 0%, #f09000 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  color: #ffbe1a !important;
  font-weight: 900 !important;
  letter-spacing: -0.02em !important;
  display: inline-block !important;
}

/* --- Strict Static Viewport (Zero Scrollbar) --- */
html, body.alg-login-page {
  background: #070c1d !important;
  box-sizing: border-box !important;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  height: 100vh !important;
  margin: 0 !important;
  max-height: 100vh !important;
  min-height: 100vh !important;
  overflow: hidden !important;
  padding: 0 !important;
  width: 100vw !important;
}

body.alg-login-page #page,
body.alg-login-page #page-wrapper,
body.alg-login-page #page-content,
body.alg-login-page #region-main,
body.alg-login-page .main-inner,
body.alg-login-page .login-wrapper,
body.alg-login-page .login-container {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  max-width: none !important;
  min-height: 100vh !important;
  overflow: hidden !important;
  padding: 0 !important;
  width: 100% !important;
}

/* Hide default Moodle headers, footers & decorations on the login page */
body.alg-login-page #page-header,
body.alg-login-page #page-footer,
body.alg-login-page .navbar,
body.alg-login-page .secondary-navigation,
body.alg-login-page .login-divider,
body.alg-login-page .login-instructions,
body.alg-login-page .login-signup,
body.alg-login-page .login-heading,
body.alg-login-page .login-identityproviders,
body.alg-login-page .login-languagemenu,
body.alg-login-page .login-maintenance,
body.alg-login-page .cookieshelp,
body.alg-login-page #guestlogin,
body.alg-login-page #loginguestbtn,
body.alg-login-page button[data-modal-title-str*="cookiesenabled"],
body.alg-login-page [data-action="togglesensitive"],
body.alg-login-page .toggle-sensitive-btn,
body.alg-login-page .login-form-password button.btn:not(.alg-eye-toggle) {
  display: none !important;
}

/* =========================================================
   Main Immersive Shell (Strictly 100vh static)
   ========================================================= */
.alg-shell {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100vh;
  inset: 0;
  justify-content: space-between;
  max-height: 100vh;
  overflow: hidden;
  position: fixed;
  width: 100vw;
  z-index: 99999;
}

/* 1. Full-Page Immersive Background Canvas */
.alg-bg-canvas {
  background-color: #070c1d;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  height: 100vh;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  width: 100vw;
  z-index: 0;
}

.alg-bg-grid {
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
  height: 100%;
  inset: 0;
  opacity: 0.65;
  position: absolute;
  width: 100%;
}

.alg-glow-orb {
  border-radius: 50%;
  filter: blur(85px);
  pointer-events: none;
  position: absolute;
}

.alg-glow-top-left {
  background: radial-gradient(circle, rgba(37, 99, 235, 0.4) 0%, transparent 70%);
  height: 500px;
  left: -100px;
  top: -100px;
  width: 500px;
}

.alg-glow-bottom-right {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 70%);
  bottom: -80px;
  height: 440px;
  right: -80px;
  width: 440px;
}

/* 2. Top Navigation Bar */
.alg-header-bar {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  flex-shrink: 0;
  height: 64px;
  justify-content: space-between;
  padding: 0 36px;
  position: relative;
  width: 100%;
  z-index: 10;
}

.alg-header-brand {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  text-decoration: none;
}

.alg-header-logo-img {
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
  height: 34px;
  object-fit: contain;
  width: auto;
}

.alg-header-brand-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.alg-header-pill {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(37, 117, 214, 0.18);
  border: 1px solid rgba(74, 167, 235, 0.35);
  border-radius: 999px;
  color: #7dd3fc;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2.5px 9px;
}

.alg-header-home-btn {
  align-items: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 12.5px;
  font-weight: 600;
  gap: 6px;
  padding: 6px 15px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.alg-header-home-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

/* 3. Side Ambient Floating Badges (Desktop decoration) */
.alg-ambient-badges {
  height: 100vh;
  inset: 0;
  pointer-events: none;
  position: fixed;
  width: 100vw;
  z-index: 5;
}

.alg-float-badge {
  align-items: center;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), 0 0 20px rgba(37, 99, 235, 0.15);
  display: flex;
  gap: 10px;
  padding: 8px 14px;
  pointer-events: none;
  position: absolute;
}

.alg-badge-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  font-size: 16px;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.alg-badge-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alg-badge-title {
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.alg-badge-sub {
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 500;
}

.alg-badge-pos-left-1 {
  animation: algBadgeFloat1 6.5s ease-in-out infinite;
  left: 4.5%;
  top: 25%;
}

.alg-badge-pos-left-2 {
  animation: algBadgeFloat2 7s ease-in-out infinite 0.5s;
  bottom: 20%;
  left: 5.5%;
}

.alg-badge-pos-right-1 {
  animation: algBadgeFloat1 6s ease-in-out infinite 1s;
  right: 4.5%;
  top: 26%;
}

.alg-badge-pos-right-2 {
  animation: algBadgeFloat2 6.8s ease-in-out infinite 1.5s;
  bottom: 22%;
  right: 5.5%;
}

/* 4. Centered Stage & Compact Glassmorphic Card */
.alg-stage {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  flex: 1;
  justify-content: center;
  min-height: 0;
  padding: 6px 20px 24px;
  position: relative;
  width: 100%;
  z-index: 10;
}

.alg-glass-card {
  animation: algCardAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.45), 0 0 35px rgba(37, 99, 235, 0.15);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  max-width: 410px;
  padding: 22px 28px 16px;
  position: relative;
  width: 100%;
}

/* Card Header with Brand Logo & Name */
.alg-card-header {
  margin-bottom: 4px;
  text-align: center;
}

.alg-card-logo-wrap {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 6px;
}

.alg-card-logo-img {
  display: block;
  height: 32px;
  object-fit: contain;
  width: auto;
}

.alg-card-brand-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.alg-card-title {
  color: #0f172a;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 4px 0;
}

.alg-card-subtitle {
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.4;
  margin: 0;
}

/* Segmented Role Switcher */
.alg-role-switcher {
  background: #f1f5f9;
  border-radius: 10px;
  display: grid;
  gap: 3px;
  grid-template-columns: 1fr 1fr;
  margin: 12px 0 14px 0;
  padding: 3px;
}

.alg-role-tab {
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  gap: 5px;
  justify-content: center;
  outline: none;
  padding: 6px 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.alg-role-tab:hover:not(.active) {
  color: #0f172a;
}

.alg-role-tab.active {
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  color: #1d4ed8;
}

.alg-tab-icon {
  font-size: 14px;
}

/* Alerts & Error Notifications */
.alg-alerts-wrap {
  margin-bottom: 12px;
  width: 100%;
}

.alg-alert-box {
  align-items: center;
  border-radius: 10px;
  display: flex;
  font-size: 12px;
  font-weight: 600;
  gap: 8px;
  line-height: 1.35;
  margin-bottom: 8px;
  padding: 9px 12px;
}

.alg-alert-box.warning {
  background-color: #fef2f2;
  border: 1.5px solid #fecaca;
  color: #991b1b;
}

.alg-alert-box.warning .alg-alert-icon {
  color: #dc2626;
}

.alg-alert-box.info {
  background-color: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #1e40af;
}

.alg-alert-box.info .alg-alert-icon {
  color: #2563eb;
}

.alg-alert-icon {
  display: flex;
  flex-shrink: 0;
}

/* Form Overrides */
body.alg-login-page form#login {
  display: flex !important;
  flex-direction: column !important;
  gap: 11px !important;
  margin: 0 !important;
  width: 100% !important;
}

body.alg-login-page .login-form-username,
body.alg-login-page .login-form-password,
body.alg-login-page .login-form-submit {
  margin: 0 !important;
  position: relative !important;
  width: 100% !important;
}

/* Field Labels & Forgot Link */
.alg-field-label-row {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  width: 100%;
}

.alg-field-label {
  color: #475569;
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.alg-forgot-link {
  color: #2575d6;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.alg-forgot-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Input Wrappers & Icons */
.alg-input-wrap {
  align-items: center;
  display: flex;
  position: relative;
  width: 100%;
}

.alg-input-icon {
  align-items: center;
  color: #94a3b8;
  display: flex;
  height: 100%;
  left: 13px;
  pointer-events: none;
  position: absolute;
  top: 0;
  z-index: 5;
}

body.alg-login-page #username,
body.alg-login-page #password {
  background-color: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  box-sizing: border-box !important;
  color: #0f172a !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  height: 42px !important;
  outline: none !important;
  padding-left: 38px !important;
  padding-right: 14px !important;
  transition: all 0.2s ease !important;
  width: 100% !important;
}

body.alg-login-page #username::placeholder,
body.alg-login-page #password::placeholder {
  color: #94a3b8 !important;
  font-size: 12.5px !important;
}

body.alg-login-page #username:hover,
body.alg-login-page #password:hover {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
}

body.alg-login-page #username:focus,
body.alg-login-page #password:focus {
  background-color: #ffffff !important;
  border-color: #2575d6 !important;
  box-shadow: 0 0 0 3px rgba(37, 117, 214, 0.15) !important;
}

/* Password Eye Toggle */
body.alg-login-page #password {
  padding-right: 44px !important;
}

.alg-eye-toggle {
  align-items: center !important;
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  display: flex !important;
  height: 32px !important;
  justify-content: center !important;
  padding: 0 !important;
  position: absolute !important;
  right: 6px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  transition: all 0.15s ease !important;
  width: 32px !important;
  z-index: 20 !important;
}

.alg-eye-toggle:hover {
  background-color: #f1f5f9 !important;
  color: #2575d6 !important;
}

.alg-eye-toggle svg {
  pointer-events: none !important;
}

/* Submit Button */
body.alg-login-page #loginbtn {
  align-items: center !important;
  background: linear-gradient(135deg, #2575d6 0%, #1d4ed8 100%) !important;
  border: none !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 14px rgba(37, 117, 214, 0.28) !important;
  color: #ffffff !important;
  cursor: pointer !important;
  display: flex !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
  gap: 6px !important;
  height: 44px !important;
  justify-content: center !important;
  letter-spacing: -0.01em !important;
  margin-top: 2px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  width: 100% !important;
}

body.alg-login-page #loginbtn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #0a52b8 100%) !important;
  box-shadow: 0 6px 20px rgba(37, 117, 214, 0.38) !important;
  transform: translateY(-1px);
}

body.alg-login-page #loginbtn:active {
  box-shadow: 0 2px 8px rgba(37, 117, 214, 0.2) !important;
  transform: translateY(0);
}

.alg-btn-arrow {
  font-size: 16px;
  line-height: 1;
  transition: transform 0.15s ease;
}

body.alg-login-page #loginbtn:hover .alg-btn-arrow {
  transform: translateX(3px);
}

/* Registration CTA */
.alg-card-register {
  align-items: center;
  display: flex;
  font-size: 12.5px;
  gap: 5px;
  justify-content: center;
  margin-top: 13px;
  text-align: center;
}

.alg-register-hint {
  color: #64748b;
}

.alg-register-link {
  color: #f09000;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s ease;
}

.alg-register-link:hover {
  color: #d97706;
  text-decoration: underline;
}

/* Card Footer Info */
.alg-card-footer {
  align-items: center;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  margin-top: 13px;
  padding-top: 11px;
}

.alg-security-badge {
  align-items: center;
  color: #64748b;
  display: flex;
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
}

.alg-copyright {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
}

/* Keyframe Animations */
@keyframes algCardAppear {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes algBadgeFloat1 {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes algBadgeFloat2 {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(8px);
  }
}

/* =========================================================
   Responsive Breakpoints
   ========================================================= */
@media (max-width: 1240px) {
  .alg-ambient-badges {
    display: none;
  }
}

@media (max-width: 640px) {
  .alg-header-bar {
    height: 56px;
    padding: 0 18px;
  }

  .alg-header-home-btn span {
    display: none;
  }

  .alg-header-home-btn {
    padding: 6px 9px;
  }

  .alg-glass-card {
    border-radius: 18px;
    padding: 20px 20px 14px;
  }

  .alg-card-title {
    font-size: 19px;
  }
}
