/* Privacy consent popup.
   Self-contained and prefixed .consent-, so it renders the same on the landing
   page, the auth pages and inside the dashboard shell — three places with very
   different ambient styles. Direction comes from logical properties only, so
   RTL and LTR are the same source. */

.consent {
    position: fixed;
    inset-block-end: 0;
    inset-inline: 0;
    z-index: 2147483100;   /* above the chat launcher, which is 2147483000 */
    display: flex;
    justify-content: center;
    padding: 16px;
    pointer-events: none;  /* the page stays usable; this is not a modal */
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .22s ease, transform .22s ease;
}
.consent.is-open { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .consent { transition: none; transform: none; }
}

.consent-panel {
    pointer-events: auto;
    inline-size: min(560px, 100%);
    max-block-size: min(80vh, 720px);
    overflow-y: auto;
    background: var(--consent-surface, #fff);
    color: var(--consent-text, #16281f);
    border: 1px solid var(--consent-border, rgba(0, 0, 0, .09));
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .22);
    padding: 22px 24px 18px;
    text-align: start;
}

.consent-title {
    font-size: 17px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--consent-text, #16281f);
    line-height: 1.5;
}

.consent-desc {
    font-size: 13.5px;
    line-height: 1.85;
    margin: 0;
    color: var(--consent-muted, #5a6b62);
}

.consent-policy {
    display: inline-block;
    margin-block-start: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--consent-accent, #8A6D14);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ----- categories ----- */

.consent-cats {
    margin-block-start: 16px;
    border-block-start: 1px solid var(--consent-border, rgba(0, 0, 0, .09));
    padding-block-start: 6px;
}

.consent-cat { padding-block: 12px; }
.consent-cat + .consent-cat { border-block-start: 1px solid var(--consent-border, rgba(0, 0, 0, .06)); }

.consent-cat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.consent-cat-title { display: flex; align-items: center; gap: 6px; }

.consent-required {
    color: var(--consent-accent, #8A6D14);
    font-size: 18px;
    line-height: 1;
}

.consent-cat-desc {
    margin: 6px 0 0;
    /* Indent past the checkbox so the text lines up under the title, on
       whichever side the checkbox is. */
    padding-inline-start: 32px;
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--consent-muted, #5a6b62);
}

/* A real checkbox, visually hidden but still focusable and still announced. */
.consent-check {
    position: absolute;
    opacity: 0;
    inline-size: 22px;
    block-size: 22px;
    margin: 0;
    cursor: pointer;
}

.consent-box {
    inline-size: 22px;
    block-size: 22px;
    flex: 0 0 22px;
    border-radius: 7px;
    border: 2px solid var(--consent-border-strong, #c3ccc7);
    background: var(--consent-surface, #fff);
    position: relative;
    transition: background .18s ease, border-color .18s ease;
}

.consent-box::after {
    content: '';
    position: absolute;
    inset-inline-start: 6px;
    inset-block-start: 2px;
    inline-size: 6px;
    block-size: 11px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    /* The tick is a rotated corner, so it must not mirror in RTL — a checkmark
       is a symbol, not text. */
    transform: rotate(45deg) scale(0);
    transition: transform .18s ease;
}

.consent-check:checked + .consent-box {
    background: var(--consent-accent, #8A6D14);
    border-color: var(--consent-accent, #8A6D14);
}
.consent-check:checked + .consent-box::after { transform: rotate(45deg) scale(1); }

.consent-check:focus-visible + .consent-box {
    outline: 2px solid var(--consent-accent, #8A6D14);
    outline-offset: 2px;
}

.consent-check:disabled + .consent-box {
    opacity: .55;
    cursor: not-allowed;
}

/* ----- actions ----- */

.consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-block-start: 18px;
}

.consent-btn {
    flex: 1 1 auto;
    min-inline-size: 140px;
    padding: 11px 18px;
    border-radius: 11px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
}
.consent-btn:active { transform: translateY(1px); }

.consent-btn-primary {
    background: var(--consent-accent, #8A6D14);
    color: #fff;
}
.consent-btn-primary:hover,
.consent-btn-primary:focus-visible {
    background: var(--consent-accent-bright, #a5831c);
    color: #fff;   /* the global a:hover turns links gold; buttons must not follow */
}

.consent-btn-ghost {
    background: transparent;
    color: var(--consent-text, #16281f);
    border-color: var(--consent-border-strong, #c3ccc7);
}
.consent-btn-ghost:hover,
.consent-btn-ghost:focus-visible {
    background: var(--consent-hover, rgba(0, 0, 0, .04));
    color: var(--consent-text, #16281f);
}

/* ----- dark ----- */

html[data-theme="dark"] .consent-panel {
    --consent-surface: #12241c;
    --consent-text: #eaf1ed;
    --consent-muted: #9fb3a8;
    --consent-border: rgba(255, 255, 255, .10);
    --consent-border-strong: rgba(255, 255, 255, .24);
    --consent-accent: #C9A227;
    --consent-accent-bright: #d9b43c;
    --consent-hover: rgba(255, 255, 255, .06);
}
html[data-theme="dark"] .consent-box { background: transparent; }

@media (max-width: 560px) {
    .consent { padding: 10px; }
    .consent-panel { padding: 18px 16px 14px; border-radius: 14px; }
    .consent-btn { min-inline-size: 100%; }
}
