/**
 * Contact Form 1 Section
 *
 * @package Dioqa_UI_Kit
 */

/* Section Container */
.contact-form-1-section {
  position: relative;
}

/* Force le background sur tous les inputs du formulaire de contact */
.contact-form-1-section input[type='text'],
.contact-form-1-section input[type='email'],
.contact-form-1-section input[type='tel'],
.contact-form-1-section textarea {
  background: #eceff2 !important;
  border: none !important;
}

.contact-form-1-section input[type='text']:focus,
.contact-form-1-section input[type='email']:focus,
.contact-form-1-section input[type='tel']:focus,
.contact-form-1-section textarea:focus {
  background: #eceff2 !important;
  border: none !important;
}

.contact-form-1-section .section-title {
  color: var(--bs-gray-dark);
  font-family: var(--font-heading);
  font-size: var(--display-xs);
  font-weight: 700;
  line-height: 1.2;
}

.contact-form-1-section .section-description {
  color: var(--bs-gray-medium);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 400;
  line-height: 1.6;
}

/* Form Wrapper */
.form-wrapper {
  background: var(--form-bg-color, var(--bs-white));
  border-radius: var(--radius-xxl);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

/* Contact Info Card */
.contact-info-card {
  background: transparent;
  border-radius: var(--radius-xl);
  padding: var(--spacing-md);
  height: 100%;
}

.contact-info-card .section-title {
  text-align: left;
  color: var(--bs-white);
  font-family: var(--font-heading);
  font-size: var(--display-md);
  font-weight: 600;
  line-height: normal;
}

.contact-info-card .section-description {
  text-align: left;
  color: var(--bs-white);
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: normal;
}

.contact-info-title {
  color: var(--bs-gray-dark);
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* Blocs de localisation (mode multi-sites) */
.contact-location-block {
  margin-bottom: 2.5rem;
  padding-bottom: 0;
  border-bottom: none;
}

.contact-location-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.contact-location-block .contact-info-title {
  margin-bottom: 1rem;
  font-size: var(--text-lg);
  color: var(--bs-primary);
}

/* Si pas de titre dans le bloc, ajuster l'espacement du premier item */
.contact-location-block > .contact-info-item:first-child {
  margin-top: 0;
}

.contact-info-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  align-items: flex-start;
}

.contact-info-item:last-child {
  margin-bottom: 0;
}

.contact-info-item i {
  color: var(--bs-primary);
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.contact-info-item strong {
  display: none;
}

.contact-info-item p {
  color: var(--bs-gray-medium);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  margin: 0;
}

.contact-info-item a {
  color: var(--bs-gray-medium);
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-info-item a:hover {
  color: var(--bs-primary);
}

/* Gravity Forms Styling */
.gform_wrapper,
#gform_1,
.form-wrapper form {
  margin: 0 !important;
}

.gform_wrapper form,
.form-wrapper form {
  margin: 0;
}

.gform_wrapper .gform_body,
.gform-body,
.form-wrapper .gform-body {
  width: 100%;
}

.gform_wrapper .gform_fields,
.gform_fields,
.form-wrapper .gform_fields {
  padding: 0;
  margin: 0;
  list-style: none;
  display: grid;
  gap: 1.25rem;
}

/* Réduire le row-gap de Gravity Forms Foundation theme */
.gform-theme--foundation .gform_fields {
  grid-row-gap: 1.25rem !important;
  row-gap: 1.25rem !important;
}

/* Layout 2 colonnes pour Gravity Forms */
.gform_wrapper .gfield.gf_left_half,
.gform_wrapper .gfield.gf_right_half {
  display: inline-block;
  vertical-align: top;
}

.gform_wrapper .gfield.gf_left_half {
  width: calc(50% - 0.625rem);
  margin-right: 1.25rem !important;
}

.gform_wrapper .gfield.gf_right_half {
  width: calc(50% - 0.625rem);
}

/* Clear le float après les colonnes */
.gform_wrapper .gfield.gf_right_half + .gfield {
  clear: both;
}

.gform_wrapper .gfield,
.gfield,
.form-wrapper .gfield {
  margin: 0 !important;
  padding: 0 !important;
}

.gform_wrapper .gfield_label,
.gfield_label,
.gform-field-label,
legend.gfield_label,
.form-wrapper .gfield_label,
.form-wrapper legend.gfield_label {
  color: var(--bs-gray-dark);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: inline-block;
  width: 100%;
}

.gform_wrapper .gfield_required,
.gfield_required,
.form-wrapper .gfield_required,
span.gfield_required,
legend span.gfield_required,
.gfield_label span.gfield_required {
  color: var(--bs-primary) !important;
  margin-left: 0.25rem !important;
  display: inline !important;
  vertical-align: baseline !important;
}

.gfield_required_text,
span.gfield_required_text,
.gfield_required .gfield_required_text {
  display: inline !important;
  color: var(--bs-primary) !important;
  vertical-align: baseline !important;
}

.gform_wrapper input[type='text'],
.gform_wrapper input[type='email'],
.gform_wrapper input[type='tel'],
.gform_wrapper input[type='url'],
.gform_wrapper input[type='number'],
.gform_wrapper textarea,
.gform_wrapper select,
.form-wrapper input[type='text'],
.form-wrapper input[type='email'],
.form-wrapper input[type='tel'],
.form-wrapper input[type='url'],
.form-wrapper input[type='number'],
.form-wrapper textarea,
.form-wrapper select,
.ginput_container input[type='text'],
.ginput_container input[type='email'],
.ginput_container input[type='tel'],
.ginput_container textarea {
  width: 100% !important;
  padding: 1rem 1.25rem !important;
  border: none !important;
  border-radius: var(--input-border-radius, 8px) !important;
  font-family: var(--font-body) !important;
  font-size: var(--text-sm) !important;
  color: var(--bs-gray-dark) !important;
  transition: var(--transition-base) !important;
  background: #eceff2 !important;
}

.gform_wrapper input[type='text']:focus,
.gform_wrapper input[type='email']:focus,
.gform_wrapper input[type='tel']:focus,
.gform_wrapper textarea:focus,
.gform_wrapper select:focus,
.form-wrapper input[type='text']:focus,
.form-wrapper input[type='email']:focus,
.form-wrapper input[type='tel']:focus,
.form-wrapper textarea:focus,
.form-wrapper select:focus,
.ginput_container input[type='text']:focus,
.ginput_container input[type='email']:focus,
.ginput_container input[type='tel']:focus,
.ginput_container textarea:focus {
  outline: none !important;
  border: none !important;
  background: #eceff2 !important;
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1) !important;
}

.gform_wrapper textarea,
.form-wrapper textarea,
.ginput_container_textarea textarea {
  min-height: 120px !important;
  height: 120px !important;
  resize: vertical;
}

/* Sous-labels (Prénom, Nom, etc.) */
.gform-field-label--type-sub,
label.gform-field-label--type-sub {
  font-size: var(--text-xs) !important;
  color: var(--bs-gray-medium) !important;
  font-weight: 500 !important;
  margin-bottom: 0.25rem !important;
  font-family: var(--font-body) !important;
}

/* Fieldsets - Reset styles navigateur */
fieldset.gfield {
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  min-width: 0 !important;
}

legend.gfield_label {
  padding: 0 !important;
  margin-bottom: 0.75rem !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Conteneurs complexes (nom, email) */
.ginput_complex,
.ginput_container_email {
  display: flex !important;
  gap: 1rem !important;
  width: 100% !important;
}

.ginput_left,
.ginput_right,
.name_first,
.name_last {
  flex: 1 !important;
  min-width: 0 !important;
}

/* Placeholders */
.gform_wrapper input::placeholder,
.gform_wrapper textarea::placeholder,
.form-wrapper input::placeholder,
.form-wrapper textarea::placeholder,
.ginput_container input::placeholder,
.ginput_container textarea::placeholder {
  color: var(--bs-gray-medium) !important;
  opacity: 0.7 !important;
}

/* Description du champ */
.gfield_description {
  font-size: var(--text-xs) !important;
  color: var(--bs-gray-medium) !important;
  margin-bottom: 0.5rem !important;
  font-family: var(--font-body) !important;
  line-height: 1.4 !important;
}

/* Compteur de caractères */
.charleft.ginput_counter {
  font-size: var(--text-xs) !important;
  color: var(--bs-gray-medium) !important;
  margin-top: 0.25rem !important;
  font-family: var(--font-body) !important;
}

/* Validation Errors */
.gform_wrapper .gfield_error,
.gfield_error {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.gform_wrapper .gfield_error input,
.gform_wrapper .gfield_error textarea,
.gform_wrapper .gfield_error select,
.gfield_error input,
.gfield_error textarea,
.gfield_error select {
  border: 2px solid #dc3545 !important;
  background: #fff5f5 !important;
}

.gform_wrapper .validation_message,
.validation_message {
  color: #dc3545 !important;
  font-size: var(--text-xs) !important;
  margin-top: 0.5rem !important;
  display: block !important;
  font-family: var(--font-body) !important;
}

/* Submit Button */
.gform_wrapper .gform_footer,
.gform-footer,
.form-wrapper .gform-footer,
.form-wrapper .gform_footer {
  margin: 1.5rem 0 0 0 !important;
  padding: 0 !important;
}

.gform_wrapper .gform_button,
.gform_wrapper input[type='submit'],
.gform-footer input[type='submit'],
.gform-footer .gform_button,
.form-wrapper input[type='submit'],
.form-wrapper .gform_button,
input.gform_button {
  background: var(--bs-primary) !important;
  color: var(--bs-white) !important;
  border: none !important;
  padding: 1rem 2rem !important;
  border-radius: var(--radius-full) !important;
  font-family: var(--font-heading) !important;
  font-size: var(--text-md) !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: var(--transition-base) !important;
  display: block !important;
  width: 100% !important;
}

.gform_wrapper .gform_button:hover,
.gform_wrapper input[type='submit']:hover,
.gform-footer input[type='submit']:hover,
.gform-footer .gform_button:hover,
.form-wrapper input[type='submit']:hover,
.form-wrapper .gform_button:hover,
input.gform_button:hover {
  background: var(--bs-primary-dark, var(--bs-primary)) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.3) !important;
}

/* Button Width Options */
.gform_wrapper.button-width-auto .gform_button,
.gform_wrapper.button-width-auto input[type='submit'],
#gform_wrapper_1.button-width-auto .gform_button,
#gform_wrapper_1.button-width-auto input[type='submit'] {
  width: auto !important;
  display: inline-block !important;
}

/* Button Alignment Options */
.gform_wrapper.button-align-left .gform_footer,
#gform_wrapper_1.button-align-left .gform_footer,
#gform_wrapper_1.button-align-left .gform-footer {
  display: flex !important;
  justify-content: flex-start !important;
}

.gform_wrapper.button-align-center .gform_footer,
#gform_wrapper_1.button-align-center .gform_footer,
#gform_wrapper_1.button-align-center .gform-footer {
  display: flex !important;
  justify-content: center !important;
}

