/* Modal Background */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5); /* Dimmed background */
}

.modal.show {
  display: block;
}

/* Modal Content Box */
.modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Different max-width for login and register modals */
#loginModal .modal-content {
  max-width: 400px;
}

#registerModal .modal-content {
  max-width: 450px; /* Wider to accommodate more fields */
}

/* Prevent page scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Close Button (×) */
.close-btn {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
}

/* Welcome and Subtext */
.welcome-text {
  font-size: 20px;
  margin-bottom: 8px;
  color: #2d2dff;
}

.sub-text {
  font-size: 14px;
  margin-bottom: 20px;
  color: #555;
}

/* Input Fields - Common styles */
#loginForm input[type="email"],
#loginForm input[type="password"],
#registerForm input[type="text"],
#registerForm input[type="email"],
#registerForm input[type="password"] {
  height: 42px;
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 14px;
}

/* Forgot Password Link */
.forgot {
  text-align: right;
  font-size: 13px;
  margin-bottom: 15px;
}

.forgot a {
  color: #2d2dff;
  text-decoration: none;
}

.forgot a:hover {
  text-decoration: underline;
}

/* Form Buttons */
#loginForm button,
#registerForm button {
  width: 100%;
  padding: 12px;
  background-color: #2d2dff;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 10px;
}

#loginForm button:hover,
#registerForm button:hover {
  background-color: #1b1bbf;
}

/* Register/Login Links */
.register-link,
.login-link {
  margin-top: 20px;
  font-size: 14px;
}

.register-link a,
.login-link a {
  color: #2d2dff;
  text-decoration: none;
  font-weight: bold;
}

.register-link a:hover,
.login-link a:hover {
  text-decoration: underline;
}

/* Password Wrapper */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  width: 100%;
  padding: 12px;
  padding-right: 60px; /* Reserve space for Show/Hide */
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 14px;
  height: 42px; /* consistent height */
}

#togglePassword,
.toggle-password {
  position: absolute;
  right: 16px;
  font-size: 14px;
  color: #2d2dff;
  cursor: pointer;
  user-select: none;
  min-width: 40px;
  text-align: right;
}

/* Register form specific styles */
.terms {
  display: flex;
  align-items: center;
  margin: 15px 0;
  font-size: 13px;
}

.terms input[type="checkbox"] {
  margin-right: 8px;
}

.terms a {
  color: #2d2dff;
  text-decoration: none;
}

.terms a:hover {
  text-decoration: underline;
}