/**
 * Styles spécifiques pour le widget de formulaire de contact
 */

/* Conteneur du formulaire */
.contact-form-container {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-bottom: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Titre du formulaire */
.contact-form-title {
    font-size: 28px;
    font-weight: 700;
    color: #333333;
    margin-top: 0;
    margin-bottom: 24px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.contact-form-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 80px;
    height: 2px;
    background-color: #dc2626;
}

/* Structure du formulaire */
.contact-form {
    position: relative;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 767px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

.form-group {
    margin-bottom: 20px;
    position: relative;
    flex: 1;
}

/* Labels */
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333333;
}

.required-field {
    color: #dc2626;
    margin-left: 3px;
}

/* Champs de formulaire */
.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    line-height: 1.5;
    color: #333333;
    background-color: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
    outline: none;
}

/* Styles spécifiques pour select */
select.form-control {
    padding-right: 30px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Styles pour intlTelInput */
.iti {
    width: 100%;
}

.iti__flag {
    background-image: url("https://cdn.jsdelivr.net/npm/intl-tel-input@25.3.1/build/img/flags.png");
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .iti__flag {
        background-image: url("https://cdn.jsdelivr.net/npm/intl-tel-input@25.3.1/build/img/flags@2x.png");
    }
}

.iti--allow-dropdown .form-control {
    padding-left: 52px;
}

.iti--separate-dial-code .iti__selected-dial-code {
    padding-left: 6px;
}

.iti__country-list {
    max-height: 180px;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px solid #eaeaea;
    margin-top: 5px;
}

.iti__country {
    transition: background-color 0.2s ease;
    padding: 8px 10px;
}

.iti__country:hover {
    background-color: #f9f9f9;
}

.intl-tel-error {
    color: #dc2626;
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.intl-tel-error.visible {
    display: block;
    padding: 5px 12px;
    background-color: rgba(220, 38, 38, 0.08);
    border-radius: 6px;
    animation: error-appear 0.3s ease-out forwards;
}

/* Zone de téléchargement de fichiers */
.file-upload-zone {
    width: 100%;
    padding: 25px 20px;
    border: 2px dashed #dddddd;
    border-radius: 8px;
    background-color: #f9fafb;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
    border-color: #dc2626;
    background-color: rgba(220, 38, 38, 0.05);
}

.file-upload-zone.max-files-reached {
    opacity: 0.7;
    cursor: not-allowed;
}

.file-upload-icon {
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" fill="none" stroke="%23dc2626" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.3s ease;
}

.file-upload-zone:hover .file-upload-icon {
    transform: translateY(-5px);
}

.file-upload-text {
    font-size: 16px;
    color: #444;
    margin-bottom: 5px;
    font-weight: 500;
}

.file-upload-info {
    font-size: 13px;
    color: #888;
    display: block;
    margin-top: 5px;
}

.file-upload-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.file-count-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Liste des fichiers téléchargés */
.uploaded-files {
    margin-top: 16px;
}

.uploaded-file {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    animation: file-appear 0.4s ease-out forwards;
    transition: all 0.3s ease;
}

.uploaded-file.removing {
    opacity: 0;
    transform: translateX(20px);
}

.uploaded-file-name {
    flex: 1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    color: #444;
}

.remove-file {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    color: #dc2626;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 10px;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    position: relative;
}

.remove-file:hover {
    background-color: #fee2e2;
    transform: scale(1.1) rotate(90deg);
}

.remove-file::before {
    content: "×";
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Checkbox de confidentialité */
.privacy-checkbox {
    display: flex;
    align-items: flex-start;
    margin-top: 24px;
    margin-bottom: 16px;
    background: #f9fafb;
    padding: 12px 16px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.privacy-checkbox:hover {
    background: #f3f4f6;
}

.privacy-checkbox input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #ddd;
    transition: all 0.3s;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    cursor: pointer;
}

.privacy-checkbox input[type="checkbox"]:checked {
    background-color: #dc2626;
    border-color: #dc2626;
}

.privacy-checkbox input[type="checkbox"]:checked::before {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.privacy-checkbox label {
    font-size: 14px;
    color: #555;
    margin-bottom: 0;
    font-weight: 500;
    line-height: 1.5;
}

.privacy-checkbox a {
    color: #dc2626;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 600;
}

.privacy-checkbox a:hover {
    text-decoration: underline;
    color: #b91c1c;
}

/* Note pour les champs obligatoires */
.required-fields-notice {
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
}

/* Bouton d'envoi */
.submit-button-container {
    position: relative;
}

.submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: #dc2626;
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
    padding: 14px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.2);
}

.submit-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.7s ease;
}

.submit-button:hover {
    background-color: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(185, 28, 28, 0.25);
}

.submit-button:hover::before {
    left: 100%;
}

.submit-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(185, 28, 28, 0.2);
}

/* Indicateur de chargement */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

/* Messages d'erreur */
.form-error {
    color: #dc2626;
    font-size: 13px;
    margin-top: 6px;
    padding: 8px 12px;
    background-color: rgba(220, 38, 38, 0.08);
    border-radius: 6px;
    display: flex;
    align-items: center;
    animation: error-appear 0.4s ease-out forwards;
    border-left: 3px solid #dc2626;
}

.form-error::before {
    content: "⚠️";
    margin-right: 8px;
    font-size: 14px;
}

.form-message {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    display: none;
}

.form-message.error {
    display: block;
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.form-message.success {
    display: block;
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Message de succès */
.contact-success {
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.5s ease;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    animation: success-icon-appear 0.5s ease-out forwards;
    display: inline-block;
}

.success-icon svg {
    width: 100%;
    height: 100%;
}

.success-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #333;
    animation: success-text-appear 0.5s ease-out 0.2s forwards;
    opacity: 0;
}

.success-message {
    font-size: 16px;
    color: #555;
    margin-bottom: 0;
    animation: success-text-appear 0.5s ease-out 0.4s forwards;
    opacity: 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes success-icon-appear {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes success-text-appear {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes file-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes error-appear {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Media Queries */
@media (max-width: 768px) {
    .contact-form-container {
        padding: 20px;
    }
    
    .contact-form-title {
        font-size: 24px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-control {
        padding: 10px 12px;
    }
    
    .submit-button {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .file-upload-zone {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .contact-form-container {
        padding: 15px;
    }
    
    .contact-form-title {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .file-upload-text {
        font-size: 14px;
    }
    
    .file-upload-info {
        font-size: 12px;
    }
    
    .privacy-checkbox {
        padding: 10px 12px;
    }
    
    .privacy-checkbox label {
        font-size: 13px;
    }
}