/**
 * Style du Bloc Contact - Frontend
 * Basé sur le design Figma
 */

.wp-block-mediapilote-contact.contact-section {
    padding: 80px 0;
    width: 100%;
}

.contact-section__wrapper {
    display: flex;
    gap: 60px;
    align-items: flex-start;
    max-width: 1600px;
    margin: 0 auto;
    /* padding: 0 40px; */
}

/* Colonne gauche - Image et contenu */
.contact-section__left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.contact-section__image {
    position: relative;
    width: 100%;
    max-width: 812px;
    overflow: hidden;
}

.contact-section__image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 0;
}

.contact-section__content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-section__subtitle {
    font-size: 28px;
    line-height: 37px;
    margin: 0;
    font-weight: 400;
}

.contact-section__description {
    font-size: 20px;
    line-height: 28px;
    color: currentColor;
}

.contact-section__description p {
    margin: 0 0 10px 0;
}

.contact-section__description p:last-child {
    margin-bottom: 0;
}

.contact-section__title {
    font-size: 40px;
    line-height: 1.2;
    margin: 0;
    font-weight: 400;
}

/* Colonne droite - Formulaire */
.contact-section__right {
    flex: 1;
    max-width: 536px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.contact-form__messages {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.contact-form__messages.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.contact-form__messages.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.contact-form__field {
    position: relative;
}

.contact-form__input,
.contact-form__textarea {
    width: 100%;
    padding: 15px 0;
    font-size: 28px;
    line-height: 37px;
    background: transparent;
    border: none;
    border-bottom: 2px solid currentColor;
    color: currentColor;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease;
}

.contact-form__input::placeholder,
.contact-form__textarea::placeholder {
    color: currentColor;
    opacity: 0.6;
}

.contact-form__input:focus,
.contact-form__textarea:focus {
    border-bottom-color: #E0E648;
}

.contact-form__textarea {
    resize: vertical;
    min-height: 100px;
}

.contact-form__field--large {
    margin-top: 20px;
}

.contact-form__line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #E0E648;
    transition: width 0.3s ease;
}

.contact-form__input:focus~.contact-form__line,
.contact-form__textarea:focus~.contact-form__line {
    width: 100%;
}

.contact-form__submit {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn--contact {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 20px;
    line-height: 60px;
    text-transform: uppercase;
    letter-spacing: 3px;
    background: transparent;
    border: 2px solid currentColor;
    color: currentColor;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 260px;
    height: 52px;
    overflow: hidden;
    font-weight: normal;
}

.btn--contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn--contact .btn-text {
    position: relative;
    z-index: 2;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.btn--contact .btn-arrow {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 1;
    color: inherit;
    display: none;
}

.btn--contact:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 1200px) {
    .contact-section__wrapper {
        flex-direction: column;
        gap: 60px;
    }

    .contact-section__right {
        max-width: 100% !important;
        width: 100%;
    }

    .contact-section__title {
        font-size: 50px;
    }

    .contact-form {
        width: 100%;
    }

    .contact-form__field {
        width: 100%;
    }

    .contact-form__input,
    .contact-form__textarea {
        width: 100% !important;
        max-width: 100%;
    }

    .btn--contact {
        width: 100%;
        max-width: 100%;
    }

    .contact-form__submit {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .wp-block-mediapilote-contact.contact-section {
        padding: 60px 0;
    }

    .contact-section__wrapper {
        padding: 0 20px;
        gap: 40px;
    }

    .contact-section__title {
        font-size: 40px;
    }

    .contact-section__subtitle {
        font-size: 24px;
        line-height: 32px;
    }

    .contact-section__description {
        font-size: 18px;
        line-height: 26px;
    }

    .contact-form__input,
    .contact-form__textarea {
        font-size: 20px;
        line-height: 28px;
    }

    .btn--contact {
        font-size: 16px;
        line-height: 1.2;
        height: 48px;
        padding: 0;
        min-width: auto;
        width: 100%;
    }

    .btn--contact .btn-text {
        line-height: normal;
    }
}

@media (max-width: 480px) {
    .contact-section__title {
        font-size: 25px;
    }

    .contact-section__subtitle {
        font-size: 20px;
        line-height: 28px;
    }

    .contact-form {
        gap: 30px;
    }
}

/* Animation de chargement */
.contact-form.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.contact-form.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #E0E648;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.contact-form {
    input:not([type="checkbox"]) {
        width: 100%;
    }

    .wpcf7-list-item {
        margin-left: 0 !important;
    }

    .row {
        margin-bottom: 20px;
    }

    label.form-label {
        font-weight: 600;
        text-transform: uppercase;
    }

    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="date"],
    textarea,
    input[type="tel"] {
        width: 100%;
        padding: 15px 0;
        background: transparent;
        border: none;
        border-bottom: 2px solid currentColor;
        color: currentColor;
        font-family: inherit;
        outline: none;
        transition: border-color 0.3s ease;

        @media (max-width: 768px) {
            padding-top: 5px;
            margin-bottom: 20px;
        }
    }
}

.wpcf7-checkbox {
    margin-top: 10px;
    display: block;
}

.wpcf7-not-valid-tip {
    border-radius: 0 !important;
}

.wpcf7-submit {
    display: inline-block;
    padding: 0;
    background: transparent;
    border: 2px solid var(--wp--preset--color--secondary);
    color: var(--wp--preset--color--secondary);
    text-decoration: none;
    width: 260px;
    height: 52px;
    overflow: hidden;
    font-weight: 400;
    font-size: 20px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .demande-infos-form {
        width: 100% !important;

        [class*="col-"] {
            padding-left: 0 !important;
            padding-right: 0 !important;
        }
    }
}