.gform_wrapper.button-align-right .gform_footer,
#gform_wrapper_1.button-align-right .gform_footer,
#gform_wrapper_1.button-align-right .gform-footer {
  display: flex !important;
  justify-content: flex-end !important;
}

/* Button Style Variants */
.gform_wrapper.button-style-secondary .gform_button,
.gform_wrapper.button-style-secondary input[type='submit'],
#gform_wrapper_1.button-style-secondary .gform_button,
#gform_wrapper_1.button-style-secondary input[type='submit'] {
  background: var(--bs-secondary) !important;
  color: var(--bs-white) !important;
}

.gform_wrapper.button-style-secondary .gform_button:hover,
.gform_wrapper.button-style-secondary input[type='submit']:hover,
#gform_wrapper_1.button-style-secondary .gform_button:hover,
#gform_wrapper_1.button-style-secondary input[type='submit']:hover {
  background: var(--bs-secondary) !important;
  opacity: 0.9 !important;
}

.gform_wrapper.button-style-gradient .gform_button,
.gform_wrapper.button-style-gradient input[type='submit'],
#gform_wrapper_1.button-style-gradient .gform_button,
#gform_wrapper_1.button-style-gradient input[type='submit'] {
  background: linear-gradient(
    135deg,
    var(--bs-primary) 0%,
    var(--bs-secondary) 100%
  ) !important;
}

