/* ====================== BOUTONS : STANDARD UNIQUE DU SITE ======================
   Une seule definition pour la forme, la taille, les couleurs et les effets (repos, survol, focus, appui, desactive).
   Toute page, tout composant : on ajoute le bouton a une variante ci-dessous, on ne le re-style jamais localement.
   Reference : DESIGN.md (un seul Bleu Atelier, halo bleu reserve au primaire, rayons 4 px des commandes).

   Variantes
   - primaire        : action principale (devis, envoyer, continuer, itineraire)          bleu plein
   - secondaire      : action alternative sur fond clair (retour, voir les services...)   blanc + filet bleu
   - sur fond sombre : secondaire dans un hero/pied sombre                                 transparent + filet blanc
   - discret         : petits boutons du pied de page (haut de page, cookies)             meme logique, taille compacte
   Les surfaces sombres ne changent PAS le primaire : le Bleu Atelier reste le bleu d'action. */

:root {
    --btn-radius: 4px;
    --btn-h: 48px;
    --btn-h-compact: 44px;
    --btn-font: 0.9rem;
    --btn-weight: 600;
    --btn-ease: cubic-bezier(0.22, 1, 0.36, 1);

    --btn-blue: #245cff;
    --btn-blue-deep: #0b3edc;
    --btn-link: #0759b5;
    --btn-halo: 0 12px 24px rgba(36, 92, 255, 0.22);
    --btn-halo-hover: 0 16px 30px rgba(36, 92, 255, 0.28);
    --btn-disabled: #8f98a6;
}

/* ---------- Socle commun : forme, taille, typographie, transition ---------- */
html body :is(
    .hero-btn, .hero-btn-secondary, .cta-btn, .retro-secondary-btn,
    .step-next, .step-prev, .step-submit, .qs-again, .qs-call,
    .contact-location-link, .faq-direct-link, .consent-btn,
    .google-reviews-actions a, .instagram-feed-actions a
) {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: auto !important;
    min-height: var(--btn-h) !important;
    padding: 0 24px !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: var(--btn-radius) !important;
    font-family: "Bricolage Grotesque", system-ui, sans-serif;
    font-size: var(--btn-font) !important;
    font-weight: var(--btn-weight) !important;
    letter-spacing: 0 !important;
    line-height: 1.2;
    text-decoration: none !important;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.24s ease,
        transform 0.24s var(--btn-ease) !important;
}

/* compact : boutons a l'interieur d'une carte ou d'une banniere */
html body :is(.step-next, .step-prev, .step-submit, .qs-again, .qs-call, .consent-btn) {
    min-height: var(--btn-h-compact) !important;
    padding: 0 18px !important;
}

/* ---------- Primaire ---------- */
html body :is(
    .hero-btn:not(.hero-btn-secondary), .cta-btn, .step-next, .step-submit, .qs-again,
    .contact-location-link, .consent-btn[data-choice="granted"]
) {
    background: var(--btn-blue) !important;
    border-color: var(--btn-blue) !important;
    color: #ffffff !important;
    box-shadow: var(--btn-halo) !important;
}

html body :is(
    .hero-btn:not(.hero-btn-secondary), .cta-btn, .step-next, .step-submit, .qs-again,
    .contact-location-link, .consent-btn[data-choice="granted"]
):is(:hover, :focus-visible):not(:disabled):not([aria-disabled="true"]) {
    background: var(--btn-blue-deep) !important;
    border-color: var(--btn-blue-deep) !important;
    color: #ffffff !important;
    box-shadow: var(--btn-halo-hover) !important;
    transform: translateY(-2px);
}

/* ---------- Secondaire (fond clair) ---------- */
html body :is(
    .hero-btn-secondary, .retro-secondary-btn, .step-prev, .qs-call, .faq-direct-link,
    .consent-btn:not([data-choice="granted"]),
    .google-reviews-actions a, .instagram-feed-actions a
) {
    background: #ffffff !important;
    border-color: rgba(5, 117, 230, 0.22) !important;
    color: var(--btn-link) !important;
    box-shadow: none !important;
}

html body :is(
    .hero-btn-secondary, .retro-secondary-btn, .step-prev, .qs-call, .faq-direct-link,
    .consent-btn:not([data-choice="granted"]),
    .google-reviews-actions a, .instagram-feed-actions a
):is(:hover, :focus-visible):not(:disabled):not([aria-disabled="true"]) {
    background: #f1f8ff !important;
    border-color: rgba(5, 117, 230, 0.45) !important;
    color: var(--btn-link) !important;
    transform: translateY(-2px);
}

/* ---------- Sur fond sombre : secondaire transparent ---------- */
html body :is(.intro, .ft, .cta-final, .contact-intro-hero) :is(.hero-btn-secondary, .retro-secondary-btn) {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    color: #ffffff !important;
}

