/**
 * Formulaires Popup - Styles Frontend Professionnels
 */

/* Bouton déclencheur */
.fp-button {
    display: inline-block;
    padding: 10px 20px;
    background: #2c3e50;
    color: #ffffff;
    border: 1px solid #2c3e50;
    border-radius: 30px!important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.fp-button:hover {
    background: #34495e;
    border-color: #34495e;
    color: #ffffff;
}

.fp-button:active {
    background: #1a252f;
}

/* Overlay du popup */
#fp-popup-overlay,
.fp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* État actif du popup */
#fp-popup-overlay.active,
.fp-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Empêcher le scroll quand popup ouvert */
body.fp-popup-open {
    overflow: hidden;
}

/* Popup principal */
.fp-popup {
    background: #ffffff;
    border-radius: 3px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Bouton fermer */
.fp-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    z-index: 10;
    padding: 0;
}

.fp-popup-close:hover {
    opacity: 0.7;
}

.fp-popup-close span {
    font-size: 28px;
    color: #666666;
    line-height: 1;
    font-family: Arial, sans-serif;
    font-weight: 300;
}

/* Contenu du popup */
.fp-popup-content {
    padding: 0;
}

.fp-popup-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e5e5e5;
    background: #f8f9fa;
}

.fp-popup-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.4;
}

.fp-popup-body {
    padding: 30px;
    min-height: 150px;
    position: relative;
}

/* Loading */
.fp-loading {
    text-align: center;
    padding: 40px;
}

.fp-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e5e5;
    border-top-color: #2c3e50;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: fp-spin 0.8s linear infinite;
}

.fp-loading p {
    color: #666666;
    font-size: 14px;
    margin: 0;
}

/* Container du formulaire */
.fp-form-container {
    display: none;
}

.fp-form-container.loaded {
    display: block;
}

/* Message d'erreur */
.fp-error-message {
    text-align: center;
    padding: 30px;
}

.fp-error-icon {
    font-size: 32px;
    color: #c0392b;
    margin-bottom: 15px;
}

.fp-error-message p {
    color: #c0392b;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.fp-error-retry {
    background: #2c3e50;
    color: #ffffff;
    border: none;
    padding: 8px 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.fp-error-retry:hover {
    background: #34495e;
}

/* Styles pour GravityForms dans le popup */
.fp-popup .gform_wrapper {
    margin: 0;
}

.fp-popup .gform_wrapper .gform_body {
    padding: 0;
}

.fp-popup .gform_wrapper .gfield {
    margin-bottom: 0px!important;
}

.fp-popup .gform_wrapper .gfield_label {
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

.fp-popup .gform_wrapper .gfield_required {
    color: #c0392b;
    margin-left: 3px;
}

.fp-popup .gform_wrapper input[type="text"],
.fp-popup .gform_wrapper input[type="email"],
.fp-popup .gform_wrapper input[type="tel"],
.fp-popup .gform_wrapper input[type="number"],
.fp-popup .gform_wrapper input[type="url"],
.fp-popup .gform_wrapper textarea,
.fp-popup .gform_wrapper select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    background: #ffffff;
}

.fp-popup .gform_wrapper input:focus,
.fp-popup .gform_wrapper textarea:focus,
.fp-popup .gform_wrapper select:focus {
    outline: none;
    border-color: #2c3e50;
}

.fp-popup .gform_wrapper textarea {
    min-height: 100px;
    resize: vertical;
}

.fp-popup .gform_wrapper .gform_footer {
    padding: 0;
    margin: 25px 0 0 0;
}

.fp-popup .gform_wrapper .gform_button,
.fp-popup .gform_wrapper input[type="submit"] {
    background: #2c3e50;
    color: #ffffff;
    border: none;
    padding: 10px 30px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    width: 100%;
}

.fp-popup .gform_wrapper .gform_button:hover,
.fp-popup .gform_wrapper input[type="submit"]:hover {
    background: #34495e;
}

/* Messages de confirmation/erreur */
.fp-popup .gform_confirmation_message {
    background: transparent;
    color: #ffffff;
    padding: 15px;
    border-radius: 3px;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
}

.fp-popup .validation_error {
    background: #fef5f5;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 3px;
    margin-bottom: 20px;
    font-size: 14px;
}

.fp-popup .gfield_error {
    background-color: transparent;
}

.fp-popup .gfield_error input,
.fp-popup .gfield_error textarea,
.fp-popup .gfield_error select {
    border-color: #c0392b;
}

.fp-popup .validation_message {
    color: #c0392b;
    font-size: 12px;
    margin-top: 5px;
}



body .gform_wrapper .top_label .gfield_label {
    margin-top: 0px!important;
    margin-bottom: 6px;
    font-family: 'Open Sans';
    font-weight: 700;
}

.gsection_title {
    margin-bottom: 2px !important;
}

/* Animation */
@keyframes fp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .fp-popup {
        width: 95%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .fp-popup-header {
        padding: 20px;
    }
    
    .fp-popup-header h2 {
        font-size: 18px;
    }
    
    .fp-popup-body {
        padding: 20px;
    }
    
    .fp-button {
        font-size: 14px;
        padding: 8px 16px;
    }
}

/* Compatibilité avec différents thèmes */
.fp-popup *,
.fp-popup *::before,
.fp-popup *::after {
    box-sizing: border-box;
}

/* S'assurer que le popup est au-dessus de tout */
.fp-popup-overlay {
    z-index: 999998;
}