/* ============================================================
   contact.css — page Contact : formulaire, le comptoir, FAQ
   ============================================================ */

.contact-section {
    padding: min(100px, 8vw) var(--page-padding);
    background-color: #FFF;

    .container {
        display: grid;
        grid-template-columns: 1.3fr 1fr;
        gap: clamp(40px, 6vw, 110px);
        align-items: start;
    }

    h2 {
        font-size: 2.2vw;
        font-variation-settings: 'wdth' 80, 'wght' 300;
        text-transform: uppercase;
        margin-bottom: 10px;
    }

    .intro {
        color: var(--color-muted);
        font-size: clamp(15px, 1.1vw, 18px);
        margin-bottom: 36px;
        font-variation-settings: 'wdth' 100, 'wght' 300;
    }
}

/* ---------- formulaire ---------- */
.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px 20px;

    .field {
        display: flex;
        flex-direction: column;
        gap: 6px;
        position: relative;

        &.full {
            grid-column: 1 / -1;
        }

        label {
            font-size: 12px;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: var(--color-muted);
            font-variation-settings: 'wdth' 90, 'wght' 450;

            .opt {
                text-transform: none;
                letter-spacing: 0;
                opacity: 0.7;
            }
        }

        input,
        select,
        textarea {
            font: inherit;
            font-size: 16px;
            font-variation-settings: 'wdth' 100, 'wght' 300;
            color: var(--text-color-dark);
            background: transparent;
            border: none;
            border-bottom: 1px solid var(--color-border-header);
            padding: 10px 0;
            border-radius: 0;
            outline: none;
            transition: border-color 300ms;
            width: 100%;

            &::placeholder {
                color: rgba(50, 40, 29, 0.35);
            }
        }

        textarea {
            min-height: 140px;
            resize: vertical;
        }

        select {
            cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2332281D' stroke-width='1.5' 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 0 center;
            background-size: 16px;
            padding-right: 24px;
        }

        /* trait rouge qui se déploie au focus, comme les soulignés de la navigation */
        &::after {
            content: "";
            position: absolute;
            left: 0;
            bottom: 0;
            width: 100%;
            height: 1px;
            background-color: var(--color-red);
            transform: scaleX(0);
            transform-origin: left;
            transition: transform 500ms var(--ease-out-expo);
            pointer-events: none;
        }

        &:focus-within::after {
            transform: scaleX(1);
        }

        &.has-error {
            input,
            select,
            textarea {
                border-bottom-color: var(--color-red);
            }
        }

        .error-msg {
            font-size: 12px;
            color: var(--color-red);
            min-height: 0;
            display: none;
        }

        &.has-error .error-msg {
            display: block;
        }
    }

    .field.consent {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;

        &::after {
            display: none;
        }

        input[type="checkbox"] {
            width: 18px;
            height: 18px;
            margin-top: 2px;
            accent-color: var(--color-red);
            flex-shrink: 0;
            border: none;
        }

        label {
            text-transform: none;
            letter-spacing: 0;
            font-size: 13px;
            line-height: 1.5;
            color: var(--color-muted);
            font-variation-settings: 'wdth' 100, 'wght' 300;

            a {
                color: var(--color-red);
            }
        }
    }

    /* champ piège anti-robots */
    .field.hp {
        position: absolute;
        left: -9999px;
        opacity: 0;
        height: 0;
        overflow: hidden;
    }

    .form-actions {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        gap: 20px;
        flex-wrap: wrap;

        .form-note {
            font-size: 13px;
            color: var(--color-muted);
        }
    }

    .form-status {
        grid-column: 1 / -1;
        padding: 18px 22px;
        background-color: var(--color-grey);
        border-left: 3px solid var(--text-color-dark);
        font-size: 15px;
        line-height: 1.5;
        animation: rise-in 900ms var(--ease-out-expo) both;

        &[hidden] {
            display: none;
        }

        &.ok {
            border-left-color: #5C7C6E;
        }

        &.err {
            border-left-color: var(--color-red);
        }

        a {
            color: var(--color-red);
        }
    }
}