.gform_wrapper.button-style-outline-primary .gform_button,
.gform_wrapper.button-style-outline-primary input[type='submit'],
#gform_wrapper_1.button-style-outline-primary .gform_button,
#gform_wrapper_1.button-style-outline-primary input[type='submit'] {
  background: transparent !important;
  border: 2px solid var(--bs-primary) !important;
  color: var(--bs-primary) !important;
}

.gform_wrapper.button-style-outline-primary .gform_button:hover,
.gform_wrapper.button-style-outline-primary input[type='submit']:hover,
#gform_wrapper_1.button-style-outline-primary .gform_button:hover,
#gform_wrapper_1.button-style-outline-primary input[type='submit']:hover {
  background: var(--bs-primary) !important;
  color: var(--bs-white) !important;
}

.gform_wrapper.button-style-outline-secondary .gform_button,
.gform_wrapper.button-style-outline-secondary input[type='submit'],
#gform_wrapper_1.button-style-outline-secondary .gform_button,
#gform_wrapper_1.button-style-outline-secondary input[type='submit'] {
  background: transparent !important;
  border: 2px solid var(--bs-secondary) !important;
  color: var(--bs-secondary) !important;
}

.gform_wrapper.button-style-outline-secondary .gform_button:hover,
.gform_wrapper.button-style-outline-secondary input[type='submit']:hover,
#gform_wrapper_1.button-style-outline-secondary .gform_button:hover,
#gform_wrapper_1.button-style-outline-secondary input[type='submit']:hover {
  background: var(--bs-secondary) !important;
  color: var(--bs-white) !important;
}

