/* =====================================================
   LEH · Formulaire Contact - CSS v2 (refonte from scratch)
   Structure inspirée de Crépy Auto Services (CAS)
   ===================================================== */

.leh-cp {
    --leh-dark: #1B4D2E;
    --leh-main: #4A7C3B;
    --leh-light: #7AB55C;
    --leh-text: #1B4D2E;
    --leh-text-muted: #5A5A5A;
    --leh-border: rgba(74,124,59,0.2);
    --leh-bg-soft: rgba(74,124,59,0.05);

    position: relative;
    width: 100%;
    padding: 60px 20px;
    box-sizing: border-box;
}

.leh-cp *,
.leh-cp *::before,
.leh-cp *::after {
    box-sizing: border-box;
}

.leh-cp__sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   CONTAINER
   ============================================================ */
.leh-cp__container {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
}

/* ============================================================
   HEADER
   ============================================================ */
.leh-cp__header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 50px;
}

.leh-cp__eyebrow {
    display: inline-block;
    color: var(--leh-main);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding: 6px 16px;
    background: var(--leh-bg-soft);
    border-radius: 100px;
}

.leh-cp__title {
    color: var(--leh-text);
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 14px;
}

.leh-cp__subtitle {
    color: var(--leh-text-muted);
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

/* ============================================================
   LAYOUT 2 COLONNES (PC)
   ============================================================ */
.leh-cp__layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 30px;
    align-items: stretch;
}

.leh-cp--no-left .leh-cp__layout {
    grid-template-columns: 1fr;
    max-width: 720px;
    margin: 0 auto;
}

/* Position des colonnes (PC) */
.leh-cp--info-left .leh-cp__left { order: 1; }
.leh-cp--info-left .leh-cp__right { order: 2; }

.leh-cp--info-right .leh-cp__layout {
    grid-template-columns: 1fr 380px;
}
.leh-cp--info-right .leh-cp__left { order: 2; }
.leh-cp--info-right .leh-cp__right { order: 1; }

/* Mobile : empilement vertical */
@media (max-width: 1024px) {
    .leh-cp__layout,
    .leh-cp--info-right .leh-cp__layout {
        grid-template-columns: 1fr !important;
        gap: 24px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .leh-cp--mobile-form_first .leh-cp__right { order: 1; }
    .leh-cp--mobile-form_first .leh-cp__left { order: 2; }

    .leh-cp--mobile-info_first .leh-cp__left { order: 1; }
    .leh-cp--mobile-info_first .leh-cp__right { order: 2; }
}

/* ============================================================
   COLONNE GAUCHE (panels infos + map)
   ============================================================ */
.leh-cp__left {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

/* Map prend tout l'espace restant pour aligner avec le formulaire */
.leh-cp__panel--map {
    flex: 1;
    min-height: 250px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(27,77,46,0.12);
}

.leh-cp__panel--map iframe {
    width: 100%;
    height: 100% !important;
    min-height: 240px;
    border: 0;
    display: block;
}

@media (max-width: 1024px) {
    .leh-cp__left { height: auto; }
    .leh-cp__panel--map { flex: none; }
    .leh-cp__panel--map iframe { height: 280px !important; }
}

/* ============================================================
   PANEL INFOS (gauche)
   ============================================================ */
.leh-cp__panel--info {
    padding: 32px 28px;
    border-radius: 16px;
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--leh-dark) 0%, var(--leh-main) 100%);
    box-shadow: 0 10px 30px rgba(27,77,46,0.18);
}

/* Type de fond : flat (couleur unie) */
.leh-cp--info-bg-flat .leh-cp__panel--info {
    background: var(--leh-dark);
}

.leh-cp__panel-title {
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 24px;
}

/* Liste d'infos */
.leh-cp__info-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.leh-cp__info-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.leh-cp__info-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.15);
    color: var(--leh-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.leh-cp__info-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.leh-cp__info-content {
    flex: 1 1 0%;
    min-width: 0;
    line-height: 1.5;
}

.leh-cp__info-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.65);
    margin-bottom: 4px;
}