/* ---------- le comptoir (coordonnées) ---------- */
.comptoir {
    display: flex;
    flex-direction: column;
    gap: 18px;

    .comptoir-card {
        background-color: var(--color-grey);
        padding: 28px 30px;
        position: relative;

        h3 {
            font-size: 12px;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: var(--color-red);
            margin-bottom: 14px;
        }

        p,
        li {
            font-size: 15px;
            line-height: 1.6;
            color: var(--text-color-dark);
            font-variation-settings: 'wdth' 100, 'wght' 300;
        }

        a {
            color: var(--text-color-dark);
            text-decoration: none;
            border-bottom: 1px solid rgba(50, 40, 29, 0.25);
            transition: border-color 300ms;

            &:hover {
                border-bottom-color: var(--color-red);
            }
        }

        .big {
            font-size: clamp(18px, 1.4vw, 22px);
            font-variation-settings: 'wdth' 100, 'wght' 400;
            margin-bottom: 4px;
        }

        .muted {
            color: var(--color-muted);
            font-size: 14px;
        }

        .hours {
            li {
                display: flex;
                justify-content: space-between;
                padding: 6px 0;
                border-bottom: 1px dashed rgba(50, 40, 29, 0.15);

                &:last-child {
                    border-bottom: none;
                }

                span:last-child {
                    color: var(--color-muted);
                }
            }
        }

        &.rdv {
            background-color: var(--text-color-dark);
            color: #FFF;

            h3 {
                color: var(--color-gold);
            }

            p {
                color: rgba(255, 255, 255, 0.8);
                margin-bottom: 18px;
            }
        }
    }
}

/* ---------- FAQ ---------- */
.faq-section {
    padding: min(100px, 8vw) var(--page-padding);
    background-color: var(--color-grey);

    .container {
        max-width: 860px;
        margin: 0 auto;
    }

    h2 {
        font-size: 2.2vw;
        font-variation-settings: 'wdth' 80, 'wght' 300;
        text-transform: uppercase;
        text-align: center;
        margin-bottom: 50px;
    }

    .faq-item {
        background-color: #FFF;
        margin-bottom: 10px;
        border-left: 3px solid transparent;
        transition: border-color 400ms;

        &.open {
            border-left-color: var(--color-red);
        }

        button {
            appearance: none;
            background: none;
            border: none;
            width: 100%;
            text-align: left;
            font: inherit;
            font-size: clamp(15px, 1.15vw, 18px);
            font-variation-settings: 'wdth' 100, 'wght' 400;
            color: var(--text-color-dark);
            padding: 22px 26px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 20px;
            cursor: pointer;

            .plus {
                width: 14px;
                height: 14px;
                position: relative;
                flex-shrink: 0;

                &::before,
                &::after {
                    content: "";
                    position: absolute;
                    background-color: var(--color-red);
                    transition: transform 500ms var(--ease-out-expo);
                }

                &::before {
                    left: 0;
                    top: 6px;
                    width: 14px;
                    height: 2px;
                }

                &::after {
                    left: 6px;
                    top: 0;
                    width: 2px;
                    height: 14px;
                }
            }
        }

        &.open button .plus::after {
            transform: rotate(90deg) scaleY(0);
        }

        .faq-answer {
            display: grid;
            grid-template-rows: 0fr;
            transition: grid-template-rows 600ms var(--ease-out-expo);

            > div {
                overflow: hidden;
            }

            p {
                padding: 0 26px 24px;
                font-size: 15px;
                line-height: 1.6;
                color: var(--color-muted);
                font-variation-settings: 'wdth' 100, 'wght' 300;
            }

            a {
                color: var(--color-red);
            }
        }

        &.open .faq-answer {
            grid-template-rows: 1fr;
        }
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .contact-section,
    .faq-section {
        padding-inline: 40px;
    }

    .contact-section h2,
    .faq-section h2 {
        font-size: 3vw;
    }
}

@media (max-width: 900px) {
    .contact-section {
        padding: 50px 20px;

        .container {
            grid-template-columns: 1fr;
        }

        h2 {
            font-size: 5vw;
        }
    }

    .faq-section {
        padding: 50px 20px;

        h2 {
            font-size: 5vw;
        }
    }
}

@media (max-width: 600px) {
    .contact-form {
        grid-template-columns: 1fr;

        .form-actions .btn-bar {
            width: 100%;
        }
    }

    .contact-section h2,
    .faq-section h2 {
        font-size: 22px;
    }
}

/* bouton dans les cartes du comptoir : ne pas hériter du style des liens texte */
.comptoir .comptoir-card a.btn-bar {
    color: var(--btn-color);
    border-bottom: none;
}

.comptoir .comptoir-card a.btn-bar:hover,
.comptoir .comptoir-card a.btn-bar:focus-visible {
    color: var(--btn-text-hover);
}
