/* Global Design Tokens & Variables */
:root {
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --transition-speed: 0.3s;
  --transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --spacing-unit: 8px;

  /* Common Color Palette */
  --neutral-100: #ffffff;
  --neutral-200: #f8fafc;
  --neutral-300: #f1f5f9;
  --neutral-400: #cbd5e1;
  --neutral-500: #94a3b8;
  --neutral-600: #64748b;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;

  --error-color: #ef4444;
  --error-bg: #fef2f2;
}

/* Exam Cell Theme Config */
.theme-exam-cell {
  --primary-color: #1e3a8a;
  /* Deep Institutional Blue */
  --primary-hover: #1e40af;
  --accent-color: #f58220;
  /* Vibrant Orange */
  --accent-hover: #e07210;
  --accent-light: rgba(245, 130, 32, 0.1);
  --theme-gradient: linear-gradient(135deg, #1e3a8a 0%, #1e293b 100%);
  --shadow-color: rgba(30, 58, 138, 0.08);
  --shadow-color-hover: rgba(30, 58, 138, 0.15);
}

/* Faculty Theme Config */
.theme-faculty {
  --primary-color: #0d9488;
  /* Elegant Faculty Teal */
  --primary-hover: #0f766e;
  --accent-color: #f58220;
  /* Keep consistency with Orange */
  --accent-hover: #e07210;
  --accent-light: rgba(245, 130, 32, 0.1);
  --theme-gradient: linear-gradient(135deg, #0d9488 0%, #111827 100%);
  --shadow-color: rgba(13, 148, 136, 0.08);
  --shadow-color-hover: rgba(13, 148, 136, 0.15);
}

/* Dean Theme Config */
.theme-dean {
  --primary-color: #6b21a8;
  /* Distinctive Dean Purple */
  --primary-hover: #581c87;
  --accent-color: #f58220;
  /* Keep consistency with Orange */
  --accent-hover: #e07210;
  --accent-light: rgba(245, 130, 32, 0.1);
  --theme-gradient: linear-gradient(135deg, #6b21a8 0%, #111827 100%);
  --shadow-color: rgba(107, 33, 168, 0.08);
  --shadow-color-hover: rgba(107, 33, 168, 0.15);
}

/* Global Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--neutral-100);
  color: var(--neutral-800);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.bg-off-white {
  background-color: #ffffff;
}

/* Layout Split Container */
.split-container {
  display: flex;
  flex: 1;
  min-height: 100vh;
}

/* Left Side: Illustration Panel */
.image-side {
  flex: 1.1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 40px;
  overflow: hidden;
  transition: background var(--transition-speed) var(--transition-easing);
}

/* No overlay dots pattern to keep background clean white */
.image-side::before {
  content: '';
  position: absolute;
  inset: 0;
  display: none;
}

/* MIT Logo - top left of image panel */
.site-logo {
  position: absolute;
  top: 28px;
  left: 32px;
  z-index: 10;
}

.logo-img {
  height: 75px;
  width: auto;
  display: block;
}

.illustration-wrapper {
  position: relative;
  z-index: 2;
  width: 75%;
  max-width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.decorative-image {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Right Side: Form Panel */
.form-side {
  flex: 0.9;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: left;
  padding: 40px 24px;
  background-color: var(--neutral-100);
  position: relative;
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  animation: fadeInForm 0.8s var(--transition-easing);
}

/* Typography & Header styling */
.login-header {
  margin-bottom: 16px;
}

.brand-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--neutral-900);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--accent-color);
  margin-top: 6px;
  transition: color var(--transition-speed) var(--transition-easing);
}

.brand-description {
  font-size: 0.95rem;
  color: var(--neutral-500);
  margin-top: 6px;
}

/* Tab Switcher Styles */
.role-switcher {
  display: flex;
  gap: 32px;
  /* Reduced gap between tabs */
  border-bottom: 1px solid var(--neutral-300);
  margin-bottom: 20px;
}

.role-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  color: var(--neutral-500);
  padding: 8px 4px 12px 4px;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-speed) var(--transition-easing);
  text-align: center;
  margin-bottom: -1px;
}

.role-tab:hover {
  color: var(--neutral-900);
}

.role-tab.active {
  color: #f79421;
  border-bottom: 2px solid #f79421;
}

/* Form Styles */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--neutral-800);
}

.forgot-link,
.signup-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-color);
  text-decoration: none;
  transition: color var(--transition-speed) var(--transition-easing);
}

.forgot-link:hover,
.signup-link:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

/* Custom Styled Input Containers */
.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--neutral-500);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color var(--transition-speed) var(--transition-easing);
}

.input-icon svg {
  width: 20px;
  height: 20px;
}

.form-input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  color: var(--neutral-900);
  background-color: var(--neutral-100);
  border: 1px solid var(--neutral-400);
  border-radius: var(--border-radius-md);
  outline: none;
  transition: all var(--transition-speed) var(--transition-easing);
}

/* Input state focus: glows customized to selected portal style */
.form-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--shadow-color);
  background-color: var(--neutral-100);
}

.form-input:focus~.input-icon {
  color: var(--primary-color);
}

/* Password Toggle Eye Button */
.password-toggle {
  position: absolute;
  right: 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--neutral-500);
  display: flex;
  align-items: center;
  outline: none;
  transition: color var(--transition-speed) var(--transition-easing);
  padding: 4px;
}