.leh-cp__info-value {
    font-size: 15px;
    font-weight: 600;
    color: #FFFFFF;
    word-break: break-word;
    line-height: 1.45;
}

/* Email : autoriser césure complète si trop long */
.leh-cp__info-value--email {
    word-break: break-all;
    font-size: 14px;
}

.leh-cp__info-value a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.leh-cp__info-value a:hover {
    opacity: 0.85;
    text-decoration: underline;
}

.leh-cp__info-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--leh-light) !important;
    text-decoration: none;
    font-weight: 600;
}

.leh-cp__info-link:hover {
    text-decoration: underline;
}

/* Horaires */
.leh-cp__hours {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
}

.leh-cp__hours-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 14px;
    color: #FFFFFF;
    border-bottom: 1px dashed rgba(255,255,255,0.15);
    gap: 12px;
}

.leh-cp__hours-line:last-child {
    border-bottom: none;
}

.leh-cp__hours-line.is-closed span:last-child {
    color: rgba(255,255,255,0.55);
    font-style: italic;
    font-weight: 400;
}

.leh-cp__hours-line span:first-child {
    font-weight: 600;
    white-space: nowrap;
}

/* Réseaux sociaux */
.leh-cp__social {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.leh-cp__social-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.15);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
    text-decoration: none;
}

.leh-cp__social-item:hover {
    background-color: var(--leh-light);
    transform: translateY(-2px);
}

.leh-cp__social-item svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.leh-cp__social-item i {
    font-size: 15px;
}

/* ============================================================
   PANEL FORMULAIRE (droite)
   ============================================================ */
.leh-cp__form-panel {
    background-color: #FFFFFF;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 10px 30px rgba(27,77,46,0.12);
    height: 100%;
}

.leh-cp__form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.leh-cp__field-group {
    position: relative;
}

.leh-cp__field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--leh-dark);
    margin-bottom: 6px;
    line-height: 1.4;
}

.leh-cp__sujet-section-label {
    font-size: 15px;
    margin-bottom: 14px;
}

/* ============================================================
   CARDS SUJETS
   ============================================================ */
.leh-cp__sujet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* Si le panel form fait moins de 500px, passer en 2x2 */
@container (max-width: 500px) {
    .leh-cp__sujet-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.leh-cp__sujet-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 8px;
    background-color: #FFFFFF;
    border: 2px solid var(--leh-border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    min-height: 110px;
}

.leh-cp__sujet-card:hover {
    border-color: var(--leh-main);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(27,77,46,0.08);
}

.leh-cp__sujet-card.is-selected {
    border-color: var(--leh-main);
    box-shadow: 0 0 0 3px rgba(74,124,59,0.18);
}

.leh-cp__sujet-icon-wrap {
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    border-radius: 50%;
    background-color: var(--leh-bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    transition: background 0.3s ease;
}

.leh-cp__sujet-card.is-selected .leh-cp__sujet-icon-wrap {
    background: linear-gradient(135deg, var(--leh-dark) 0%, var(--leh-main) 100%);
}

.leh-cp__sujet-icon {
    color: var(--leh-main);
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.leh-cp__sujet-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.leh-cp__sujet-card.is-selected .leh-cp__sujet-icon,
.leh-cp__sujet-card.is-selected .leh-cp__sujet-icon svg {
    color: #FFFFFF;
    fill: #FFFFFF;
}

.leh-cp__sujet-label {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--leh-dark);
    word-wrap: break-word;
}

/* ============================================================
   CHAMPS DE FORMULAIRE
   ============================================================ */
.leh-cp__fields-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.leh-cp__input,
.leh-cp__textarea {
    width: 100%;
    padding: 12px 14px;
    background-color: #FFFFFF;
    color: var(--leh-dark);
    border: 2px solid var(--leh-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.leh-cp__input::placeholder,
.leh-cp__textarea::placeholder {
    color: #999;
}

.leh-cp__input:focus,
.leh-cp__textarea:focus {
    outline: none;
    border-color: var(--leh-main);
    box-shadow: 0 0 0 3px rgba(74,124,59,0.18);
}

.leh-cp__input.has-error,
.leh-cp__textarea.has-error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220,53,69,0.12);
}

.leh-cp__textarea {
    resize: vertical;
    min-height: 120px;
}

.leh-cp__field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

.leh-cp__form-error {
    color: #dc3545;
    background-color: rgba(220,53,69,0.08);
    border: 1px solid rgba(220,53,69,0.2);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
}

/* ============================================================
   RGPD
   ============================================================ */
.leh-cp__rgpd {
    padding: 14px;
    background-color: var(--leh-bg-soft);
    border-radius: 10px;
}

.leh-cp__rgpd-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    color: var(--leh-text-muted);
}

.leh-cp__rgpd-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.leh-cp__rgpd-check {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border: 2px solid var(--leh-border);
    border-radius: 5px;
    background-color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, border-color 0.3s ease;
    position: relative;
    margin-top: 1px;
}

.leh-cp__rgpd-check::after {
    content: '';
    width: 10px;
    height: 5px;
    border-left: 2px solid #FFFFFF;
    border-bottom: 2px solid #FFFFFF;
    transform: rotate(-45deg) translateY(-1px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.leh-cp__rgpd-label input:checked ~ .leh-cp__rgpd-check {
    background: linear-gradient(135deg, var(--leh-dark) 0%, var(--leh-main) 100%);
    border-color: var(--leh-main);
}

.leh-cp__rgpd-label input:checked ~ .leh-cp__rgpd-check::after {
    opacity: 1;
}

.leh-cp__rgpd-text {
    flex: 1 1 0%;
    min-width: 0;
}

.leh-cp__rgpd-link {
    color: var(--leh-main);
    text-decoration: underline;
    font-weight: 600;
}

.leh-cp__rgpd-link:hover {
    color: var(--leh-dark);
}

/* ============================================================
   BOUTON SUBMIT
   ============================================================ */
.leh-cp__submit {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--leh-dark) 0%, var(--leh-main) 100%);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(27,77,46,0.2);
    width: 100%;
}

.leh-cp__submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(27,77,46,0.3);
}

