﻿/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  opacity: 0;
  animation: bodyFadeIn 0.8s ease-out forwards;
}

@keyframes bodyFadeIn {
  to { opacity: 1; }
}



/* Layout */
.login-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Left Section */
.login-left {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

#error {
  color: #e53935;
  margin-top: 10px;
  font-size: 0.9rem;
  text-align: center;
}

.success {
  color: #2e7d32;
}


.login-box {
  width: 90%;
  max-width: 400px;
  padding: 50px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);

  /* Add animation */
  transform: translateY(40px);
  opacity: 0;
  animation: slideFade 1s ease-out forwards;
  animation-delay: 0.2s;
}

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


.logo {
  width: 90px;
  margin-bottom: 30px;
}

h2 {
  font-size: 2rem;
  color: #00115a;
  margin-bottom: 10px;
}

.login-box p {
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 25px;
}


/* Social Login */
.social-login {
  margin-bottom: 20px;
}

.google-login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  gap: 10px;
  transition: box-shadow 0.2s;
}

.google-login:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.google-login img {
  width: 20px;
  height: 20px;
}

.divider {
  text-align: center;
  margin: 20px 0;
  color: #999;
  font-size: 0.85rem;
}

/* Form */
form input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 8px;
}

form input:focus {
  border-color: #0040ff;
  outline: none;
  background: #f0f8ff;
}

form .forgot-password {
  display: block;
  text-align: right;
  margin: 8px 0;
  font-size: 0.8rem;
  color: #0040ff;
  text-decoration: none;
}

form button {
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  background: linear-gradient(135deg, #696969, #6c6d6d);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

form button:hover {
  background: #2a2a2b;
}

/* Footer */
.login-note {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: #555;
}

.login-note a {
  color: #0040ff;
  text-decoration: none;
}

/* Right Panel */
.login-right {
  flex: 1.2;
  position: relative;
  background: url('../img/log in picture-right.jpg') center/cover no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  isolation: isolate;

}

.login-illustration {
  width: 60%;
  max-width: 400px;
  z-index: 2;
}

/* Bubbles */
.login-bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

#darkModeToggle {
  padding: 8px 16px;
  border: 1px solid #0070ff;
  border-radius: 999px;
  background: white;
  color: #0070ff;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

#darkModeToggle:hover {
  background: #0070ff;
  color: white;
}
body.dark-mode #darkModeToggle {
  background: #181c2a;
  color: #44aaff;
  border-color: #44aaff;
}

