/* AGM PRO — interface de consentement et pages légales */
:root {
    --agm-ink: #143730;
    --agm-green: #1b6b3a;
    --agm-green-deep: #0c2923;
    --agm-gold: #f5a623;
    --agm-paper: #ffffff;
    --agm-muted: #dcebe2;
    --agm-shadow: 0 18px 55px rgba(4, 27, 20, 0.38);
}

#agm-consent-root,
#agm-consent-root * {
    box-sizing: border-box;
}

#agm-consent-root {
    color: var(--agm-paper);
    font-family: inherit;
    line-height: 1.5;
    position: relative;
    z-index: 2147483000; /* Intentionally above common floating WhatsApp widgets. */
}

#agm-consent-root [hidden],
.agm-map-placeholder[hidden],
.agm-map-wrap iframe[hidden] {
    display: none !important;
}

.agm-consent__banner {
    background: linear-gradient(120deg, rgba(20, 55, 48, 0.98), rgba(27, 107, 58, 0.95));
    border-top: 1px solid rgba(245, 166, 35, 0.58);
    box-shadow: 0 -8px 34px rgba(7, 37, 29, 0.3);
    bottom: 0;
    color: var(--agm-paper);
    left: 0;
    padding: 16px clamp(16px, 3vw, 36px);
    position: fixed;
    right: 0;
    z-index: 1;
}

.agm-consent__banner-content {
    align-items: center;
    display: flex;
    gap: 22px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1200px;
}

.agm-consent__copy {
    min-width: 0;
}

.agm-consent__eyebrow {
    color: #ffd37d;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    margin: 0 0 3px;
    text-transform: uppercase;
}

.agm-consent__copy h2,
.agm-consent__dialog h2 {
    color: var(--agm-paper);
    font-size: clamp(1.18rem, 2.2vw, 1.55rem);
    line-height: 1.2;
    margin: 0;
}

.agm-consent__copy > p:last-child {
    font-size: 0.93rem;
    margin: 6px 0 0;
    max-width: 690px;
}