.leh-cp__submit[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.leh-cp__submit .leh-cp__submit-text { display: inline-flex; }
.leh-cp__submit .leh-cp__submit-loading { display: none; }
.leh-cp__submit.is-loading .leh-cp__submit-text { display: none; }
.leh-cp__submit.is-loading .leh-cp__submit-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.leh-cp__spinner {
    width: 18px;
    height: 18px;
    animation: leh-cp-spin 0.8s linear infinite;
}

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

/* ============================================================
   SUCCÈS
   ============================================================ */
.leh-cp__success {
    text-align: center;
    padding: 40px 24px;
    background-color: var(--leh-bg-soft);
    border-radius: 14px;
}

.leh-cp__success-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--leh-dark) 0%, var(--leh-main) 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    box-shadow: 0 10px 26px rgba(27,77,46,0.25);
}

.leh-cp__success-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--leh-dark);
    margin: 0 0 8px;
}

.leh-cp__success-message {
    font-size: 14px;
    line-height: 1.6;
    color: var(--leh-text-muted);
    margin: 0;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================
   RESPONSIVE - MOBILE
   ============================================================ */
@media (max-width: 600px) {
    .leh-cp {
        padding: 40px 12px;
    }

    .leh-cp__form-panel,
    .leh-cp__panel--info {
        padding: 24px 20px;
    }

    .leh-cp__sujet-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .leh-cp__sujet-card {
        min-height: 95px;
        padding: 12px 6px;
    }

    .leh-cp__sujet-icon-wrap {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .leh-cp__sujet-icon {
        font-size: 18px;
    }
    .leh-cp__sujet-icon svg {
        width: 18px;
        height: 18px;
    }

    .leh-cp__sujet-label {
        font-size: 12px;
    }

    .leh-cp__fields-row {
        grid-template-columns: 1fr !important;
    }

    .leh-cp__submit {
        font-size: 15px;
    }
}

/* ============================================================
   ACCESSIBILITÉ
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .leh-cp__sujet-card,
    .leh-cp__submit,
    .leh-cp__social-item,
    .leh-cp__success-icon,
    .leh-cp__spinner {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}
