/* Google Fonts - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

.container {
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F0F9FF 0%, #E0E7FF 50%, #F3E8FF 100%);
  column-gap: 30px;
}

.form {
  position: absolute;
  max-width: 430px;
  width: 100%;
  padding: 30px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* Add max height and scroll for signup form with many fields */
  max-height: 90vh;
  overflow-y: auto;
}

.form.signup {
  opacity: 0;
  pointer-events: none;
}

.forms.show-signup .form.signup {
  opacity: 1;
  pointer-events: auto;
}

.forms.show-signup .form.login {
  opacity: 0;
  pointer-events: none;
}

header {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #4F8FD9 0%, #6366F1 50%, #8B5CF6 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  margin-bottom: 8px;
}

form {
  margin-top: 30px;
}

.form .field {
  position: relative;
  height: 50px;
  width: 100%;
  margin-top: 20px;
  border-radius: 6px;
}

/* Special styling for checkbox field */
.field.checkbox-field {
  height: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding: 10px 0;
}

.field.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: #354259;
}

.field.checkbox-field label {
  font-size: 14px;
  color: #232836;
  cursor: pointer;
  line-height: 1.4;
  flex: 1;
}

/* Input Styling */
.field input,
.field button,
.field select {
  height: 100%;
  width: 100%;
  border: none;
  font-size: 16px;
  font-weight: 400;
  border-radius: 6px;
}

/* Input Focus with Pop Animation */
.field input,
.field select {
  outline: none;
  padding: 0 15px;
  border: 1px solid #CACACA;
  transition: all 0.3s ease;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  backdrop-filter: blur(5px);
}

.field input:focus,
.field select:focus {
  border-color: #6366F1;
  border-bottom-width: 2px;
  animation: textPop 0.2s ease-in-out;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Select Field Styling */
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 20px;
  cursor: pointer;
  color: #232836;
}

.field select:invalid {
  color: #999;
}

.field select option {
  color: #232836;
}

/* Date Input Styling */
.field input[type="date"] {
  color: #666;
  position: relative;
}

.field input[type="date"]:focus,
.field input[type="date"]:valid {
  color: #232836;
}

/* Tel Input Styling */
.field input[type="tel"] {
  letter-spacing: 0.5px;
}

/* Keyframes for Text Pop Animation */
@keyframes textPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05); /* Slightly enlarge */
  }
  100% {
    transform: scale(1);
  }
}

