/* Contact Form Multi-step Styles */

/* Mode Bloc (dans la page) */
.wp-block-contact-form:not(.popup-mode) {
    position: relative;
    max-width: 700px;
    margin: 40px auto;
    display: flex;
    justify-content: center;
}

.wp-block-contact-form:not(.popup-mode) .contact-form-container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    padding: 50px;
    position: relative;
    min-height: 450px;
    border: 1px solid #f0f0f0;
    width: 100%;
    text-align: left;
}

/* Conteneur général pour les deux modes */
.contact-form-container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    position: relative;
    min-height: 400px;
}

/* Indicateur d'étapes */
.form-steps-indicator {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.step-dot.active {
    background: #cdad7d;
    transform: scale(1.3);
}

.step-dot.completed {
    background: #a8936a;
}

/* Bouton fermer pour popup */
.form-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    color: #999;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.form-close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

/* Styles du formulaire */
.multi-step-form {
    position: relative;
}

.form-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.form-step.active {
    display: block !important;
}

/* Forcer l'affichage de la première étape par défaut */
.form-step[data-step="1"] {
    display: block;
}

.form-step[data-step="1"]:not(.active) {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Titres */
.form-step h2 {
    font-family: 'Ivy Mode', serif;
    font-size: 30px;
    font-weight: 600;
    text-align: left;
    margin-bottom: 30px;
    color: black;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Première étape - Bienvenue - Toujours centrée */
.form-step[data-step="1"] {
    text-align: center;
}

.form-step[data-step="1"] h2 {
    text-align: center;
    margin-bottom: 35px;
}

/* Autres étapes en mode bloc - alignées à gauche */
.wp-block-contact-form:not(.popup-mode) .form-step:not([data-step="1"]) {
    text-align: left;
}

.wp-block-contact-form:not(.popup-mode) .form-step:not([data-step="1"]) h2 {
    text-align: left;
}

/* Textes de bienvenue */
.welcome-text {
    font-family: 'Lato', sans-serif;
    font-size: 20px;
    line-height: 1.8;
    color: black;
    text-align: center;
    margin-bottom: 25px;
}

.welcome-subtext {
    font-family: 'Lato', sans-serif;
    font-size: 20px;
    line-height: 1.8;
    color: black;
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #ddd;
}

/* Groupes de formulaire */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-family: 'Lato', sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: black;
    margin-bottom: 15px;
    letter-spacing: 0;
}

/* Champs de formulaire */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    width: 85%;
    padding: 14px 18px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: 'Lato', sans-serif;
    font-size: 18px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #cdad7d;
    background: #fff;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* Select custom */
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 45px;
    cursor: pointer;
}

/* Checkboxes et Radio buttons */
.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.checkbox-label:hover,
.radio-label:hover {
    opacity: 0.8;
}

.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    margin-right: 12px;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"] {
    border-radius: 50%;
}

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

.radio-label input[type="radio"]:checked {
    background-color: #cdad7d;
    border-color: #cdad7d;
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.radio-label input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.checkbox-label span,
.radio-label span {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    color: black;
    line-height: 1.4;
}

/* Navigation du formulaire */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
}

.form-navigation button {
    padding: 12px 35px;
    border: none;
    border-radius: 30px;
    font-family: 'Ivy Mode', serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-next,
.btn-submit {
    background: #cdad7d;
    color: white;
    margin-left: auto;
}

.btn-next:hover,
.btn-submit:hover {
    background: #b89968;
    transform: translateY(-1px);
}

.btn-prev {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    margin-right: auto;
    position: relative;
    padding-left: 45px;
}

.btn-prev::before {
    content: '<';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    margin-right: 8px;
}

.btn-prev:hover {
    border-color: #cdad7d;
    color: #cdad7d;
}

/* Bouton seul de la première étape - aligné à droite */
.form-step[data-step="1"] .btn-next {
    display: block;
    margin: 30px 0 0 auto;
    padding: 12px 35px;
    border: none;
    border-radius: 30px;
    font-family: 'Ivy Mode', serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    background: #cdad7d;
    color: white;
    width: fit-content;
}

.form-step[data-step="1"] .btn-next:hover {
    background: #b89968;
    transform: translateY(-1px);
}

/* Écran de confirmation */
.form-confirmation {
    display: none;
    text-align: center;
    padding: 60px 40px;
    min-height: 400px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.form-confirmation.active {
    display: flex;
    animation: fadeIn 0.5s ease;
}

.confirmation-icon {
    width: 80px;
    height: 80px;
    background: #cdad7d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 40px;
    font-weight: bold;
    margin: 0 auto 30px;
}

.form-confirmation h2 {
    font-family: 'Ivy Mode', serif;
    font-size: 36px;
    font-weight: 600;
    color: black;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.form-confirmation p {
    font-family: 'Lato', sans-serif;
    font-size: 18px;
    color: black;
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 400px;
}

.btn-close-form {
    padding: 14px 40px;
    background: #cdad7d;
    color: white;
    border: none;
    border-radius: 30px;
    font-family: 'Ivy Mode', serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close-form:hover {
    background: #b89968;
    transform: translateY(-1px);
}

/* Messages */
.form-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    display: none;
    text-align: center;
    font-size: 15px;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Mode Popup */
.wp-block-contact-form.popup-mode,
.wp-block-contact-form.global-popup-form {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    margin: 0;
    max-width: none;
}

.wp-block-contact-form.popup-mode.show,
.wp-block-contact-form.global-popup-form.show {
    display: flex;
    animation: fadeInPopup 0.3s ease;
}

@keyframes fadeInPopup {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.popup-mode .contact-form-container,
.global-popup-form .contact-form-container {
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideInPopup 0.3s ease;
    position: relative;
    z-index: 10000000;
    margin: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 40px;
    min-height: 400px;
}

@keyframes slideInPopup {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .contact-form-container {
        padding: 30px 20px;
    }
    
    .form-step h2 {
        font-size: 20px;
    }
    
    .form-navigation {
        display: flex;
        justify-content: space-between;
        gap: 10px;
    }
    
    .form-navigation button {
        width: auto;
        padding: 10px 25px;
        font-size: 14px;
    }
    
    .btn-prev {
        margin-right: 0;
    }
    
    .btn-next,
    .btn-submit {
        margin-left: 0;
    }
    
    .popup-mode .contact-form-container {
        max-height: 100vh;
        border-radius: 0;
    }
}

/* Styles pour l'éditeur Gutenberg */
.contact-form-editor-preview {
    margin: 20px 0;
}

.contact-form-editor-preview h3 {
    margin-bottom: 15px;
}

.contact-form-editor-preview ol {
    margin-left: 20px;
}

.padel-options-list {
    margin: 15px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 5px;
}

.padel-options-list label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

/* Loading state */
.form-step.loading {
    pointer-events: none;
    opacity: 0.6;
}

.btn-submit.loading {
    position: relative;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-top-color: #2C3E2C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}