.password-toggle:hover {
  color: var(--primary-color);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

.hidden {
  display: none !important;
}

/* Submit Button with Dynamic Style */
.submit-btn {
  width: 100%;
  background-color: #f79421;
  color: var(--neutral-100);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px;
  border: none;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(247, 148, 33, 0.15);
  transition: all var(--transition-speed) var(--transition-easing);
  margin-top: 4px;
}

.submit-btn:hover {
  background-color: #e07d10;
  box-shadow: 0 6px 20px rgba(247, 148, 33, 0.3);
  transform: translateY(-1px);
}

.submit-btn:active {
  transform: translateY(1px);
}

/* Validation Error Styles */
.form-group.has-error .form-input {
  border-color: var(--error-color);
  background-color: var(--error-bg);
}

.form-group.has-error .form-input:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

.error-message {
  font-size: 0.825rem;
  color: var(--error-color);
  min-height: 18px;
  margin-top: 2px;
  font-weight: 500;
}

/* Footer elements */
.login-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--neutral-600);
}

.login-footer p {
  color: var(--neutral-600);
}

.signup-link {
  color: #f79421;
}

.signup-link:hover {
  color: #e07d10;
}

/* Global Fixed Footer */
.global-footer {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: var(--neutral-500);
  pointer-events: none;
  z-index: 10;
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.footer-club-text {
  color: var(--accent-color);
  font-weight: bold;
}

/* Keyframes / Animations */
@keyframes floatIllustration {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0px);
  }
}

@keyframes fadeInForm {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Logo - hidden on desktop */
.mobile-logo {
  display: none;
}

/* Responsive Rules */
@media (max-width: 1024px) {
  .image-side {
    display: none;
  }

  .mobile-logo {
    display: block;
    margin-bottom: 20px;
  }

  .mobile-logo-img {
    height: 40px;
    width: auto;
    display: block;
  }

  .form-side {
    flex: 1;
    padding: 32px 16px;
  }

  .brand-title {
    font-size: 1.75rem;
  }

  .brand-subtitle {
    font-size: 0.95rem;
  }

  .brand-description {
    font-size: 0.85rem;
  }

  .role-tab {
    font-size: 0.88rem;
  }

  .form-label {
    font-size: 0.8rem;
  }

  .forgot-link {
    font-size: 0.8rem;
  }

  .form-input {
    font-size: 0.88rem;
    padding: 10px 12px 10px 40px;
  }

  .global-footer {
    position: static;
    transform: none;
    text-align: center;
    padding: 24px 16px;
    width: 100%;
    font-size: 0.68rem;
  }
}

/* Credits Button */
.credits-btn {
  position: absolute;
  top: 24px;
  right: 32px;
  background-color: var(--neutral-100);
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  z-index: 100;
  transition: all var(--transition-speed) var(--transition-easing);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.credits-btn:hover {
  background-color: var(--accent-color);
  color: var(--neutral-100);
  border-color: var(--accent-color);
  box-shadow: 0 4px 8px var(--accent-light);
}

/* Credits Modal Overlay */
.credits-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.credits-modal-overlay.hidden {
  display: none;
  opacity: 0;
}

/* Team Modal Card */
.credits-modal-team {
  background: #fff;
  border-radius: 16px;
  width: 92%;
  max-width: 680px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 25px 60px rgba(0,0,0,0.18);
  animation: modalPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Close Button */
.credits-close-btn {
  position: absolute;
  top: 14px;
  right: 18px;
  background: rgba(0,0,0,0.07);
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.credits-close-btn:hover {
  background: rgba(0,0,0,0.14);
}

/* Header — no background */
.credits-team-header {
  background: transparent;
  padding: 28px 32px 12px;
  text-align: center;
}

.credits-team-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #f97316;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
}

/* Team Body */
.credits-team-body {
  display: flex;
  gap: 0;
  background: #f8f9fa;
  padding: 20px 24px 28px;
  margin-top: 0;
  flex-wrap: wrap;
  justify-content: center;
}

/* Individual Member */
.credits-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 200px;
  padding: 0 12px;
  margin-top: 8px;
}

/* Avatar Wrapper */
.credits-avatar-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  margin-bottom: 14px;
}

/* Dashed Orange Ring — hidden */
.credits-avatar-ring {
  display: none;
}

/* White Circle with Icon */
.credits-avatar-inner {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #f58220;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(245,130,32,0.2);
}

/* Lightning bolt tag — hidden */
.credits-lightning {
  display: none;
}

/* Member Info */
.credits-member-info h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #000000;
  margin: 0 0 2px;
  min-height: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.credits-member-info span {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-style: normal;
  font-weight: 400;
  color: #000000;
  margin-bottom: 8px;
  min-height: 2.6rem;
}

.credits-member-info p {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f97316;
  line-height: 1.55;
  margin: 0 0 4px;
  min-height: 2.7rem;
}

/* Footer Note */
.credits-footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
  padding: 12px 24px 20px;
  background: #f8f9fa;
  border-top: 1px solid #e2e8f0;
}

@keyframes modalPopIn {
  0%   { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

/* --- Deactivated User Blur Overlay --- */
body.deactivated-blur > *:not(#deactivated-overlay) {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}