/**
 * FastCaisse Contact Form Styles
 *
 * This CSS file contains all styling for contact forms
 * and can be included in any page that uses the contact form
 */

/* Contact Form Container */
.contact-form-container {
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin: 20px 0;
}

.contact-form-header {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

.contact-form-header h2 {
  margin: 0 0 10px 0;
  font-size: 28px;
  font-weight: 600;
}

.contact-form-header p {
  margin: 0;
  opacity: 0.9;
  font-size: 16px;
}

/* Form Styling */
.contact-form {
  padding: 40px;
}

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.form-group {
  position: relative;
  margin-bottom: 25px;
}

.form-label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-label .required {
  color: #dc3545;
  margin-left: 3px;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s ease;
  background-color: #fff;
}

.form-control:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-control:hover {
  border-color: #ced4da;
}

.form-control::placeholder {
  color: #6c757d;
  opacity: 0.7;
}

/* Textarea specific styling */
textarea.form-control {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  line-height: 1.5;
}

/* Select specific styling */
select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 12px;
  appearance: none;
  padding-right: 40px;
}

/* Validation States */
.form-group.has-error .form-control {
  border-color: #dc3545;
  background-color: #fff5f5;
}

.form-group.has-error .form-control:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-group.has-success .form-control {
  border-color: #28a745;
  background-color: #f8fff9;
}

.form-group.has-success .form-control:focus {
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Error Messages */
.error-message {
  display: block;
  color: #dc3545;
  font-size: 13px;
  margin-top: 5px;
  font-weight: 500;
}

.error-message::before {
  content: "⚠ ";
  margin-right: 3px;
}

/* Character Counter */
.character-counter {
  text-align: right;
  font-size: 12px;
  color: #6c757d;
  margin-top: 5px;
  font-weight: 500;
}

.character-counter.warning {
  color: #ffc107;
}

.character-counter.danger {
  color: #dc3545;
}

/* Submit Button */
.btn-submit {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border: none;
  border-radius: 8px;
  padding: 15px 40px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
  background: linear-gradient(135deg, #218838 0%, #1e9a80 100%);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-submit i {
  font-size: 14px;
}

/* Loading State */
.btn-submit.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-submit.loading::after {
  content: "";
  width: 16px;
  height: 16px;
  margin-left: 10px;
  border: 2px solid transparent;
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Contact Information */
.contact-info {
  background: #f8f9fa;
  padding: 30px;
  border-radius: 15px;
  margin-top: 30px;
}

.contact-info h3 {
  color: #333;
  margin-bottom: 25px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
}

.contact-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.contact-info-item {
  display: flex;
  align-items: center;
  padding: 20px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.contact-info-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.contact-info-item i {
  font-size: 24px;
  color: #007bff;
  margin-right: 15px;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.contact-info-content strong {
  display: block;
  color: #333;
  font-weight: 600;
  margin-bottom: 3px;
}

.contact-info-content {
  color: #666;
  line-height: 1.4;
}

/* Security Notice */
.security-notice {
  text-align: center;
  margin-top: 25px;
  padding: 15px;
  background: #e8f5e8;
  border-radius: 8px;
  color: #155724;
  font-size: 14px;
}

.security-notice i {
  color: #28a745;
  margin-right: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .contact-form {
    padding: 30px 20px;
  }

  .contact-form-header {
    padding: 25px 20px;
  }

  .contact-form-header h2 {
    font-size: 24px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-row .form-group {
    margin-bottom: 25px;
  }

  .contact-info {
    padding: 25px 15px;
  }

  .contact-info-grid {
    grid-template-columns: 1fr;
  }

  .btn-submit {
    padding: 12px 30px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .contact-form-container {
    margin: 10px;
    border-radius: 10px;
  }

  .contact-form {
    padding: 20px 15px;
  }

  .contact-form-header {
    padding: 20px 15px;
  }

  .contact-form-header h2 {
    font-size: 20px;
  }

  .form-control {
    padding: 10px 12px;
    font-size: 15px;
  }

  .contact-info {
    padding: 20px 10px;
  }

  .contact-info-item {
    padding: 15px;
  }
}

/* Custom SweetAlert2 Styling */
.swal2-popup {
  border-radius: 15px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

.swal2-title {
  font-size: 24px !important;
  font-weight: 600 !important;
}

.swal2-content {
  font-size: 16px !important;
  line-height: 1.5 !important;
}

.swal2-confirm {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 12px 30px !important;
  font-weight: 600 !important;
}

.swal2-cancel {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 12px 30px !important;
  font-weight: 600 !important;
}

/* Print Styles */
@media print {
  .contact-form-container {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .btn-submit {
    display: none;
  }

  .contact-info {
    page-break-inside: avoid;
  }
}

/* Turnstile Widget Styling */
.cf-turnstile {
  margin: 20px 0;
  max-width: 100%;
  display: flex;
  justify-content: center;
}

/* Ensure Turnstile is responsive */
@media (max-width: 768px) {
  .cf-turnstile {
    transform: scale(0.9);
    transform-origin: center;
  }
}

@media (max-width: 480px) {
  .cf-turnstile {
    transform: scale(0.8);
    transform-origin: center;
  }
}
