/* ========================================
   POPUP FORMS STYLES
======================================== */

/* Modal Overlay */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-out;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { 
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to { 
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Modal Content */
.modal-content {
  background-color: var(--color-white);
  border-radius: 20px;
  padding: 0;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.4s ease-out;
}

/* Close Button */
.close {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 28px;
  font-weight: bold;
  color: var(--color-dark-gray-1);
  cursor: pointer;
  z-index: 1;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close:hover {
  background-color: var(--color-light-gray-1);
  color: var(--color-maroon-primary);
}

/* Form Container */
.form-container {
  padding: 40px 35px 35px;
}

.form-container h2 {
  font-family: var(--font-montserrat);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-maroon-primary);
  margin-bottom: 8px;
  text-align: center;
}

.form-container p {
  font-family: var(--font-poppins);
  font-size: 16px;
  color: var(--color-dark-gray-1);
  text-align: center;
  margin-bottom: 30px;
  line-height: 1.5;
}

/* Form Styles */
.popup-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group input,
.form-group select {
  font-family: var(--font-poppins);
  font-size: 14px;
  padding: 15px 18px;
  border: 2px solid var(--color-light-gray-2);
  border-radius: 12px;
  background-color: var(--color-white);
  color: var(--color-dark-gray-1);
  transition: all 0.3s ease;
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--color-green-primary);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-group input::placeholder {
  color: var(--color-gray-1);
  font-weight: 400;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
}

.form-group select option {
  padding: 10px;
}

/* Submit Button */
.form-submit-btn {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  margin-top: 10px;
}

.form-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-loading {
  display: none;
}

.form-submit-btn.loading .btn-text {
  display: none;
}

.form-submit-btn.loading .btn-loading {
  display: inline;
}

/* Success Message */
.form-success {
  background-color: var(--color-green-light);
  color: var(--color-green-dark);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
  display: none;
}

.form-error {
  background-color: #fee;
  color: #c53030;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .form-container {
    padding: 30px 25px 25px;
  }
  
  .form-container h2 {
    font-size: 24px;
  }
  
  .form-container p {
    font-size: 14px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .form-group input,
  .form-group select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 14px 16px;
  }
  
  .close {
    top: 15px;
    right: 20px;
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .form-container {
    padding: 25px 20px 20px;
  }
  
  .form-container h2 {
    font-size: 22px;
  }
  
  .popup-form {
    gap: 16px;
  }
}

/* Loading Animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.form-submit-btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  margin: auto;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}
