.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.55);
  backdrop-filter: blur(6px);
  z-index: 9998;
  display: none;
}

.auth-modal-overlay.active {
  display: block;
}

/* Modal */
.auth-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 100%;
  max-width: 420px;
  background: var(--card-white);
  border-radius: var(--radius-lg);
  padding: 26px 24px 24px;
  box-shadow: var(--shadow-1);
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  z-index: 9999;
  display: none;
  transition: all 0.35s ease;
  max-height: 90vh;         
  overflow-y: auto;
}

.auth-modal.active {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Headings and text */
.auth-modal h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--blaq);
  margin-bottom: 6px;
}

.auth-modal p {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 20px;
}

/* Inputs */
.auth-modal input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1px solid var(--border-light);
  background: var(--bg-light);
  font-size: 16px; 
  color: var(--blaq);
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.auth-modal input::placeholder {
  color: var(--text);
}

.auth-modal input:focus {
  outline: none;
  background: var(--primary-white);
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(19, 116, 237, 0.15);
}

/* Buttons */
.auth-modal button {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  border: none;
  background: var(--primary-blue);
  color: var(--primary-white);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.auth-modal button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(19, 116, 237, 0.35);
}

/* Toggle text */
.auth-modal .toggle {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--text);
}

.auth-modal .toggle span {
  color: var(--primary-blue);
  font-weight: 500;
  cursor: pointer;
}

.auth-modal .toggle span:hover {
  text-decoration: underline;
}

/* Form group */
.form-group {
  margin-bottom: 14px;
}

.form-group.hidden {
  display: none;
}

/* Forgot modal inputs */
#forgotModal input {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--border-light);
  padding: 0 14px;
  font-size: 16px;
  box-sizing: border-box;
}

#forgotModal input.error {
  border-color: #d93025;
}

.field-error {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #d93025;
  min-height: 14px;
}

#forgotModal input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(19,116,237,.12);
}

#forgotModal .cancel {
  background: transparent;
  border: none;
  color: #d93025;
}

/* ---------- MOBILE RESPONSIVE FIXES ---------- */
@media (max-width: 480px) {
  .auth-modal {
    width: 90%;
    max-width: 95%;
    padding: 20px;
  }

  .auth-modal input {
    height: 50px;
    font-size: 16px;
  }

  .auth-modal button {
    height: 50px;
    font-size: 16px;
  }

  .auth-modal h2 {
    font-size: 20px;
  }

  .auth-modal p {
    font-size: 13px;
  }

  #forgotModal input {
    height: 46px;
    font-size: 16px;
  }
}
@media (max-width: 768px) {
  .auth-modal {
    top: 50% !important; 
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    
    width: 90% !important;
    max-height: 85vh; 
    overflow-y: auto;
    
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
  }

  .auth-modal input,
  .auth-modal button {
    opacity: 1 !important;
    visibility: visible !important;
  }

  .auth-modal-overlay {
    backdrop-filter: none !important; 
  }
}