/* ===== STYLES POUR LE FORMULAIRE DE CONTACT IFB ===== */

/* Container principal du formulaire */
#ifb-contact-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Formulaire principal */
.ifb-contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Lignes du formulaire (2 colonnes) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Champs du formulaire */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field.full-width {
    grid-column: 1 / -1;
}

/* Labels */
.form-field label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 5px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Champs de saisie */
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Placeholders */
.form-field input::placeholder,
.form-field textarea::placeholder {
    color: #999;
    font-style: italic;
}

/* Textarea */
.form-field textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* Select dropdown */
.form-field select {
    cursor: pointer;
    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;
    appearance: none;
}

/* Section de confidentialité */
.privacy-section {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.privacy-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
}

.privacy-checkbox input[type="checkbox"] {
    width: 18px !important;
    height: 18px;
    margin: 0;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.privacy-checkbox input[type="checkbox"]:checked {
    background-color: #ff6b35;
    border-color: #ff6b35;
}

.privacy-checkbox label {
    font-size: 14px;
    line-height: 1.4;
    color: #2c3e50;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.privacy-link {
    color: #ff6b35;
    text-decoration: none;
    font-weight: 600;
}

.privacy-link:hover {
    text-decoration: underline;
}

.privacy-info {
    font-size: 12px;
    line-height: 1.4;
    color: #666;
    margin-top: 10px;
    text-align: justify;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Actions du formulaire */
.form-actions {
  margin-top: 30px;
  text-align: center;
}

.buttons-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  /* align-items: baseline; */
  flex-wrap: nowrap;
}

.btn-submit {
  background-color: #ff6b35;
  color: white;
  border: none;
  padding: 15px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* flex: 1; */
  max-width: 280px;
  min-width: 200px;
  /* height: 56px; */
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-submit:hover {
  background-color: #e55a2b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

.btn-submit:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-rdv {
  background-color: #007cba;
  color: white;
  border: none;
  padding: 15px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  flex: 1;
  max-width: 280px;
  min-width: 200px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-rdv:hover {
  background-color: #005a87;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.btn-rdv:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 124, 186, 0.3);
}

.btn-rdv:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Message de succès */
.success-message {
    text-align: center;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #28a745;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.success-message h3 {
    color: #28a745;
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.success-message p {
    color: #666;
    font-size: 16px;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* États de validation */
.form-field.error input,
.form-field.error select,
.form-field.error textarea {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-field.success input,
.form-field.success select,
.form-field.success textarea {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.success-message-field {
    color: #28a745;
    font-size: 12px;
    margin-top: 5px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Responsive Design */
@media (max-width: 768px) {
    #ifb-contact-form-container {
        margin: 10px;
        padding: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-field.full-width {
        grid-column: 1;
    }
    
    .form-field input,
    .form-field select,
    .form-field textarea {
        padding: 12px;
        font-size: 16px; /* Évite le zoom sur iOS */
    }
    
    .buttons-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-submit,
    .btn-rdv {
        width: 100%;
        padding: 18px;
        font-size: 16px;
        max-width: none;
    }
    
    .privacy-section {
        padding: 15px;
    }
    
    .privacy-checkbox {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .privacy-checkbox input[type="checkbox"] {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    #ifb-contact-form-container {
        margin: 5px;
        padding: 10px;
    }
    
    .form-field input,
    .form-field select,
    .form-field textarea {
        padding: 10px;
    }
    
    .btn-submit,
    .btn-rdv {
        padding: 18px;
        font-size: 14px;
    }
    
    .success-message {
        padding: 30px 15px;
    }
    
    .success-icon {
        font-size: 36px;
    }
    
    .success-message h3 {
        font-size: 20px;
    }
}

/* Animation pour les messages */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message {
    animation: fadeIn 0.5s ease-out;
}

/* Focus visible pour l'accessibilité */
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.btn-submit:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

/* Styles pour les liens de politique de confidentialité */
.privacy-link:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Amélioration de l'accessibilité pour les checkboxes */
.privacy-checkbox input[type="checkbox"]:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

/* Style pour les champs requis */
.form-field label::after {
    content: ' *';
    color: #dc3545;
    font-weight: bold;
}

.form-field label[for="societe"]::after,
.form-field label[for="activite"]::after,
.form-field label[for="message"]::after {
    content: '';
}

/* Style pour les champs optionnels */
.form-field input[placeholder],
.form-field textarea[placeholder] {
    font-style: italic;
    color: #999;
}

/* Amélioration de l'apparence des options du select */
.form-field select option {
    padding: 10px;
    background-color: #fff;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.form-field select option:hover {
    background-color: #f8f9fa;
}
