* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: url('https://images.unsplash.com/photo-1497366216548-37526070297c?auto=format&fit=crop&w=1600&q=80') no-repeat center center fixed;
  background-size: cover;
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px;
}

body::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.9) 100%);
  z-index: 0;
}

.main-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  perspective: 2000px;
}


body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  isolation: isolate;
}

.modal-content {
  z-index: 100000;
}

.toast-card.success {
  border-left-color: #22c55e;
}

.toast-card.success .toast-icon {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.portal-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 24px;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
  min-height: 640px;
  transform-style: preserve-3d;
  transition: transform 0s;
  background: transparent;
}

.welcome-section, .login-section {
  grid-column: 1;
  grid-row: 1;
  backface-visibility: hidden;
  transition: transform 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px; 
  overflow: hidden;
  background: linear-gradient(165deg, #000000 0%, #000000 100%); 
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.login-section {
  transform: rotateY(180deg);
  background: linear-gradient(165deg, #050505 0%, #000000 100%);
}

.portal-card.flipped .welcome-section {
  transform: rotateY(-180deg);
}
.portal-card.flipped .login-section {
  transform: rotateY(0deg);
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.welcome-content {
  position: relative;
  z-index: 2;
  text-align: left;
}

.logo-badge {
  margin-bottom: 50px;
  display: inline-block;
}

.logo-badge img{
width:200px;
height:60px;

}
.logo-light {
  max-width: 180px;
  height: auto;
}

.welcome-content h1 {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  color: #ffffff;
  letter-spacing: -1.5px;
}

.welcome-content p {
  font-size: 1.05rem;
  color: #64748b;
  margin-bottom: 40px;
  max-width: 95%;
  line-height: 1.6;
}

.welcome-btns {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.signin-btn, .login-btn, .register-btn-welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  border: none;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.5px;
}

.signin-btn {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.register-btn-welcome {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.signin-btn:hover, .login-btn:hover {
  background: #2563eb; 
  color: #ffffff;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.5);
}

.register-btn-welcome:hover {
  background: #22c55e;
  color: #ffffff;
  border-color: #22c55e;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 25px -5px rgba(34, 197, 94, 0.5);
}

.signin-btn:active, .login-btn:active, .register-btn-welcome:active {
  transform: translateY(1px) scale(0.99);
}

.signin-btn i, .login-btn i, .register-btn-welcome i {
  transition: transform 0.3s ease;
}
.signin-btn:hover i, .login-btn:hover i, .register-btn-welcome:hover i {
  transform: translateX(5px);
}

.login-btn {
  width: 100%;
  background: #ffffff;
  color: #0f172a;
  margin-top: 10px;
  margin-bottom: 15px;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.login-box {
  position: relative;
  z-index: 2;
  width: 100%;
}

.login-logo {
  display: none; 
}

.login-box h2 {
  font-size: 1.9rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.small-text {
  color: #64748b;
  margin-bottom: 35px;
  font-size: 0.95rem;
}

.input-field {
  position: relative;
  margin-bottom: 8px;
}
.input-field i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 1rem;
  transition: color 0.3s;
  z-index: 2;
}

/* FIX: Added !important to override Bootstrap form-control color & background conflicts */
.input-field input {
  width: 100% !important;
  padding: 16px 16px 16px 45px !important;
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 12px !important;
  color: #ffffff !important;
  font-size: 1rem !important;
  outline: none !important;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
}

.input-field input:focus {
  border-color: #2563eb !important;
  background: rgba(37, 99, 235, 0.05) !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1) !important;
}

.input-field input:focus + i {
  color: #2563eb;
}

.input-field label {
  position: absolute;
  left: 45px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
  transition: all 0.2s ease;
  background: transparent;
  padding: 0 6px;
  z-index: 3;
}

.input-field input:focus + label,
.input-field input:not(:placeholder-shown) + label {
  top: 0;
  font-size: 0.75rem;
  color: #2563eb;
  background: #000000;
  z-index: 3;
}

.toggle-password {
  left: auto !important;
  right: 16px;
  cursor: pointer;
  z-index: 2;
}

.error {
  display: block;
  color: #ef4444;
  font-size: 0.8rem;
  margin-bottom: 10px;
  height: 16px;
}

.remember {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: #64748b;
}
.remember label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.remember a { color: #22c55e; text-decoration: none; font-weight: 600; transition: color 0.3s; cursor: pointer; } 
.remember a:hover { color: #2563eb; text-decoration: underline; } 

input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  background: transparent;
  transition: 0.2s;
}
input[type="checkbox"]:checked {
  background: #2563eb; 
  border-color: #2563eb;
}
input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  color: #fff;
  font-size: 12px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.captcha-box {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: rgba(255,255,255,0.03);
  transition: border-color 0.3s;
}
.captcha-box:hover { border-color: rgba(255,255,255,0.2); }
.captcha-left { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: #e2e8f0; }
.captcha-right { text-align: center; color: #64748b; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.captcha-right i { font-size: 1.5rem; color: #22c55e; } 

.register-link {
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.register-link a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
  cursor: pointer;
}
.register-link a:hover { color: #22c55e; }

.back-to-welcome {
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.3s;
}
.back-to-welcome:hover { color: #ffffff; }

.image-section {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  overflow: hidden;
  background: transparent;
}

.image-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 40px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
}
.image-text h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: #ffffff;
}
.image-text p {
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
}

/* --- FIXED MODAL POPUP SPACING & VISIBILITY --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999; /* Increased z-index to stay above everything */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: linear-gradient(165deg, #111827 0%, #000000 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  transform: translateY(40px) scale(0.95);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}
.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.modal-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}


.modal-text {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 25px; 
  line-height: 1.5;
}

#resetForm .input-field, 
#registerForm .input-field {
  margin-bottom: 15px;
}

#registerForm .login-btn {
  margin-top: 10px;
}

/* --- TOAST NOTIFICATION --- */
.toast-container {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.toast-card {
  background: linear-gradient(145deg, #111827 0%, #000000 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid #22c55e; 
  border-radius: 12px;
  padding: 20px;
  width: 350px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transform: translateX(120%); 
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-card.error {
  border-left-color: #ef4444; 
}
.toast-card.error .toast-icon {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.toast-card.show {
  transform: translateX(0); 
  opacity: 1;
}

.toast-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-body {
  flex: 1;
}

.toast-title {
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 5px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.toast-msg {
  color: #94a3b8;
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.4;
}

.toast-close {
  color: #64748b;
  cursor: pointer;
  transition: color 0.2s;
  background: none;
  border: none;
  font-size: 1rem;
}
.toast-close:hover { color: #fff; }

.shake {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
}


.closeModalBtn {
    position: relative;
    z-index: 100000;
    border: none;
    outline: none;
    background: transparent;
    color: #64748b;
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    pointer-events: auto;
}

.closeModalBtn i {
    pointer-events: none;
}

.closeModalBtn:hover {
    color: #00a7f7;
}


@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}


@media (max-width: 991.98px) {
  body {
    overflow-y: auto;
    align-items: flex-start;
    padding-top: 30px;
    padding-bottom: 30px;
  }
  .portal-card {
    grid-template-columns: 1fr;
    min-height: auto;
    max-width: 560px;
    margin: 0 auto;
  }

  .image-section { display: none; }
  .welcome-section, .login-section { padding: 40px 34px; }
  .welcome-content h1 { font-size: 2.4rem; }
  .logo-badge { margin-bottom: 30px; }
  .toast-container { left: 16px; right: 16px; top: 16px; }
  .toast-card { width: 100%; }
  .modal-content { padding: 30px; max-height: 88vh; overflow-y: auto; }


  .input-field input { font-size: 16px !important; }
}


@media (max-width: 575.98px) {
  body { padding: 14px; }
  .portal-card { border-radius: 18px; min-height: 560px; }
  .welcome-section, .login-section { padding: 30px 22px; }
  .welcome-content h1 { font-size: 2rem; }
  .welcome-content p { font-size: .92rem; margin-bottom: 26px; }
  .logo-light { max-width: 140px; }
  .logo-badge { margin-bottom: 22px; }
  .welcome-btns { flex-direction: column; align-items: stretch; }
  .signin-btn, .register-btn-welcome { width: 100%; }
  .login-box h2 { font-size: 1.45rem; }
  .small-text { margin-bottom: 22px; }
  .modal-content { padding: 24px 20px; }
  .modal-header h3 { font-size: 1.2rem; }
}


@media (max-width: 991.98px) and (orientation: landscape) {
  .welcome-section, .login-section { padding: 24px 32px; }
  .welcome-content h1 { font-size: 1.8rem; }
  .welcome-content p { margin-bottom: 18px; }
  .logo-badge { margin-bottom: 14px; }
}


@media (max-width: 379.98px) {
  .welcome-content h1 { font-size: 1.7rem; }
  .login-box h2 { font-size: 1.28rem; }
  .welcome-section, .login-section { padding: 24px 16px; }
  .signin-btn, .login-btn, .register-btn-welcome { padding: 13px 20px; font-size: .88rem; }
}


@media (max-width: 339.98px) {
  .welcome-content h1 { font-size: 1.5rem; }
  .logo-light { max-width: 120px; }
  .remember { font-size: .8rem; }
  .captcha-left { font-size: .8rem; }
}