.agm-consent__actions,
.agm-consent__dialog-actions {
    align-items: stretch;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.agm-consent__actions {
    flex: 0 1 460px;
    justify-content: flex-end;
}

.agm-consent__action,
.agm-consent__save,
.agm-consent__cancel,
.agm-map-placeholder [data-agm-cookie-open] {
    appearance: none;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 8px;
    color: var(--agm-paper);
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 750;
    min-height: 44px;
    padding: 10px 15px;
    text-align: center;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

/* Same visual prominence for each first-level banner decision. */
.agm-consent__action {
    flex: 1 1 128px;
}

.agm-consent__action:hover,
.agm-consent__save:hover,
.agm-consent__cancel:hover,
.agm-map-placeholder [data-agm-cookie-open]:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: var(--agm-gold);
    transform: translateY(-1px);
}

.agm-consent__action:focus-visible,
.agm-consent__save:focus-visible,
.agm-consent__cancel:focus-visible,
.agm-consent__close:focus-visible,
.agm-map-placeholder [data-agm-cookie-open]:focus-visible,
.agm-consent__toggle input:focus-visible + .agm-consent__toggle-ui {
    outline: 3px solid var(--agm-gold);
    outline-offset: 3px;
}

.agm-consent__modal {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 2;
}

.agm-consent__backdrop {
    background: rgba(4, 24, 19, 0.73);
    backdrop-filter: blur(7px);
    inset: 0;
    position: absolute;
}

.agm-consent__dialog {
    background: linear-gradient(145deg, rgba(20, 55, 48, 0.98), rgba(12, 41, 35, 0.98));
    border: 1px solid rgba(245, 166, 35, 0.58);
    border-radius: 16px;
    box-shadow: var(--agm-shadow);
    color: var(--agm-paper);
    max-height: min(720px, calc(100vh - 36px));
    max-width: 650px;
    overflow: auto;
    overscroll-behavior: contain;
    padding: clamp(22px, 4vw, 36px);
    position: relative;
    scrollbar-color: var(--agm-gold) rgba(255, 255, 255, 0.12);
    width: 100%;
    z-index: 1;
}

.agm-consent__dialog > h2 {
    margin-bottom: 9px;
    padding-right: 36px;
}

.agm-consent__dialog > p:not(.agm-consent__eyebrow):not(.agm-consent__status) {
    color: var(--agm-muted);
    font-size: 0.95rem;
    margin: 0 0 16px;
}

.agm-consent__close {
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    color: var(--agm-paper);
    cursor: pointer;
    display: inline-flex;
    font-size: 1.55rem;
    height: 34px;
    justify-content: center;
    line-height: 1;
    padding: 0 0 3px;
    position: absolute;
    right: 18px;
    top: 18px;
    width: 34px;
}

.agm-consent__close:hover {
    background: rgba(245, 166, 35, 0.22);
    border-color: var(--agm-gold);
}

.agm-consent__status {
    background: rgba(255, 255, 255, 0.09);
    border-left: 3px solid var(--agm-gold);
    color: var(--agm-muted);
    font-size: 0.84rem;
    margin: 0 0 16px;
    padding: 9px 11px;
}

.agm-consent__form {
    margin: 0;
}

.agm-consent__choice {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(220, 235, 226, 0.25);
    border-radius: 10px;
    margin: 0 0 11px;
    min-inline-size: 0;
    padding: 13px 15px 14px;
}

.agm-consent__choice legend {
    color: var(--agm-paper);
    font-size: 1rem;
    font-weight: 800;
    padding: 0 5px;
}

.agm-consent__choice p {
    color: var(--agm-muted);
    font-size: 0.88rem;
    margin: 2px 0 11px;
}

.agm-consent__toggle {
    align-items: center;
    color: var(--agm-paper);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 700;
    gap: 10px;
}

.agm-consent__toggle input {
    block-size: 1px;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    inline-size: 1px;
    margin: -1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
}

.agm-consent__toggle-ui {
    background: rgba(255, 255, 255, 0.21);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 auto;
    height: 24px;
    position: relative;
    transition: background-color 160ms ease, border-color 160ms ease;
    width: 44px;
}

.agm-consent__toggle-ui::after {
    background: var(--agm-paper);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.32);
    content: '';
    height: 18px;
    left: 2px;
    position: absolute;
    top: 2px;
    transition: transform 160ms ease;
    width: 18px;
}

.agm-consent__toggle input:checked + .agm-consent__toggle-ui {
    background: var(--agm-green);
    border-color: #86d6a3;
}

.agm-consent__toggle input:checked + .agm-consent__toggle-ui::after {
    transform: translateX(19px);
}

.agm-consent__toggle input:disabled + .agm-consent__toggle-ui {
    background: rgba(245, 166, 35, 0.36);
    border-color: var(--agm-gold);
    opacity: 0.85;
}

.agm-consent__toggle input:disabled ~ span:last-child {
    color: #ffe2a5;
}

.agm-consent__dialog-actions {
    justify-content: flex-end;
    margin-top: 18px;
}

.agm-consent__save,
.agm-consent__cancel {
    flex: 1 1 185px;
}

.agm-consent__save {
    background: var(--agm-gold);
    border-color: var(--agm-gold);
    color: #16362e;
}

.agm-consent__save:hover {
    background: #ffc04d;
    border-color: #ffc04d;
}

.agm-map-wrap {
    position: relative;
}

.agm-map-wrap iframe {
    border: 0;
    display: block;
    max-width: 100%;
    width: 100%;
}

.agm-map-placeholder {
    align-items: center;
    background: linear-gradient(145deg, var(--agm-ink), var(--agm-green-deep));
    border: 1px solid rgba(245, 166, 35, 0.5);
    color: var(--agm-paper);
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    min-height: 240px;
    padding: 24px;
    text-align: center;
}

.agm-map-placeholder p {
    margin: 0;
    max-width: 520px;
}

/* Pages de politique, mentions légales et confidentialité. */
.agm-legal {
    color: #23453d;
    margin: 0 auto;
    max-width: 800px;
    padding: clamp(28px, 5vw, 62px) clamp(16px, 4vw, 28px);
}

