:root {
  --primary: #1877F2;   /* Facebook Blue */
  --secondary: #f9db11; /* Yellow cloth */
  --bridge: #b9b9b9;    /* Soft gray bridge */
  --accent: #2f2f2e;    
  --success: #2ecc71;       
  --warning: #f39c12;       
  --light: #ecf0f1;         
  --lighter: #f8f9fa;       
  --dark: #2c3e50;         
  --darker: #1a252f;        

  --font-primary: 'Segoe UI', 'Roboto', sans-serif;
  --font-heading: 'Poppins', var(--font-primary);
  
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --shadow-inset: inset 0 1px 2px rgba(0,0,0,0.1);
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--dark);
  -webkit-font-smoothing: antialiased;
  background-color: var(--lighter);
  overflow-y: auto;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: var(--transition-fast);
}

a:hover {
  color: var(--primary-light);
}

/* Login Body */
.login-body {
  display:flex;
  justify-content:center;
  align-items:center;
  min-height:100vh;
  padding:var(--space-xl);
  position:relative;
  background-size:cover;
  overflow:auto;
}

.login-body {
  display:flex;
  justify-content:center;
  align-items:center;
  min-height:100vh;
  padding:var(--space-xl);
  position:relative;
  background-size:cover;
  overflow:auto;
}

.login-background {
  position:absolute;
  inset:0;

  background: linear-gradient(
    to bottom,
    var(--primary) 0%,
    #3c8df9 20%,     
    var(--bridge) 40%, 
    var(--secondary) 50%,
    var(--bridge) 60%,
    #3c8df9 80%,
    var(--primary) 100% 
  );

  background-size:100% 1000%;
  animation: gradientFlow 40s linear infinite;
  z-index:-1;

  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  opacity:0.95;
}

@keyframes gradientFlow {
  0%   { background-position: 0% 0%; }
  100% { background-position: 0% 100%; }
}

.button, .card {
  color:#fff;
  background:var(--accent);
}

.login-container {
  width: 100%;
  max-width: 450px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;

  /* animation */
  transform: translateY(40px) scale(0.98);
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

/* Entrance animation */
@keyframes fadeInUp {
  0% {
    transform: translateY(40px) scale(0.95);
    opacity: 0;
  }
  60% {
    transform: translateY(-6px) scale(1.02);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}


/* Fade in on page load */
body.loaded .login-background,
body.loaded .login-container {
  opacity: 1;
  transform: translateY(0);
}

/* Fade out + blur + zoom on redirect */
body.fade-out .login-background {
  opacity: 0;
  backdrop-filter: blur(8px) scale(1.05);
}

body.fade-out .login-container {
  transform: translateY(-20px);
  opacity: 0;
}

.login-header {
  padding: var(--space-xl);
  text-align: center;
  background: white;
  color: var(--dark);
}

.logo {
  margin-bottom: var(--space-md);
}

.logo-image {
  height: clamp(100px, 20vw, 200px);
  width: auto;
  margin-bottom: var(--space-sm);
}

.institution-name {
  font-size: clamp(1.2rem, 4vw, 1.75rem);
  font-weight: 700;
  margin-bottom: var(--space-xs);
  color: var(--primary);
}

.login-header h2 {
  font-size: clamp(1rem, 3vw, 1.5rem);
  margin-bottom: var(--space-xs);
  color: var(--dark);
}

.login-subtitle {
  opacity: 0.8;
  font-size: clamp(0.8rem, 2.5vw, 0.95rem);
  color: #666;
}

.login-form {
  padding: var(--space-xl);
}

.form-group {
  margin-bottom: var(--space-lg);
  position: relative;
}

.form-group.floating {
  position: relative;
}

.form-group.floating input {
  padding-left: 3rem; /* space for icon */
}

.form-group.floating label {
  position: absolute;
  top: clamp(0.7rem, 2vw, 1rem);
  left: 3rem; /* leave room for icon */
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  color: #777;
  pointer-events: none;
  transition: var(--transition-fast);
  background: white; /* optional, helps with floating animation */
  padding: 0 var(--space-xs);
}

/* Label float on focus or when filled */
.form-group.floating input:focus + label,
.form-group.floating input:not(:placeholder-shown) + label {
  transform: translateY(-22px) scale(0.8);
  color: var(--primary);
  left: 3rem; /* keep aligned with icon */
}

.form-group.floating .input-requirements {
  position: absolute;
  left: 15%;
  transform: translateX(-50%);
  bottom: -1.5rem;
  font-size: clamp(0.65rem, 1.2vw, 0.75rem);
  color: #777;
  display: none;
}

.form-group.floating input:focus ~ .input-requirements,
.form-group.floating input:not(:placeholder-shown) ~ .input-requirements {
  display: block;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #777;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  pointer-events: none;
}

input {
  width: 100%;
  padding: clamp(0.7rem, 2vw, 1rem) clamp(0.7rem, 2vw, 1rem) clamp(0.7rem, 2vw, 1rem) 3rem;
  border: 1px solid #ddd;
  border-radius: var(--radius-md);
  font-size: clamp(0.9rem, 1.8vw, 1rem);
  transition: var(--transition-normal);
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(49, 40, 220, 0.2);
}

.toggle-password {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #777;
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}

.toggle-password:hover {
  color: var(--primary);
}

.input-requirements {
  font-size: clamp(0.7rem, 1.4vw, 0.8rem);
  color: #777;
  margin-top: var(--space-xs);
  display: none;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  font-size: clamp(0.8rem, 1.6vw, 0.9rem);
}

.forgot-password {
  color: var(--primary);
  font-weight: 500;
}

.login-button {
  width: 100%;
  padding: clamp(0.6rem, 1.8vw, 0.75rem);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-normal);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
}

.login-button:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Responsive Message Styles */


.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  padding: 30px;
  text-align: center;
  animation: modalIn 0.4s ease-out forwards;
  transform: translateY(20px);
  opacity: 0;
  position: relative;
  overflow: hidden;
}


