/* Privacy preference banner & panel (js/consent.js) */
:root {
    --ac-surface: #0f1626;
    --ac-surface-2: #141d31;
    --ac-border: rgba(148, 163, 184, 0.22);
    --ac-text: #e8eef7;
    --ac-muted: #a7b4c8;
    --ac-teal: #20c997;
    --ac-teal-dark: #17a57b;
    --ac-on-teal: #04140f;
    --ac-focus: #33ffcc;
    --ac-radius: 16px;
    --ac-banner-h: 0px;
}

.ac-hidden { display: none !important; }

.ac-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 10000;
    max-width: 1080px;
    margin: 0 auto;
    background: var(--ac-surface);
    color: var(--ac-text);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    padding: 20px 24px;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 24px;
    animation: ac-rise 0.35s ease-out both;
}

.ac-banner-text { flex: 1 1 auto; min-width: 0; }
.ac-banner h2, .ac-dialog h2 {
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.3;
    font-family: inherit;
}
.ac-banner p { margin: 0; color: var(--ac-muted); }
.ac-banner a, .ac-dialog a { color: var(--ac-teal); text-decoration: underline; text-underline-offset: 2px; }
.ac-banner a:hover, .ac-dialog a:hover { color: var(--ac-focus); }

.ac-actions { display: flex; flex-wrap: wrap; gap: 10px; flex: 0 0 auto; }

.ac-btn {
    appearance: none;
    border-radius: 10px;
    padding: 10px 18px;
    font: 600 14px/1.2 "Inter", system-ui, sans-serif;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
    min-height: 42px;
}
.ac-btn-primary { background: var(--ac-teal); color: var(--ac-on-teal); border: 2px solid var(--ac-teal); }
.ac-btn-primary:hover { background: var(--ac-teal-dark); border-color: var(--ac-teal-dark); color: #fff; }
.ac-btn-outline { background: transparent; color: var(--ac-text); border: 2px solid var(--ac-border); }
.ac-btn-outline:hover { border-color: var(--ac-teal); color: #fff; }

.ac-btn:focus-visible,
.ac-switch input:focus-visible + .ac-switch-track,
.ac-close:focus-visible,
.ac-banner a:focus-visible,
.ac-dialog a:focus-visible,
.ac-link-btn:focus-visible {
    outline: 3px solid var(--ac-focus);
    outline-offset: 2px;
}

/* Preferences dialog */
.ac-overlay {
    position: fixed;
    inset: 0;
    z-index: 10010;
    background: rgba(3, 7, 15, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: ac-fade 0.2s ease-out both;
}
.ac-dialog {
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    background: var(--ac-surface);
    color: var(--ac-text);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}
.ac-dialog-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 12px; border-bottom: 1px solid var(--ac-border); }
.ac-dialog-head > div { flex: 1; }
.ac-dialog-head p { margin: 0; color: var(--ac-muted); }
.ac-close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--ac-border);
    background: transparent;
    color: var(--ac-text);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.ac-close:hover { border-color: var(--ac-teal); }
.ac-dialog-body { overflow-y: auto; padding: 8px 22px; }
.ac-dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--ac-border); }
.ac-note { color: var(--ac-muted); font-size: 13px; margin: 12px 0 6px; }

.ac-cat { padding: 14px 0; border-bottom: 1px solid var(--ac-border); }
.ac-cat:last-of-type { border-bottom: 0; }
.ac-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ac-cat-head h3 { font-size: 15px; font-weight: 600; color: #fff; margin: 0; font-family: inherit; }
.ac-cat p { margin: 6px 0 0; color: var(--ac-muted); }
.ac-cat details { margin-top: 8px; }
.ac-cat summary { cursor: pointer; color: var(--ac-teal); font-weight: 500; }
.ac-cat summary:focus-visible { outline: 3px solid var(--ac-focus); outline-offset: 2px; border-radius: 4px; }
.ac-cat ul { margin: 8px 0 0; padding-left: 18px; color: var(--ac-muted); }
.ac-cat li { margin: 4px 0; }
.ac-cat code { color: var(--ac-text); background: var(--ac-surface-2); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.ac-badge { flex: 0 0 auto; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; background: rgba(32, 201, 151, 0.14); color: var(--ac-teal); }
.ac-badge-muted { background: rgba(148, 163, 184, 0.14); color: var(--ac-muted); }

.ac-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; flex: 0 0 auto; }
.ac-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ac-switch-track { width: 46px; height: 26px; border-radius: 13px; background: #334155; position: relative; transition: background-color 0.2s ease; }
.ac-switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; }
.ac-switch input:checked + .ac-switch-track { background: var(--ac-teal); }
.ac-switch input:checked + .ac-switch-track::after { transform: translateX(20px); }
.ac-switch-state { font-size: 12px; color: var(--ac-muted); min-width: 22px; }

/* Footer "Cookie Settings" trigger */
.ac-link-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ac-link-btn:hover { color: var(--ac-teal); }
.ac-footer-links a, .ac-footer-links .ac-link-btn { margin: 0 4px; }

/* Consent-gated embeds (Google Maps) */
.consent-embed { position: relative; overflow: hidden; border-radius: 12px; }
.consent-embed iframe { display: block; width: 100%; border: 0; }
.consent-embed-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    padding: 28px 22px;
    background: linear-gradient(135deg, rgba(32, 201, 151, 0.10), rgba(0, 123, 255, 0.10)), #0f1626;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.6;
}
.consent-embed-placeholder .fa { font-size: 30px; color: #20c997; }
.consent-embed-placeholder p { margin: 0; max-width: 460px; color: #cbd5e1; }
.consent-embed-placeholder .consent-embed-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.consent-embed-placeholder a { color: #20c997; }

/* Privacy note at the point of collection (EnquiryForm.ascx) */
.ef-privacy-note { font-size: 12.5px; line-height: 1.55; color: #94a3b8; margin: 4px 0 12px; text-align: left; }
.ef-privacy-note a { color: #20c997; text-decoration: underline; }

/* Keep floating widgets above the banner */
body.ac-banner-open .scroll-to-top,
body.ac-banner-open #as-chatbot-root { transform: translateY(calc(-1 * var(--ac-banner-h))); transition: transform 0.25s ease; }
body.ac-banner-open { padding-bottom: var(--ac-banner-h); }

@keyframes ac-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes ac-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 991px) {
    .ac-banner { flex-direction: column; align-items: stretch; gap: 14px; }
    .ac-actions .ac-btn { flex: 1 1 auto; }
}
@media (max-width: 575px) {
    .ac-banner { left: 8px; right: 8px; bottom: 8px; padding: 14px 14px 12px; font-size: 12.5px; line-height: 1.5; gap: 10px; }
    .ac-banner h2 { font-size: 15px; margin-bottom: 4px; }
    .ac-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .ac-actions .ac-btn-outline { grid-column: 1 / -1; }
    .ac-btn { padding: 9px 12px; min-height: 40px; font-size: 13.5px; }
    .ac-dialog-head, .ac-dialog-body, .ac-dialog-foot { padding-left: 16px; padding-right: 16px; }
    .ac-dialog-foot .ac-btn { flex: 1 1 calc(50% - 10px); }
}
@media (prefers-reduced-motion: reduce) {
    .ac-banner, .ac-overlay { animation: none; }
    .ac-switch-track, .ac-switch-track::after, .ac-btn { transition: none; }
}