/* Button Styling */
.field button {
  color: #fff;
  background: linear-gradient(135deg, #4F8FD9 0%, #6366F1 50%, #8B5CF6 100%);
  transition: all 0.3s ease, transform 0.2s ease;
  cursor: pointer;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(79, 143, 217, 0.3);
}

.field button:hover {
  background: linear-gradient(135deg, #016dcb 0%, #5b21b6 50%, #7c3aed 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(79, 143, 217, 0.4);
}

.eye-icon {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  font-size: 18px;
  color: #8b8b8b;
  cursor: pointer;
  padding: 5px;
  transition: color 0.3s ease;
}

.eye-icon:hover {
  color: #016dcb;
}

.form-link {
  text-align: center;
  margin-top: 10px;
}

.form-link span,
.form-link a {
  font-size: 14px;
  font-weight: 400;
  color: #232836;
}

.form a {
  color: #6366F1;
  text-decoration: none;
  font-weight: 500;
}

.form-content a:hover {
  text-decoration: underline;
}

/* Line Separator */
.line {
  position: relative;
  height: 1px;
  width: 100%;
  margin: 36px 0;
  background-color: #d4d4d4;
}

.line::before {
  content: 'Or';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #FFF;
  color: #8b8b8b;
  padding: 0 15px;
}

/* Social Media Buttons */
.media-options a {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Facebook Button */
a.facebook {
  color: #fff;
  background-color: #4267b2;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

a.facebook:hover {
  background-color: #365899;
  transform: scale(1.05); /* Slightly enlarge the button */
}

a.facebook .facebook-icon {
  height: 28px;
  width: 28px;
  color: #0171d3;
  font-size: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
}

/* Google Button */
a.google {
  border: 1px solid #CACACA;
  background-color: #fff;
  transition: all 0.3s ease, transform 0.2s ease;
}

a.google:hover {
  background-color: #f1f1f1;
  transform: scale(1.05); /* Slightly enlarge the button */
}

a.google span {
  font-weight: 500;
  opacity: 0.6;
  color: #232836;
}

/* Form Validation Styles */
.field input:invalid {
  border-color: #e74c3c;
}

.field input:valid {
  border-color: #27ae60;
}

/* Smooth transitions for form switching */
.forms {
  position: relative;
  transition: all 0.3s ease;
}

.form {
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Enhanced hover effects */
.field input:hover,
.field select:hover {
  border-color: #999;
}

/* Loading state for buttons */
.field button:active {
  transform: scale(0.98);
}

/* Responsive Design */
@media screen and (max-width: 480px) {
  .form {
    padding: 20px 15px;
    max-width: 95%;
    max-height: 95vh;
  }
  
  .field.checkbox-field {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .field.checkbox-field input[type="checkbox"] {
    align-self: flex-start;
  }
  
  header {
    font-size: 24px;
  }
  
  .field input,
  .field button,
  .field select {
    font-size: 14px;
  }
}

@media screen and (max-width: 400px) {
  .form {
    padding: 15px 10px;
  }
  
  .container {
    padding: 10px;
  }
}

/* Custom scrollbar for forms with many fields */
.form::-webkit-scrollbar {
  width: 6px;
}

.form::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.form::-webkit-scrollbar-thumb {
  background: #354259;
  border-radius: 3px;
}

.form::-webkit-scrollbar-thumb:hover {
  background: #016dcb;
}

/* ===============================================
   EMAIL VERIFICATION POPUP STYLES
   =============================================== */

/* Popup Overlay */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.popup-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Popup Container */
.popup-container {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  transform: translateY(0);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
}

.popup-overlay.hidden .popup-container {
  transform: translateY(-50px) scale(0.9);
}

/* Popup Content */
.popup-content {
  padding: 0;
}

/* Popup Header */
.popup-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #e5e5e5;
  position: relative;
  text-align: center;
}

.popup-icon {
  width: 60px;
  height: 60px;
  background-color: #354259;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  transition: all 0.3s ease;
}

.popup-icon i {
  font-size: 28px;
  color: #fff;
}

.popup-icon.success {
  background-color: #27ae60;
  animation: pulse 2s infinite;
}

.popup-icon.loading {
  background-color: #f39c12;
}

.popup-icon.loading i {
  animation: spin 1s linear infinite;
}

.popup-icon.error {
  background-color: #e74c3c;
}

#popup-title {
  font-size: 22px;
  font-weight: 600;
  color: #232836;
  margin: 0;
}

.popup-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  color: #8b8b8b;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.popup-close:hover {
  background-color: #f5f5f5;
  color: #354259;
}

/* Popup Body */
.popup-body {
  padding: 24px;
  text-align: center;
}

#popup-message {
  font-size: 16px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 16px;
}

.email-display {
  background-color: #f8f9fa;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 0;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: #354259;
  font-weight: 500;
  word-break: break-all;
}

/* Loading Indicator */
.loading-indicator {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading-dots {
  display: flex;
  gap: 6px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background-color: #354259;
  border-radius: 50%;
  animation: loadingDots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

/* Verification Status */
.verification-status {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 14px;
  font-weight: 500;
  display: none;
}

.verification-status.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  display: block;
}

.verification-status.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  display: block;
}

.verification-status.info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
  display: block;
}

/* Popup Footer */
.popup-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid #e5e5e5;
  background-color: #f8f9fa;
}

.popup-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.popup-actions button {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background-color: #354259;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background-color: #016dcb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(1, 109, 203, 0.3);
}

.btn-secondary {
  background-color: transparent;
  color: #354259;
  border: 2px solid #354259;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #354259;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(53, 66, 89, 0.3);
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#resend-timer {
  font-size: 12px;
  opacity: 0.8;
}

/* Help Text */
.popup-help {
  text-align: center;
}

.help-text {
  font-size: 13px;
  color: #8b8b8b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
}

.help-text i {
  font-size: 14px;
}

