/* GRM consent modal (plg_system_grmdesign) — pairs with js/consent.js.
   Loaded only when the ga_measurement_id param is set. A PERSISTENT centred
   modal: overlay blocks the page (scroll locked via body.grm-consent-open)
   until the visitor accepts the terms, chooses on analytics, and Submits. */

body.grm-consent-open {
    overflow: hidden;
}

.grm-consent-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000; /* above the map toolbars (9999x range) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.6);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.grm-consent-modal {
    background: #fff;
    color: #0f172a;
    font-family: var(--gr-font-sans, Inter, sans-serif);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px;
    padding: 26px 28px 24px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.45);
    outline: none;
}

.grm-consent-modal h2 {
    margin: 0 0 10px;
    font-size: 1.3rem;
    font-weight: 700;
}

.grm-consent-intro {
    margin: 0 0 18px;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #475569;
}

.grm-consent-intro a {
    color: #166534;
    font-weight: 600;
    text-decoration: underline;
}

.grm-consent-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-top: 1px solid #e2e8f0;
}

.grm-consent-row-label strong {
    display: block;
    font-size: 0.95rem;
}

.grm-consent-row-label span {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
}

.grm-consent-row-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.grm-consent-opt {
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 9999px;
    cursor: pointer;
    background: #fff;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.grm-consent-opt.is-selected {
    background: var(--gr-green, #22c55e);
    border-color: var(--gr-green, #22c55e);
    color: #0f172a;
}

/* A selected Decline reads as a deliberate "no", not a success state. */
.grm-consent-opt[data-choice="declined"].is-selected {
    background: #334155;
    border-color: #334155;
    color: #f1f5f9;
}

.grm-consent-submit {
    display: block;
    width: 100%;
    margin-top: 18px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 11px 16px;
    border-radius: 9999px;
    border: 0;
    cursor: pointer;
    background: var(--gr-green-dark, #166534);
    color: #fff;
}

.grm-consent-submit:disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .grm-consent-modal {
        padding: 20px 18px 18px;
    }
    .grm-consent-row-actions {
        width: 100%;
    }
    .grm-consent-opt {
        flex: 1 1 auto;
    }
}
