/* ==== Global & Body ==== */
body {
  font-family: Arial, sans-serif;
  background-color: #f8f9fa;
  margin: 0;
  padding: 0;
  color: #333;
}

/* ==== Form Background & Container ==== */
#form-background {
  background: #f8f9fa;
  padding: 20px;
}

#form-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 30px 20px;
  background: #f0f2f5;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  font-size: 1.1rem; /* Increased font size */
}

/* ==== Scroll to Top Button ==== */
#scrollTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  background-color: #0444ec;
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 24px;
  cursor: pointer;
  display: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s, transform 0.3s;
}
#scrollTopBtn:hover {
  background-color: #022b9c;
  transform: translateY(-2px);
}

/* ==== Form Parts & Progress Bar ==== */
.form-part {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}
.form-part.active {
  display: block;
}

.progress {
  background-color: #e9ecef;
  border-radius: .25rem;
  height: 20px;
}

.progress-bar {
  background-color: #0444ec;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  transition: width .6s ease;
}

/* ==== Form Groups ==== */
.form-group {
  margin-bottom: 25px;
}

/* Labels */
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #444;
}
.form-group label.required::after {
  content: " *";
  color: red;
}

/* Inputs & Selects */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="month"],
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  font-size: 1.1rem; /* Increased font size */
}
.form-group input:focus,
.form-group select:focus {
  border-color: #0444ec;
  box-shadow: 0 0 0 3px rgba(4, 68, 236, 0.2);
  outline: none;
}

.form-group select.form-control {
  height: auto !important;
  padding: 15px 12px !important;
}

/* Radio & Checkbox Groups */
.radio-options,
.checkbox-options {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 10px;
}
.radio-options div,
.checkbox-options div {
  display: flex;
  align-items: center;
}
.radio-options input,
.checkbox-options input {
  margin-right: 8px;
}

/* ==== Buttons ==== */
.buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
}

.buttons .btn {
  padding: 12px 28px;
  border: none;
  border-radius: 25px !important;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

#form-section .btn-primary {
  background-color: #0444ec;
  color: white;
}

#form-section .btn-primary:hover {
  background-color: #022b9c;
  transform: translateY(-2px);
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
}

#form-section .btn-secondary {
  background-color: #f1f1f1;
  color: #333;
  border: 1px solid #ddd;
}

#form-section .btn-secondary:hover {
  background-color: #ddd;
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
}

/* Loading animation */
.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  margin-left: -10px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.btn.loading {
  color: transparent !important;
  pointer-events: none;
}

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

/* ==== Error States ==== */
.form-group.error input,
.form-group.error select {
  border-color: red;
}
.form-group.error label {
  color: red;
}

.required-tooltip {
  color: red;
  margin-left: 5px;
  cursor: help;
  font-weight: bold;
}


/* ==== Animations ==== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==== Responsive ==== */
@media (max-width: 600px) {
  .radio-options,
  .checkbox-options {
    flex-direction: column;
  }
  .buttons {
    flex-direction: column-reverse;
    gap: 10px;
  }
  .btn {
    width: 100%;
    text-align: center;
  }
}


#step-4 .form-part,
#step-4 .checkbox-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#step-4 label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#step-4 input[type="checkbox"] {
  margin-right: 10px;
}

input[type="radio"]:required:invalid + label {
  color: red;
}

/* ==== Champs remplis (BLEU clair) ==== */
input.filled,
select.filled {
  background-color: #e8f0fe;
}

/* ==== Alerte personnalisée ==== */
.custom-alert {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 280px;
  max-width: 90%;
  background: #fff;
  border: 1px solid #0444ec;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 15px 20px;
  border-radius: 6px;
  display: none;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: #0444ec;
  z-index: 10000;
  animation: slideDown 0.3s ease-out;
}
.custom-alert.show {
  display: flex;
}
#custom-alert-close {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #0444ec;
}
@keyframes slideDown {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ==== Recap Container ==== */
#recap-container {
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background-color: #f9f9f9;
}

#recap-container h3 {
  margin-bottom: 20px;
  text-align: center;
}

#recap-container p {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

#recap-container p strong {
  color: #0444ec;
  margin-right: 10px;
}

.recap-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background-color: #e9ecef;
  border-radius: 5px;
  margin-top: 20px;
}

.recap-price p {
  margin: 0;
  font-size: 1.1rem;
}

.recap-price span {
  font-size: 1.5rem;
  font-weight: bold;
  color: #0444ec;
}

/* Apply light blue background to filled Select2 fields */
.select2-container--bootstrap4 .select2-selection--single.filled {
  background-color: #e8f0fe !important;
}

/* Custom styles for Select2 to match form-control */
.select2-container--bootstrap4 .select2-selection--single {
  height: auto !important; /* Override default Select2 height */
  padding: 15px 12px !important; /* Match form-control padding */
  border: 1px solid #ccc !important; /* Match form-control border */
  border-radius: 6px !important; /* Match form-control border-radius */
  font-size: 1.1rem !important; /* Match form-control font-size */
  box-sizing: border-box !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
}

.select2-container--bootstrap4 .select2-selection--single:focus,
.select2-container--bootstrap4.select2-container--focus .select2-selection--single {
  border-color: #0444ec !important;
  box-shadow: 0 0 0 3px rgba(4, 68, 236, 0.2) !important;
  outline: none !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
  line-height: normal !important; /* Adjust line-height */
  color: #333 !important; /* Ensure text color is visible */
  padding-left: 0 !important; /* Remove default padding */
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
  height: auto !important; /* Adjust arrow height */
}

/* ==== intl-tel-input Customization (for separateDialCode) ==== */
.iti.iti--separate-dial-code {
  width: 100%;
}

/* Style the input field itself */
.iti.iti--separate-dial-code .form-control {
  height: 45px;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding-left: 95px; /* Make space for the dial code */
  font-size: 1.1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
}

/* Focus state for the input */
.iti.iti--separate-dial-code .form-control:focus {
  border-color: #0444ec;
  box-shadow: 0 0 0 3px rgba(4, 68, 236, 0.2);
  outline: none;
}

/* Style the selected flag and dial code container */
.iti.iti--separate-dial-code .iti__selected-dial-code {
  color: #333;
  font-weight: 600;
}

.iti.iti--separate-dial-code .iti__flag-container {
  position: absolute;
  height: 45px;
  top: 0;
  bottom: 0;
  left: 0;
}

/* Dropdown list styles */
.iti__country-list {
  border-radius: 6px;
  border-color: #ccc;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 9999; /* Ensure dropdown is on top */
}

.iti__country.iti__highlight {
  background-color: #e8f0fe;
}

.iti__dial-code {
  color: #777;
}