body.dark-mode #darkModeToggle:hover {
  background: #44aaff;
  color: white;
}
.toggle-switch {
  display: inline-block;
  width: 48px;
  height: 24px;
  position: absolute; top: 24px; right: 32px; z-index: 10;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #595a72;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}



input:checked+.slider {
  background-color: #2d37ee;
}

input:checked+.slider:before {
  transform: translateX(24px);
}

.bubble {
  animation: float 12s ease-in-out infinite alternate,
             bubbleFade 1s ease-out forwards;
}

@keyframes bubbleFade {
  0%   { opacity: 0; transform: scale(0.9); }
  100% { opacity: 0.4; transform: scale(1); }
}


.b1 { width: 200px; height: 200px; top: 5%; left: 10%; }
.b2 { width: 130px; height: 130px; top: 70%; left: 5%; }
.b3 { width: 280px; height: 280px; top: 20%; left: 75%; }
.b4 { width: 100px; height: 100px; top: 80%; left: 80%; }

@keyframes float {
  from { transform: translateY(0); }
  to { transform: translateY(-15px); }
}

/* Dark Mode */
body.dark-mode {
  background: linear-gradient(226deg, black, #1e1e1e);
  color: #f1f5fa;
}

body.dark-mode .login-left {
  background: linear-gradient(226deg, #121212, #1e1e1e);
}

body.dark-mode .login-box {
    background: transparent;
    backdrop-filter: blur(50px);
    opacity: 0.5;
}

body.dark-mode h2,
body.dark-mode .login-box p,
body.dark-mode .login-note,
body.dark-mode .divider {
  color: #f1f5fa;
}
body.dark-mode #loginPrompt {
  color: #f1f5fa;
  
}

body.dark-mode form input {
  background: #181c2a;
  color: #f1f5fa;
  border-color: #2d37ee;
}

body.dark-mode form input:focus {
  background: #232946;
  border-color: #44aaff;
}

body.dark-mode form button {
  background: linear-gradient(135deg, #2d37ee, #44aaff);
  color: #fff;
}

body.dark-mode form button:hover {
  background: #44aaff;
  color: #181c2a;
}

body.dark-mode .google-login {
  background: #232946;
  color: #f1f5fa;
  border-color: #2d37ee;
}

body.dark-mode .google-login:hover {
  background: #181c2a;
}

body.dark-mode .login-note a {
  color: #44aaff;
}



/* Responsive */
@media (max-width: 768px) {
  body.dark-mode #loginPrompt {
  color: #f1f5fa;
  margin-left: 35px;
}

  #loginPrompt {
  color: #555;
  font-size: 0.95rem;
  margin-left: 35px;
}
  #loginLogo{
  margin-left: 50%;
}
  .login-container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    height: auto;
  }

  .login-left {
    flex: none;
    width: 100%;
    padding: 30px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
  }

  .login-box {
    margin: 0 auto;
    padding: 40px 16px;
    max-width: 400px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .logo {
    width: 90px;
    margin-bottom: 30px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    /* Remove any absolute or fixed positioning if present */
    position: static !important;
  }
}
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-wrapper input {
  width: 100%;
  padding-right: 40px; /* make space for the eye icon */
}

.password-wrapper .toggle-password {
  position: absolute;
  right: 10px;
  cursor: pointer;
  color: #666;
  font-size: 18px;
}


/* Password Requirements Widget */
/* Password Requirements Widget (animated) */
.pwd-req {
  /* collapsed state (no layout space) */
  max-height: 0;
  opacity: 0; 
  overflow: hidden;
  transform: translateY(-6px);
  margin-top: 0;

  /* visual style */
  padding: 0 14px;            /* vertical padding animates in */
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.06);

  /* animation */
  transition:
    max-height .28s ease,
    opacity .22s ease,
    transform .22s ease,
    margin-top .22s ease,
    padding .22s ease;
}

.pwd-req.show {
  /* expanded state */
  max-height: 320px;          /* large enough to fit the list */
  opacity: 1;
  transform: translateY(0);
  margin-top: 8px;
  padding: 12px 14px;
}

/* layout inside */
.pwd-req__title {
  font-size: .9rem;
  color: #00115a;
  margin-bottom: 8px;
  font-weight: 600;
}
.pwd-req__list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.pwd-req__list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
  color: #444;
}
.pwd-req__list .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #d1d5db;
  box-shadow: 0 0 0 2px #eee inset;
  flex: 0 0 10px;
}
.pwd-req__list li.met .dot { background: #16a34a; box-shadow: none; }
.pwd-req__list li.met .text { color: #0f5132; }
.pwd-req__list li.unmet .dot { background: #ef4444; }
.pwd-req__list li.unmet .text { color: #7f1d1d; }

/* Compact on very small screens */
@media (max-width: 420px) {
  .pwd-req__list { grid-template-columns: 1fr; }
}

/* Dark mode harmonization */
body.dark-mode .pwd-req {
  background: #181c2a;
  border-color: #2d37ee;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
body.dark-mode .pwd-req__title { color: #44aaff; }
body.dark-mode .pwd-req__list li { color: #cfd8e3; }
body.dark-mode .pwd-req__list .dot { background: #475569; box-shadow: 0 0 0 2px #232946 inset; }
body.dark-mode .pwd-req__list li.met .text { color: #9ae6b4; }
body.dark-mode .pwd-req__list li.unmet .text { color: #fecaca; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .pwd-req, .pwd-req.show {
    transition: none !important;
  }
}
