  /* Comvest CIPA Consent Manager — front-end UI
   Neutral, accessible styling. Adjust brand colors via the variables below. */

#cipa-root {
    --cipa-bg: #ffffff;
    --cipa-fg: #1a1a1a;
    --cipa-muted: #5a6472;
    --cipa-border: #e2e6ea;
    --cipa-primary: #0a3b5c;      /* Comvest deep blue — adjust to brand */
    --cipa-primary-fg: #ffffff;
    --cipa-secondary-bg: #f2f4f6;
    --cipa-secondary-fg: #1a1a1a;
    --cipa-radius: 8px;
    --cipa-shadow: 0 6px 30px rgba(0, 0, 0, .18);
    font-family: 'Open Sans', Helvetica, Arial, sans-serif;
    /* Base 16px so 1rem = 16px; no front-end text drops below the 15px min. */
    font-size: 16px;
    line-height: 1.5;
}

#cipa-root[hidden] { display: none; }

/* ---------------------- blocking gate (pre-consent) --------------------- */
/* Full-page backdrop shown behind the banner until a choice is made. It
   blocks clicks/scroll on the site so consent must be given first. */
.cipa-gate {
    position: fixed;
    inset: 0;
    z-index: 2147482999; /* just under the banner */
    background: rgba(15, 23, 32, .55);
    animation: cipa-fade .25s ease;
}
.cipa-gate[hidden] { display: none; }

@keyframes cipa-fade { from { opacity: 0; } to { opacity: 1; } }

/* While the gate is up, lock page scroll. */
body.cipa-gate-open { overflow: hidden; }

/* -------------------------------- banner -------------------------------- */
.cipa-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 2147483000;
    background: var(--cipa-bg);
    color: var(--cipa-fg);
    border-top: 1px solid var(--cipa-border);
    box-shadow: var(--cipa-shadow);
    padding: 20px clamp(16px, 4vw, 40px);
    animation: cipa-slide-up .3s ease;
}
.cipa-banner[hidden] { display: none; }

@keyframes cipa-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.cipa-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.cipa-banner__copy { flex: 1 1 420px; min-width: 260px; }
.cipa-banner__title { margin: 0 0 6px; font-size: 1.5rem; font-weight: 700; line-height: 1.25; }
.cipa-banner__copy p { margin: 0; color: var(--cipa-muted); font-size: 15px; }
.cipa-banner__copy a { color: var(--cipa-primary); text-decoration: underline; }
.cipa-banner__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* -------------------------------- buttons ------------------------------- */
.cipa-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: var(--cipa-radius);
    padding: 11px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    transition: background .15s ease, opacity .15s ease;
    white-space: nowrap;
}
.cipa-btn:focus-visible { outline: 3px solid rgba(10, 59, 92, .4); outline-offset: 2px; }
.cipa-btn--primary { background: var(--cipa-primary); color: var(--cipa-primary-fg); }
.cipa-btn--primary:hover { opacity: .9; }
.cipa-btn--secondary {
    background: var(--cipa-secondary-bg);
    color: var(--cipa-secondary-fg);
    border-color: var(--cipa-border);
}
.cipa-btn--secondary:hover { background: #e7ebef; }

/* -------------------------------- modal --------------------------------- */
.cipa-modal { position: fixed; inset: 0; z-index: 2147483001; }
.cipa-modal[hidden] { display: none; }
.cipa-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.cipa-modal__dialog {
    position: relative;
    background: var(--cipa-bg);
    color: var(--cipa-fg);
    font-size: 16px;
    line-height: 1.55;
    max-width: 620px;
    width: calc(100% - 32px);
    margin: 5vh auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: var(--cipa-radius);
    box-shadow: var(--cipa-shadow);
    overflow: hidden;
}
.cipa-modal__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; border-bottom: 1px solid var(--cipa-border);
}
.cipa-modal__heading { display: flex; flex-direction: column; gap: 2px; }
.cipa-modal__head h2 { margin: 0; font-size: 1.5rem; font-weight: 700; line-height: 1.25; }
.cipa-modal__policy { font-size: 15px; color: var(--cipa-primary); text-decoration: underline; }
.cipa-modal__policy:hover { opacity: .85; }
.cipa-modal__close {
    background: none; border: none; font-size: 1.7rem; line-height: 1;
    cursor: pointer; color: var(--cipa-muted); padding: 0 4px;
}
.cipa-modal__body { padding: 8px 22px; overflow-y: auto; }
.cipa-modal__foot {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 16px 22px; border-top: 1px solid var(--cipa-border);
    flex-wrap: wrap;
}

/* ------------------------------ categories ------------------------------ */
.cipa-cat { padding: 16px 0; border-bottom: 1px solid var(--cipa-border); }
.cipa-cat:last-child { border-bottom: none; }
.cipa-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cipa-cat__label { font-weight: 700; font-size: 16px; }
.cipa-cat__always { color: var(--cipa-primary); font-weight: 600; font-size: 15px; }
.cipa-cat__desc { margin: 8px 0 0; color: var(--cipa-muted); font-size: 16px; }

/* toggle switch */
.cipa-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.cipa-switch input { opacity: 0; width: 0; height: 0; }
.cipa-switch__slider {
    position: absolute; inset: 0; cursor: pointer;
    background: #c3cad2; border-radius: 26px; transition: background .2s ease;
}
.cipa-switch__slider::before {
    content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: transform .2s ease;
}
.cipa-switch input:checked + .cipa-switch__slider { background: var(--cipa-primary); }
.cipa-switch input:checked + .cipa-switch__slider::before { transform: translateX(20px); }
.cipa-switch input:focus-visible + .cipa-switch__slider { outline: 3px solid rgba(10, 59, 92, .4); outline-offset: 2px; }

body.cipa-modal-open { overflow: hidden; }

/* ------------------------------ reopen tab ------------------------------ */
.cipa-reopen {
    position: fixed; left: 18px; bottom: 18px; z-index: 2147482000;
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--cipa-primary, #0a3b5c); color: #fff;
    border: none; cursor: pointer; box-shadow: 0 3px 14px rgba(0,0,0,.25);
    display: flex; align-items: center; justify-content: center;
}
.cipa-reopen[hidden] { display: none; }
.cipa-reopen:hover { opacity: .9; }
.cipa-reopen:focus-visible { outline: 3px solid rgba(10, 59, 92, .5); outline-offset: 2px; }

/* ------------------------------- embeds --------------------------------- */
.cipa-embed__placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; text-align: center;
    min-height: 220px; padding: 28px 20px;
    background: #f2f4f6; border: 1px dashed #c3cad2; border-radius: var(--cipa-radius);
    color: #5a6472;
}
.cipa-embed__note { margin: 0; max-width: 40ch; font-size: 15px; }
.cipa-embed__host { margin: 0; font-size: 15px; opacity: .8; word-break: break-all; }
.cipa-embed--loaded iframe { max-width: 100%; }

/* ------------------------------ responsive ------------------------------ */
@media (max-width: 640px) {
    .cipa-banner__actions { width: 100%; }
    .cipa-banner__actions .cipa-btn { flex: 1 1 auto; }
}
