/* NovaSoft cookie consent — banner, settings panel, embed placeholder (2026-10-04).
   Scoped to .nvc-*; follows the site's html.dark class. All three main buttons share
   one style on purpose (equal weight, no dark patterns). */
:root {
    --nvc-bg: #ffffff;
    --nvc-fg: #0f172a;
    --nvc-muted: #475569;
    --nvc-border: #e2e8f0;
    --nvc-surface: #f8fafc;
    --nvc-btn: #0b6bd3;          /* white text on it: 5.2:1 */
    --nvc-btn-hover: #0959b0;
    --nvc-link: #0b6bd3;
    --nvc-track: #cbd5e1;
    --nvc-shadow: 0 18px 48px rgba(15, 23, 42, .18), 0 2px 8px rgba(15, 23, 42, .08);
    --nvc-z: 2147483000;
}
html.dark {
    --nvc-bg: #0f1823;
    --nvc-fg: #f1f5f9;
    --nvc-muted: #a3b2c6;
    --nvc-border: #22324a;
    --nvc-surface: #142131;
    --nvc-link: #6cb2ff;
    --nvc-track: #3a4a60;
    --nvc-shadow: 0 18px 48px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4);
}

.nvc-banner[hidden], .nvc-modal[hidden] { display: none !important; }

.nvc-banner, .nvc-modal, .nvc-toast, .nvc-embed {
    font-family: inherit;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}
.nvc-banner *, .nvc-modal *, .nvc-embed * { box-sizing: border-box; }

/* ---------- banner ---------- */
.nvc-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: var(--nvc-z);
    display: flex;
    align-items: flex-end;
    gap: 20px 28px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 20px 22px;
    background: var(--nvc-bg);
    color: var(--nvc-fg);
    border: 1px solid var(--nvc-border);
    border-radius: 18px;
    box-shadow: var(--nvc-shadow);
    animation: nvcUp .28s ease-out;
}
/* Desktop with the Nova sidebar column: stay inside the content column. */
@media (min-width: 900px) {
    body.nai-has-sidebar .nvc-banner { right: calc(var(--nai-sidebar-width, 400px) + 16px); }
}
.nvc-banner__body { flex: 1 1 auto; min-width: 0; }
.nvc-title {
    margin: 0 0 6px;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 800;
    color: var(--nvc-fg);
    letter-spacing: 0;
    text-transform: none;
}
.nvc-text {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--nvc-muted);
}
.nvc-links {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--nvc-muted);
}
.nvc-links a {
    color: var(--nvc-link);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}
.nvc-actions {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 470px;
    max-width: 100%;
}
.nvc-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    border: 0;
    border-radius: 12px;
    background: var(--nvc-btn);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    transition: background-color .15s ease, transform .15s ease;
}
.nvc-btn:hover { background: var(--nvc-btn-hover); }
.nvc-btn:active { transform: translateY(1px); }
.nvc-btn:focus-visible, .nvc-x:focus-visible, .nvc-links a:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
}