/* Animations */
@keyframes loadingDots {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(39, 174, 96, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.popup-container {
  animation: slideInUp 0.4s ease-out;
}

/* Responsive Design for Popup */
@media screen and (max-width: 480px) {
  .popup-container {
    width: 95%;
    margin: 20px;
  }
  
  .popup-header {
    padding: 20px 20px 16px;
  }
  
  .popup-body {
    padding: 20px;
  }
  
  .popup-footer {
    padding: 16px 20px 20px;
  }
  
  .popup-actions {
    flex-direction: column;
  }
  
  .popup-actions button {
    width: 100%;
  }
  
  #popup-title {
    font-size: 20px;
  }
  
  .popup-icon {
    width: 50px;
    height: 50px;
  }
  
  .popup-icon i {
    font-size: 24px;
  }
  
  .popup-close {
    top: 16px;
    right: 16px;
  }
}

@media screen and (max-width: 400px) {
  .popup-container {
    width: 98%;
    margin: 10px;
  }
  
  .email-display {
    font-size: 12px;
    padding: 10px 12px;
  }
}

/* Custom scrollbar for popup */
.popup-container::-webkit-scrollbar {
  width: 6px;
}

.popup-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.popup-container::-webkit-scrollbar-thumb {
  background: #354259;
  border-radius: 3px;
}

.popup-container::-webkit-scrollbar-thumb:hover {
  background: #016dcb;
}

/* ===============================================
   TOAST NOTIFICATION STYLES
   =============================================== */

/* Toast Container */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

/* Individual Toast */
.toast {
  min-width: 320px;
  max-width: 400px;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  font-family: 'Inter', 'Poppins', sans-serif;
  position: relative;
  overflow: hidden;
}

/* Toast Show Animation */
.toast.show {
  transform: translateX(0);
  opacity: 1;
}

/* Toast Hide Animation */
.toast.hide {
  transform: translateX(400px);
  opacity: 0;
}

/* Toast Types */
.toast.success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(21, 128, 61, 0.95));
  color: white;
  border-color: rgba(34, 197, 94, 0.3);
}

.toast.error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(185, 28, 28, 0.95));
  color: white;
  border-color: rgba(239, 68, 68, 0.3);
}

.toast.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(180, 83, 9, 0.95));
  color: white;
  border-color: rgba(245, 158, 11, 0.3);
}

.toast.info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(29, 78, 216, 0.95));
  color: white;
  border-color: rgba(59, 130, 246, 0.3);
}

/* Toast Icon */
.toast-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  animation: toastIconPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-icon i {
  font-size: 14px;
}

/* Toast Content */
.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toast-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}

.toast-message {
  font-size: 13px;
  opacity: 0.9;
  line-height: 1.4;
}

/* Toast Close Button */
.toast-close {
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Progress Bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 0 0 12px 12px;
  transition: width linear;
}

/* Success specific animations */
.toast.success .toast-icon {
  animation: successPulse 0.8s ease-out;
}

.toast.error .toast-icon {
  animation: errorShake 0.6s ease-out;
}

/* Loading Toast */
.toast.loading {
  background: linear-gradient(135deg, rgba(79, 143, 217, 0.95), rgba(99, 102, 241, 0.95));
  color: white;
  border-color: rgba(79, 143, 217, 0.3);
}

.toast.loading .toast-icon i {
  animation: spin 1s linear infinite;
}

/* Keyframe Animations */
@keyframes toastIconPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes successPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

@keyframes errorShake {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 70% {
    transform: translateX(-5px);
  }
  40%, 60% {
    transform: translateX(5px);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media screen and (max-width: 480px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  
  .toast {
    min-width: auto;
    max-width: none;
    width: 100%;
    transform: translateY(-100px);
  }
  
  .toast.show {
    transform: translateY(0);
  }
  
  .toast.hide {
    transform: translateY(-100px);
  }
}

/* Special Success Login Animation */
@keyframes loginSuccess {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.05);
  }
  50% {
    transform: scale(1);
  }
  75% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.toast.success.login-success {
  animation: loginSuccess 0.8s ease-out;
}

.toast.success.login-success .toast-icon {
  animation: successPulse 1.2s ease-out;
}