@keyframes modalIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-icon {
  width: 80px;
  height: 80px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: clamp(2rem, 5vw, 2.5rem);
  color: white;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.modal h2 {
  font-size: clamp(1rem, 3vw, 1.5rem);
  margin-bottom: 15px;
}

.modal p {
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  color: #555;
  margin-bottom: 25px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.modal-btn {
  padding: clamp(0.6rem, 1.8vw, 0.75rem) clamp(1rem, 3vw, 1.5rem);
  border-radius: 8px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  font-size: clamp(0.9rem, 1.6vw, 1rem);
}

.modal.visible {
  display: flex;
}

.modal-btn-primary {
  background: var(--primary);
  color: white;
}

.modal-btn-primary:hover {
  background: var(--accent);
}

.modal-btn-outline {
  background: white;
  border: 1px solid #ddd;
  color: var(--dark);
}

.modal-btn-outline:hover {
  background: var(--light);
}

.login-messageerror,
.login-messagesuccess {
  width: 100%;
  padding: clamp(0.4rem, 1.5vw, 0.6rem) clamp(0.5rem, 2vw, 0.8rem) clamp(0.4rem, 1.5vw, 0.6rem) clamp(2.5rem, 5vw, 3rem);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  font-size: clamp(0.8rem, 1.4vw, 0.95rem);
  position: relative;
  margin-bottom: clamp(0.8rem, 2vw, 1.2rem);
  line-height: 1.4;
}

.login-messageerror {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.login-messagesuccess {
  background-color: #ecffeb;
  color: #28c630;
  border: 1px solid #9aefa5;
}

.login-messageerror i,
.login-messagesuccess i {
  position: absolute;
  left: clamp(0.6rem, 1.5vw, 1rem);
  font-size: clamp(0.9rem, 2vw, 1.2rem);
}

.message-text {
  font-weight: 500;
  word-break: break-word;
}

.success-icon {
  color: #4CAF50;
  font-size: 18px;
}

.redirect-loader {
  position: relative; /* relative to its container */
  width: 25px;
  height: 25px;
  margin: 0 auto; /* center horizontally */
}

.redirect-loader span {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #000;
  border-radius: 50%;
  top: 50%;  /* center vertically */
  left: 50%; /* center horizontally */
  transform-origin: -8px 0; /* orbit radius */
  animation: spinDots 1.2s linear infinite;
}

/* Distribute the 8 dots evenly */
.redirect-loader span:nth-child(1) { transform: rotate(0deg) translateX(8px) rotate(0deg); animation-delay: 0s; }
.redirect-loader span:nth-child(2) { transform: rotate(45deg) translateX(8px) rotate(-45deg); animation-delay: -0.15s; }
.redirect-loader span:nth-child(3) { transform: rotate(90deg) translateX(8px) rotate(-90deg); animation-delay: -0.3s; }
.redirect-loader span:nth-child(4) { transform: rotate(135deg) translateX(8px) rotate(-135deg); animation-delay: -0.45s; }
.redirect-loader span:nth-child(5) { transform: rotate(180deg) translateX(8px) rotate(-180deg); animation-delay: -0.6s; }
.redirect-loader span:nth-child(6) { transform: rotate(225deg) translateX(8px) rotate(-225deg); animation-delay: -0.75s; }
.redirect-loader span:nth-child(7) { transform: rotate(270deg) translateX(8px) rotate(-270deg); animation-delay: -0.9s; }
.redirect-loader span:nth-child(8) { transform: rotate(315deg) translateX(8px) rotate(-315deg); animation-delay: -1.05s; }

@keyframes spinDots {
  0%   { transform: rotate(0deg) translateX(8px) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(8px) rotate(-360deg); }
}

.login-section {
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  position: absolute;
  width: 100%;
}

.login-section.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  /* keep absolute during transition */
}

.login-section.visible.final {
  position: relative; /* only set after transition ends */
}

/* Keep parent height consistent to avoid jump */
.login-container > .login-header {
  position: relative;
  min-height: 400px;
  transition: height 0.4s ease; /* smooth height change */
}


.forms-wrapper {
  transition: height 0.4s ease; /* Smooth height change */
  overflow: hidden; /* prevent content from overflowing during transition */
  position: relative;
}

/* 🔹 Split layout */
.split-layout {
  display: flex;
  min-height: 100vh;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.split-layout.show {
  opacity: 1;
}
.hidden {
  display: none;
}