/* ---------- settings panel ---------- */
.nvc-modal {
    position: fixed;
    inset: 0;
    z-index: calc(var(--nvc-z) + 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.nvc-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, .55);
    backdrop-filter: blur(2px);
}
.nvc-sheet {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    max-height: min(88vh, 760px);
    background: var(--nvc-bg);
    color: var(--nvc-fg);
    border: 1px solid var(--nvc-border);
    border-radius: 20px;
    box-shadow: var(--nvc-shadow);
    animation: nvcIn .22s ease-out;
}
.nvc-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px 12px;
    border-bottom: 1px solid var(--nvc-border);
}
.nvc-sheet__head .nvc-title { margin: 0; font-size: 18px; }
.nvc-x {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--nvc-border);
    border-radius: 12px;
    background: transparent;
    color: var(--nvc-fg);
    cursor: pointer;
}
.nvc-x:hover { background: var(--nvc-surface); }
.nvc-sheet__scroll {
    overflow-y: auto;
    padding: 14px 22px 6px;
    overscroll-behavior: contain;
}
.nvc-cats { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.nvc-cat {
    padding: 14px 16px;
    background: var(--nvc-surface);
    border: 1px solid var(--nvc-border);
    border-radius: 14px;
}
.nvc-cat__head { display: flex; align-items: center; gap: 10px; }
.nvc-cat__name { flex: 1 1 auto; font-size: 15px; font-weight: 700; color: var(--nvc-fg); cursor: pointer; }
.nvc-always {
    font-size: 11.5px;
    font-weight: 700;
    color: #15803d;
    background: rgba(22, 163, 74, .12);
    border-radius: 999px;
    padding: 3px 9px;
    white-space: nowrap;
}
html.dark .nvc-always { color: #4ade80; }
.nvc-cat__desc { margin: 6px 0 0; font-size: 13px; line-height: 1.55; color: var(--nvc-muted); }

/* switch: a real checkbox, visually a toggle */
.nvc-switch { position: relative; flex: 0 0 auto; width: 46px; height: 26px; }
.nvc-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}
.nvc-switch__track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--nvc-track);
    transition: background-color .15s ease;
}
.nvc-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transition: transform .15s ease;
}
.nvc-switch input:checked + .nvc-switch__track { background: var(--nvc-btn); }
.nvc-switch input:checked + .nvc-switch__track::after { transform: translateX(20px); }
.nvc-switch input:focus-visible + .nvc-switch__track { outline: 3px solid #f59e0b; outline-offset: 2px; }
.nvc-switch.is-locked input { cursor: not-allowed; }
.nvc-switch.is-locked .nvc-switch__track { opacity: .55; }

.nvc-actions--sheet {
    width: auto;
    padding: 14px 22px 18px;
    border-top: 1px solid var(--nvc-border);
}

/* ---------- embed placeholder (e.g. Google Maps) ---------- */
.nvc-embed {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    min-height: 260px;
    padding: 24px;
    text-align: center;
    background: var(--nvc-surface);
    color: var(--nvc-muted);
    border: 1px dashed var(--nvc-border);
    border-radius: inherit;
}
.nvc-embed p { margin: 0; max-width: 460px; font-size: 14px; line-height: 1.6; }

/* ---------- toast ---------- */
.nvc-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: calc(var(--nvc-z) + 2);
    transform: translate(-50%, 20px);
    padding: 10px 16px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
html.dark .nvc-toast { background: #f1f5f9; color: #0f172a; }
.nvc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* transform-only: if animations are paused (background tab), the banner is still fully visible */
@keyframes nvcUp { from { transform: translateY(16px); } to { transform: none; } }
@keyframes nvcIn { from { transform: scale(.97); } to { transform: none; } }

/* ---------- narrow screens ---------- */
@media (max-width: 899px) {
    .nvc-banner { flex-direction: column; align-items: stretch; gap: 14px; }
    .nvc-actions { width: 100%; }
}
@media (max-width: 560px) {
    .nvc-banner {
        left: 8px;
        right: 8px;
        bottom: 8px;
        padding: 16px;
        border-radius: 16px;
        max-height: calc(100vh - 16px);
        overflow-y: auto;
    }
    .nvc-title { font-size: 15px; }
    .nvc-text { font-size: 13px; }
    .nvc-actions { grid-template-columns: 1fr; gap: 8px; }
    .nvc-modal { padding: 0; align-items: flex-end; }
    .nvc-sheet { max-width: none; max-height: 92vh; border-radius: 20px 20px 0 0; }
    .nvc-sheet__head { padding: 16px 16px 10px; }
    .nvc-sheet__scroll { padding: 12px 16px 4px; }
    .nvc-actions--sheet { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    .nvc-banner, .nvc-sheet { animation: none; }
    .nvc-toast, .nvc-btn, .nvc-switch__track, .nvc-switch__track::after { transition: none; }
}

/* Nova chat: one-line AI / privacy note under the input (rendered by bot.js). */
#novasoft-ai .nai-legal {
    margin: 8px 2px 0;
    font-size: 11px;
    line-height: 1.45;
    color: var(--nai-muted, #64748b);
    text-align: center;
}
#novasoft-ai .nai-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.nvc-sheet:focus { outline: none; }

/* keep the footer "Cookie settings" link clear of the floating Nova launcher on narrow screens */
@media (max-width: 899px) {
    footer:has([data-nv-consent-open]) { padding-bottom: 112px; }
}

/* while the banner is open, keep the page bottom (footer links) scrollable above it */
html.nvc-has-banner body { padding-bottom: calc(var(--nvc-banner-h, 0px) + 32px); }

/* contact-page map: a fixed height once it is allowed to load (audit 28) */
.contact-map-frame iframe[data-nv-consent] { display: block; width: 100%; height: 440px; }
@media (max-width: 640px) { .contact-map-frame iframe[data-nv-consent] { height: 320px; } }
