/*
 * HeckerHub cookie consent banner + preferences dialog
 * (markup: includes/privacy_consent.php, behaviour: assets/js/cookie-consent.js).
 * Self-contained so it renders the same on the public pages, the sign-in
 * screens and inside the themed app shell.
 */
.hhcc {
    --hhcc-brand: #2f855a; --hhcc-brand-dark: #276749; --hhcc-ink: #152118; --hhcc-body: #44544a;
    --hhcc-muted: #6b776e; --hhcc-line: #dfe7dc; --hhcc-soft: #f4f8f4;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px; line-height: 1.55; color: var(--hhcc-body);
}
.hhcc *, .hhcc *::before, .hhcc *::after { box-sizing: border-box; }
.hhcc [hidden] { display: none !important; }
.hhcc a { color: var(--hhcc-brand); font-weight: 600; }
.hhcc h2 { margin: 0; color: var(--hhcc-ink); font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }

/* Banner */
.hhcc-banner {
    position: fixed; z-index: 10000; left: 16px; right: 16px; bottom: 16px;
    max-width: 1100px; margin: 0 auto; padding: 20px 22px;
    background: #fff; border: 1px solid var(--hhcc-line); border-radius: 14px;
    box-shadow: 0 18px 50px rgba(21, 33, 24, .22);
}
.hhcc-banner form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 28px; align-items: center; margin: 0; }
.hhcc-text p { margin: 6px 0 0; font-size: .9rem; }
.hhcc-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* Buttons — Accept and Reject carry equal weight (no nudging, PRIV-CST-01 §8) */
.hhcc-btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 42px;
    padding: 9px 18px; border-radius: 8px; border: 1.5px solid var(--hhcc-brand);
    background: var(--hhcc-brand); color: #fff !important; font: inherit; font-size: .9rem; font-weight: 600;
    text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s ease, color .15s ease;
}
.hhcc-btn:hover { background: var(--hhcc-brand-dark); border-color: var(--hhcc-brand-dark); }
.hhcc-btn-outline { background: #fff; color: var(--hhcc-brand) !important; }
.hhcc-btn-outline:hover { background: var(--hhcc-soft); color: var(--hhcc-brand-dark) !important; }
.hhcc-btn:focus-visible, .hhcc-close:focus-visible, .hhcc-switch:focus-visible, .hhcc summary:focus-visible {
    outline: 3px solid rgba(47, 133, 90, .45); outline-offset: 2px;
}

/* Preferences dialog */
.hhcc-modal {
    position: fixed; z-index: 10001; inset: 0; display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(16, 24, 20, .55);
}
.hhcc-dialog {
    width: 100%; max-width: 640px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
    background: #fff; border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); overflow: hidden;
}
.hhcc-dialog form { display: flex; flex-direction: column; max-height: inherit; margin: 0; }
.hhcc-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--hhcc-line); }
.hhcc-close {
    width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--hhcc-muted);
    font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.hhcc-close:hover { background: var(--hhcc-soft); color: var(--hhcc-ink); }
.hhcc-dialog-body { padding: 18px 22px; overflow-y: auto; }
.hhcc-intro { margin: 0 0 14px; font-size: .9rem; }
.hhcc-dialog-foot { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--hhcc-line); background: #fafcfa; }

/* Category rows (dialog and cookies.php) */
.hhcc-cat { border: 1px solid var(--hhcc-line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.hhcc-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hhcc-cat-head label { margin: 0; color: var(--hhcc-ink); font-size: .95rem; font-weight: 700; cursor: pointer; }
.hhcc-cat p { margin: 6px 0 0; font-size: .86rem; color: var(--hhcc-body); }
.hhcc-always { flex: 0 0 auto; font-size: .78rem; font-weight: 700; color: var(--hhcc-brand); background: #e8f5ee; border-radius: 999px; padding: 4px 10px; }
.hhcc-cat details { margin-top: 8px; font-size: .83rem; }
.hhcc-cat summary { cursor: pointer; color: var(--hhcc-brand); font-weight: 600; width: max-content; max-width: 100%; }
.hhcc-cat table { width: 100%; margin-top: 8px; border-collapse: collapse; }
.hhcc-cat th, .hhcc-cat td { text-align: left; vertical-align: top; padding: 7px 8px; border-top: 1px solid var(--hhcc-line); }
.hhcc-cat th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--hhcc-muted); }
.hhcc-cat code { font-size: .8rem; color: var(--hhcc-ink); background: var(--hhcc-soft); padding: 1px 5px; border-radius: 4px; white-space: nowrap; }

/* Toggle switch (off by default — no pre-ticked boxes) */
.hhcc-switch {
    -webkit-appearance: none; appearance: none; flex: 0 0 auto; position: relative; width: 46px; height: 26px; margin: 0;
    border-radius: 999px; background: #c9d3cc; cursor: pointer; transition: background .15s ease;
}
.hhcc-switch::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, .25); transition: transform .15s ease;
}
.hhcc-switch:checked { background: var(--hhcc-brand); }
.hhcc-switch:checked::after { transform: translateX(20px); }

body.hhcc-lock { overflow: hidden; }

/* Footer links (privacy_legal_links) — sit in each page's own footer, so they inherit its colour */
.hhcc-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: .82rem; }
.hhcc-legal a { color: inherit; text-decoration: none; font-weight: 500; }
.hhcc-legal a:hover { text-decoration: underline; }

@media (max-width: 760px) {
    .hhcc-banner { left: 10px; right: 10px; bottom: 10px; padding: 16px; max-height: calc(100vh - 20px); overflow-y: auto; }
    .hhcc-banner form { grid-template-columns: 1fr; gap: 14px; }
    .hhcc-actions { justify-content: stretch; }
    .hhcc-actions .hhcc-btn, .hhcc-dialog-foot .hhcc-btn { flex: 1 1 100%; }
    .hhcc-dialog-head, .hhcc-dialog-body, .hhcc-dialog-foot { padding-left: 16px; padding-right: 16px; }
    .hhcc-cat table, .hhcc-cat thead, .hhcc-cat tbody, .hhcc-cat tr, .hhcc-cat td { display: block; }
    .hhcc-cat thead { display: none; }
    .hhcc-cat tr { border-top: 1px solid var(--hhcc-line); padding: 6px 0; }
    .hhcc-cat td { border: 0; padding: 2px 0; }
}
@media (prefers-reduced-motion: reduce) {
    .hhcc-btn, .hhcc-switch, .hhcc-switch::after { transition: none; }
}
@media print { .hhcc { display: none !important; } }
