/* ==================== POPUP FORMS ==================== */

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.popup {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  transform: translateY(30px) scale(0.95);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.popup-overlay.active .popup {
  transform: translateY(0) scale(1);
}

.popup__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  z-index: 10;
}

.popup__close:hover {
  background: #5271FF;
  color: #fff;
}

.popup__header {
  padding: 32px 32px 0;
  text-align: center;
}

.popup__title {
  font-size: 2.4rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.popup__subtitle {
  font-size: 1.4rem;
  color: #666;
  line-height: 1.5;
}

.popup__form {
  padding: 24px 32px 32px;
}

.popup__field {
  margin-bottom: 20px;
}

.popup__field--full {
  width: 100%;
}

.popup__field label {
  display: block;
  font-size: 1.4rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}

.popup__field label .required {
  color: #e74c3c;
}

.popup__field input[type="text"],
.popup__field input[type="tel"],
.popup__field input[type="email"],
.popup__field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1.5rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafafa;
}

.popup__field input:focus,
.popup__field textarea:focus {
  outline: none;
  border-color: #5271FF;
  box-shadow: 0 0 0 4px rgba(82, 113, 255, 0.1);
  background: #fff;
}

.popup__field input::placeholder,
.popup__field textarea::placeholder {
  color: #adb5bd;
}

.popup__field textarea {
  min-height: 100px;
  resize: vertical;
}

.popup__checkbox {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 1.3rem !important;
  color: #555 !important;
}

.popup__checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.popup__checkbox-custom {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid #ccc;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-top: 2px;
}

.popup__checkbox input:checked + .popup__checkbox-custom {
  background: #5271FF;
  border-color: #5271FF;
}

.popup__checkbox input:checked + .popup__checkbox-custom::after {
  content: "✓";
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.popup__checkbox a {
  color: #5271FF;
  text-decoration: underline;
}

.popup__checkbox a:hover {
  text-decoration: none;
}

.popup__actions {
  margin-top: 24px;
}

.popup__btn {
  width: 100%;
  padding: 16px 24px;
  font-size: 1.6rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.popup__btn i,
.popup__btn [data-icon] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  font-size: 2rem;
}

.popup__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(82, 113, 255, 0.4);
}

.popup__btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.popup__success {
  text-align: center;
  padding: 40px 20px;
}

.popup__success-icon {
  width: 80px;
  height: 80px;
  background: #27ae60;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #fff;
  margin: 0 auto 20px;
}

.popup__success h4 {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.popup__success p {
  font-size: 1.4rem;
  color: #666;
}

/* Form validation styles */
.popup__field input.error,
.popup__field textarea.error {
  border-color: #e74c3c;
  box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

.popup__checkbox.error .popup__checkbox-custom {
  border-color: #e74c3c;
}

/* Loading spinner */
.popup__spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: popup-spin 0.8s linear infinite;
}

@keyframes popup-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Popup responsive */
@media (max-width: 576px) {
  .popup {
    max-width: 100%;
    margin: 0 16px;
    border-radius: 12px;
  }
  
  .popup__header {
    padding: 24px 20px 0;
  }
  
  .popup__title {
    font-size: 2rem;
  }
  
  .popup__form {
    padding: 20px 20px 24px;
  }
  
  .popup__close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }
}
