/* CP Cookie Banner — preferences modal.
   Structural; colour tokens come from theme-*.css. */

.cppb-modal {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(8, 16, 8, 0.62);
    box-sizing: border-box;
}

.cppb-modal.is-open {
    display: flex;
}

.cppb-modal *,
.cppb-modal *::before,
.cppb-modal *::after {
    box-sizing: border-box;
}

.cppb-modal__dialog {
    background: var(--cppb-bg, #fff);
    color: var(--cppb-text-dark, #131413);
    width: min(620px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border-radius: 16px;
    box-shadow: 0 28px 64px rgba(0, 0, 0, 0.32);
    padding: 28px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.55;
}

.cppb-modal__dialog:focus {
    outline: none;
}

.cppb-modal__title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 800;
    color: var(--cppb-text-dark, #131413);
}

.cppb-modal__intro {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--cppb-text-muted, #5C605C);
}

.cppb-modal__intro a {
    color: var(--cppb-focus, #30B230);
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-left: 4px;
}

.cppb-modal__groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cppb-modal__group {
    border: 1px solid var(--cppb-border, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    padding: 14px 16px;
}

.cppb-modal__group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cppb-modal__group-name {
    font-weight: 700;
    color: var(--cppb-text-dark, #131413);
    font-size: 14px;
}

.cppb-modal__group-desc {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--cppb-text-muted, #5C605C);
}

.cppb-modal__group-locked {
    font-size: 12px;
    font-weight: 600;
    color: var(--cppb-focus, #30B230);
    background: var(--cppb-bg-soft, #F8F9F8);
    padding: 4px 10px;
    border-radius: 999px;
}

/* ---------- Toggle switch ----------------------------------------------- */
.cppb-toggle {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
}

.cppb-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.cppb-toggle__track {
    position: absolute;
    inset: 0;
    background: #CDD0CD;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.cppb-toggle__track::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.18s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.cppb-toggle input:checked + .cppb-toggle__track {
    background: var(--cppb-focus, #30B230);
}

.cppb-toggle input:checked + .cppb-toggle__track::before {
    transform: translateX(16px);
}

.cppb-toggle input:focus-visible + .cppb-toggle__track {
    box-shadow: 0 0 0 3px rgba(48, 178, 48, 0.35);
}

/* ---------- Actions row ------------------------------------------------- */
.cppb-modal__actions {
    display: flex;
    gap: 14px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 22px;
    flex-wrap: wrap;
}

@media (max-width: 560px) {
    .cppb-modal {
        padding: 12px;
    }

    .cppb-modal__dialog {
        padding: 22px;
    }
}