.agm-legal h1,
.agm-legal h2,
.agm-legal h3 {
    color: var(--agm-ink);
    line-height: 1.2;
}

.agm-legal h2 {
    border-bottom: 2px solid rgba(245, 166, 35, 0.7);
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    margin: 2.1em 0 0.7em;
    padding-bottom: 0.34em;
}

.agm-legal p,
.agm-legal li {
    font-size: 1rem;
    line-height: 1.72;
}

.agm-legal p {
    margin: 0 0 1.05em;
}

.agm-legal a,
.agm-legal-links a {
    color: var(--agm-green);
    font-weight: 700;
    text-underline-offset: 0.16em;
}

.agm-legal a:hover,
.agm-legal-links a:hover {
    color: #0f4e29;
}

.agm-legal-links {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    justify-content: center;
    margin: 0 auto;
    max-width: 1200px;
    padding: 16px;
}

.agm-legal-links a,
.agm-legal-links button {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    padding: 4px 0;
}

.agm-legal-links button[data-agm-cookie-open] {
    color: var(--agm-green);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
}

.agm-legal-links a:focus-visible,
.agm-legal-links button:focus-visible,
.agm-legal a:focus-visible {
    outline: 3px solid var(--agm-gold);
    outline-offset: 3px;
}

@media (max-width: 720px) {
    .agm-consent__banner {
        padding: 15px 14px;
    }

    .agm-consent__banner-content {
        align-items: stretch;
        flex-direction: column;
        gap: 13px;
    }

    .agm-consent__actions {
        flex-basis: auto;
        justify-content: stretch;
    }

    .agm-consent__action {
        flex-basis: 30%;
        padding-inline: 8px;
    }
}

@media (max-width: 420px) {
    .agm-consent__modal {
        padding: 9px;
    }

    .agm-consent__dialog {
        border-radius: 11px;
        max-height: calc(100vh - 18px);
        padding: 20px 16px;
    }

    .agm-consent__actions,
    .agm-consent__dialog-actions {
        flex-direction: column;
    }

    .agm-consent__action,
    .agm-consent__save,
    .agm-consent__cancel {
        flex-basis: auto;
        width: 100%;
    }

    .agm-consent__close {
        right: 12px;
        top: 12px;
    }

    .agm-map-placeholder {
        min-height: 200px;
        padding: 18px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .agm-consent__action,
    .agm-consent__save,
    .agm-consent__cancel,
    .agm-map-placeholder [data-agm-cookie-open],
    .agm-consent__toggle-ui,
    .agm-consent__toggle-ui::after {
        transition: none;
    }
}

/* Ajustements d’intégration au thème AGM PRO existant. */
.agm-consent__copy a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.agm-consent__dialog > .agm-consent__actions { margin: 0 0 20px; }
.agm-map-wrap { width: 100%; height: 100%; min-height: 240px; }
.agm-map-wrap > iframe { height: 100%; min-height: 240px; }
.agm-legal { margin-top: 85px; }
.agm-legal h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 18px 0 28px; }
.agm-legal nav { font-size: .9rem; }
.agm-legal-eyebrow { font-size: .78rem !important; text-transform: uppercase; letter-spacing: .08em; color: #1b6b3a; margin: 25px 0 0 !important; }
.agm-legal-date { color: #596c65; font-size: .9rem !important; }
.footer .agm-legal-links, .footer .agm-legal-links a, .footer .agm-legal-links button[data-agm-cookie-open] { color: #edf7ef; }
.footer .agm-legal-links a:hover, .footer .agm-legal-links button:hover { color: #f5a623; }
.agm-cookie-button { background: #143730; color: #fff; border: 1px solid #1b6b3a; border-radius: 8px; padding: 12px 20px; font: inherit; font-weight: 700; cursor: pointer; min-height: 44px; }
.agm-cookie-button:focus-visible { outline: 3px solid #f5a623; outline-offset: 3px; }
.agm-form-privacy { font-size: 13px !important; line-height: 1.65 !important; color: #465c54; margin: 12px 0 !important; }
.agm-form-privacy a { color: #1b6b3a; text-decoration: underline; }