/* Confirmation Message */
.gform_confirmation_wrapper {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  color: #155724;
  font-family: var(--font-body);
  font-size: var(--text-md);
  text-align: center;
}

.contact-form-1-section.text-white .section-title,
.contact-form-1-section.text-white .contact-info-title,
.contact-form-1-section.text-white .contact-info-item strong {
  color: var(--bs-white);
}

.contact-form-1-section.text-white .section-description,
.contact-form-1-section.text-white .contact-info-item p {
  color: rgba(255, 255, 255, 0.9);
}

/* Les labels dans le form-wrapper restent toujours dark-grey */
.form-wrapper .gfield_label,
.form-wrapper legend.gfield_label {
  color: var(--bs-gray-dark) !important;
}

/* Responsive */
@media (max-width: 768px) {
  .form-wrapper,
  .contact-info-card {
    padding: 1.5rem;
  }

  .contact-form-1-section .section-title {
    font-size: var(--display-2xs);
  }

  .contact-form-1-section .section-description {
    font-size: var(--text-sm);
  }

  /* Layout 2 colonnes passe en 1 colonne sur mobile */
  .gform_wrapper .gfield.gf_left_half,
  .gform_wrapper .gfield.gf_right_half {
    width: 100% !important;
    margin-right: 0 !important;
    display: block;
  }
}