html body :is(.intro, .ft, .cta-final, .contact-intro-hero) :is(.hero-btn-secondary, .retro-secondary-btn):is(:hover, :focus-visible) {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: #ffffff !important;
}

/* ---------- Discret (pied de page) ---------- */
html body :is(.ft-top, .ft-consent) {
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--btn-radius) !important;
    background: transparent;
    color: #ffffff;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.24s var(--btn-ease);
}

html body :is(.ft-top, .ft-consent):is(:hover, :focus-visible) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* ---------- Liens texte : meme bleu de lien, meme survol ---------- */
html body :is(.cl-link, .svc-text-link) {
    color: var(--btn-link) !important;
    text-decoration: underline !important;
    text-decoration-color: rgba(7, 89, 181, 0.3) !important;
    text-underline-offset: 5px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease !important;
}

html body :is(.cl-link, .svc-text-link):is(:hover, :focus-visible) {
    color: var(--btn-blue) !important;
    text-decoration-color: currentColor !important;
}

/* ---------- Appui, focus, desactive : identiques pour tous ---------- */
html body :is(
    .hero-btn, .hero-btn-secondary, .cta-btn, .retro-secondary-btn,
    .step-next, .step-prev, .step-submit, .contact-location-link, .faq-direct-link,
    .consent-btn, .google-reviews-actions a, .instagram-feed-actions a,
    .ft-top, .ft-consent, .nav-cta, .cc-chip
):active:not(:disabled) {
    transform: translateY(0);
}

html body :is(
    .hero-btn, .hero-btn-secondary, .cta-btn, .retro-secondary-btn,
    .step-next, .step-prev, .step-submit, .contact-location-link, .faq-direct-link,
    .consent-btn, .google-reviews-actions a, .instagram-feed-actions a,
    .ft-top, .ft-consent, .nav-cta, .nav-toggle, .cc-chip, .quote-tab
):focus-visible {
    outline: 3px solid rgba(5, 117, 230, 0.38);
    outline-offset: 3px;
}

html body :is(.step-next, .step-prev, .step-submit):is(:disabled, [aria-disabled="true"]) {
    background: var(--btn-disabled) !important;
    border-color: var(--btn-disabled) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none;
}

/* ---------- Menu : le bouton « devis » du header suit la meme logique (encre, puis Bleu Atelier au survol) ---------- */
html body .nav-cta {
    font-weight: var(--btn-weight);
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.24s var(--btn-ease);
}

html body .nav-cta:is(:hover, :focus-visible) {
    transform: translateY(-2px);
}

/* ---------- Mouvement reduit ---------- */
@media (prefers-reduced-motion: reduce) {
    html body :is(
        .hero-btn, .hero-btn-secondary, .cta-btn, .retro-secondary-btn,
        .step-next, .step-prev, .step-submit, .contact-location-link, .faq-direct-link,
        .consent-btn, .google-reviews-actions a, .instagram-feed-actions a,
        .ft-top, .ft-consent, .nav-cta
    ) {
        transition: none !important;
    }

    html body :is(
        .hero-btn, .hero-btn-secondary, .cta-btn, .retro-secondary-btn,
        .step-next, .step-prev, .step-submit, .contact-location-link, .faq-direct-link,
        .consent-btn, .google-reviews-actions a, .instagram-feed-actions a,
        .ft-top, .ft-consent, .nav-cta
    ):is(:hover, :focus-visible) {
        transform: none !important;
    }
}

/* ---------- Mobile : liens directs (FAQ, contact) alignes sur les autres boutons pleine largeur ---------- */
@media (max-width: 720px) {
    html body .faq-direct-link {
        display: flex;
        width: 100%;
        max-width: none;
        justify-content: space-between;
        padding-left: 20px;
        white-space: nowrap;
    }

    html body .faq-direct-link span {
        flex: none;
        margin-left: 12px;
    }

    html body .cl-actions > .faq-direct-link {
        justify-content: center;
        padding-inline: 12px;
        text-align: center;
    }
}

/* ---------- Tres petits ecrans (300 px et plus) : le libelle passe a la ligne au lieu d'etre coupe ---------- */
@media (max-width: 400px) {
    html body :is(
        .hero-btn, .hero-btn-secondary, .cta-btn, .retro-secondary-btn,
        .step-next, .step-prev, .step-submit, .qs-again, .qs-call,
        .contact-location-link, .faq-direct-link, .consent-btn,
        .google-reviews-actions a, .instagram-feed-actions a
    ) {
        max-width: 100%;
        padding: 10px 16px !important;
        white-space: normal !important;
        text-align: center;
        overflow-wrap: anywhere;
    }
}

