/* =========================================================================
   TLC Staffbase — Cookie consent (banner + preferences modal)
   Ported from the TLC-2026 public site so Staffnet matches the brand.

   Self-contained: all brand tokens are declared locally on #cc-root so the
   widget renders correctly on every page regardless of which stylesheet a
   given head_*.php happens to load.
   ========================================================================= */
#cc-root,
.cc-embed-blocked {
  --navy:        #005695;
  --navy-deep:   #0a3050;
  --green:       #74bc4a;
  --green-deep:  #5fa238;
  --green-dark:  #5fa238;
  --teal:        #1D6F73;
  --text:        #1f2a37;
  --text-muted:  #5a6776;
  --line:        #e3e8ee;
  --bg:          #f4f6f8;
  --white:       #ffffff;
  --radius-md:   18px;
  --radius-lg:   28px;
  --radius-pill: 999px;
  --font-sans:   'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cc-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Banner ---- */
.cc-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, calc(100% + 40px));
  width: min(1100px, calc(100% - 32px));
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 50px rgba(10, 48, 80, 0.22);
  z-index: 9000;
  opacity: 0;
  visibility: hidden;
  transition: transform .4s cubic-bezier(.16,1,.3,1), opacity .3s ease, visibility .3s;
  font-family: var(--font-sans);
}
.cc-banner.is-open { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.cc-banner__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 22px 26px;
}
.cc-banner__title { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.cc-banner__text p { font-size: .9rem; line-height: 1.55; color: var(--text-muted); margin: 0; }
.cc-banner__text a { color: var(--green-dark); font-weight: 600; text-decoration: underline; }
.cc-banner__text a:hover { color: var(--navy); }
.cc-banner__actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  align-items: center;
}

/* ---- Shared buttons (Accept / Reject equal prominence) ---- */
.cc-btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: .88rem;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
  border: 2px solid transparent;
  cursor: pointer;
}
.cc-btn:hover { transform: translateY(-1px); }
.cc-btn:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.cc-btn--solid { background: var(--green); color: var(--white); }
.cc-btn--solid:hover { background: var(--green-deep); }
.cc-btn--ghost { background: var(--white); color: var(--navy); border-color: var(--navy); }
.cc-btn--ghost:hover { background: var(--navy); color: var(--white); }

/* ---- Overlay + modal ---- */
.cc-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 48, 80, 0.5);
  z-index: 9100;
  opacity: 0;
  transition: opacity .25s ease;
}
.cc-overlay.is-open { opacity: 1; }
/* When closed the [hidden] attr must win over the author display rules below,
   otherwise the invisible full-screen modal keeps intercepting clicks. */
.cc-modal[hidden], .cc-overlay[hidden] { display: none; }
.cc-modal {
  position: fixed; inset: 0;
  z-index: 9200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .25s ease;
  font-family: var(--font-sans);
}
.cc-modal.is-open { opacity: 1; }
.cc-modal__panel {
  background: var(--white);
  width: min(620px, 100%);
  max-height: min(85vh, 760px);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(10, 48, 80, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(14px) scale(.98);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.cc-modal.is-open .cc-modal__panel { transform: none; }
.cc-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
}
.cc-modal__head h2 { font-size: 1.3rem; color: var(--navy); }
.cc-modal__close {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  color: var(--navy);
  cursor: pointer;
  transition: background .2s ease;
}
.cc-modal__close:hover { background: var(--bg); }
.cc-modal__body { padding: 22px 26px; overflow-y: auto; overflow-x: hidden; }
.cc-modal__body > p { font-size: .92rem; color: var(--text-muted); margin-bottom: 20px; }
.cc-modal__body > p a { color: var(--green-dark); font-weight: 600; text-decoration: underline; }
.cc-modal__foot {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end;
  padding: 18px 26px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

/* ---- Category rows ---- */
.cc-cat { padding: 16px 0; border-top: 1px solid var(--line); }
.cc-cat:first-of-type { border-top: 0; }
.cc-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cc-cat__title { font-size: 1rem; font-weight: 700; color: var(--navy-deep); }
.cc-cat__desc { font-size: .86rem; color: var(--text-muted); margin-top: 6px; }
.cc-cat__always { font-size: .8rem; font-weight: 600; color: var(--green-dark); flex-shrink: 0; }

/* ---- Toggle switch ---- */
.cc-toggle { position: relative; display: inline-flex; align-items: center; flex-shrink: 0; cursor: pointer; }
.cc-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.cc-toggle > span[aria-hidden],
.cc-toggle--locked > span {
  width: 46px; height: 26px; border-radius: var(--radius-pill);
  background: #c7d0da; position: relative; transition: background .2s ease; display: block;
}
.cc-toggle > span[aria-hidden]::after,
.cc-toggle--locked > span::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--white); box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .2s ease;
}
.cc-toggle input:checked + span { background: var(--green); }
.cc-toggle input:checked + span::after { transform: translateX(20px); }
.cc-toggle input:focus-visible + span { outline: 3px solid var(--green); outline-offset: 2px; }
.cc-toggle--locked > span { background: var(--green); opacity: .55; cursor: not-allowed; }
.cc-toggle--locked > span::after { transform: translateX(20px); }

/* ---- Gated embed placeholder ---- */
.cc-embed-blocked {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center;
  width: 100%; min-height: 320px; height: 100%;
  padding: 32px;
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-sans);
}
.cc-embed-blocked p { font-size: .95rem; max-width: 420px; }

/* ---- Floating "Cookie settings" button (bottom-left) ---- */
.cc-fab {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 8900;          /* below banner (9000) / overlay (9100) / modal (9200) */
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  display: grid;
  place-items: center;
  border: 0;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(10, 48, 80, 0.28);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.cc-fab[hidden] { display: none; }
.cc-fab svg { width: 28px; height: 28px; display: block; }
.cc-fab:hover {
  background: var(--green-deep);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(10, 48, 80, 0.35);
}
.cc-fab:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }

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

@media (max-width: 860px) {
  .cc-banner__inner { flex-direction: column; align-items: stretch; gap: 16px; padding: 20px; }
  .cc-banner__actions { flex-wrap: wrap; }
  .cc-banner__actions .cc-btn { flex: 1 1 auto; text-align: center; }
  .cc-modal__foot { justify-content: stretch; }
  .cc-modal__foot .cc-btn { flex: 1 1 auto; }
}
