/* static/css/components/cookie-consent.css
   Consent banner + settings modal. Deliberately plain and quiet: the banner
   sits on every page of the site including the quiz, so it borrows the
   palette and nothing else. */

#cc-root {
  --cc-ink: #1b2740;
  --cc-body: #4c5872;
  --cc-muted: #7a879f;
  --cc-primary: #274285;
  --cc-line: #e6ebf6;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
}
#cc-root[hidden] { display: none; }

/* ── Banner ───────────────────────────────────────────────── */
.cc-banner {
  position: fixed; z-index: 9998;
  left: 50%; bottom: 24px; transform: translateX(-50%) translateY(12px);
  width: min(440px, calc(100vw - 32px));
  background: #fff; border-radius: 14px;
  border: 1px solid var(--cc-line);
  box-shadow: 0 18px 48px rgba(21, 33, 59, .18);
  padding: 26px 28px 22px;
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.cc-banner.is-open { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

.cc-text {
  margin: 0; font-size: 13.5px; line-height: 1.62;
  color: var(--cc-ink); font-weight: 500;
}

.cc-x {
  position: absolute; top: 12px; right: 14px;
  width: 28px; height: 28px; border: 0; background: none;
  font-size: 20px; line-height: 1; color: var(--cc-muted);
  cursor: pointer; border-radius: 8px;
}
.cc-x:hover { background: #f2f5fb; color: var(--cc-ink); }

.cc-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }

.cc-btn {
  flex: 1 1 auto; min-width: 120px;
  height: 42px; padding: 0 18px;
  border-radius: 10px; border: 1px solid var(--cc-line);
  background: #fff; color: var(--cc-ink);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
.cc-btn:hover { background: #f2f5fb; }
/* Same height, same width, same radius as Reject. The only difference is
   fill, which is as far as emphasis may go when reject must be as easy as
   accept. */
.cc-primary { background: var(--cc-primary); border-color: var(--cc-primary); color: #fff; }
.cc-primary:hover { background: #2f4c97; }

.cc-link {
  flex: 0 0 auto; border: 0; background: none; padding: 0;
  font-size: 13px; font-weight: 600; color: var(--cc-ink);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.cc-link:hover { color: var(--cc-primary); }
/* In notice mode the settings link is the only control, so it gets the row. */
.cc-banner[data-x] .cc-link { flex: 1 1 auto; text-align: left; }

/* ── Settings modal ───────────────────────────────────────── */
.cc-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(16, 24, 42, .45);
  display: grid; place-items: center; padding: 20px;
  overflow-y: auto;
}
.cc-modal[hidden] { display: none; }

.cc-modal-card {
  width: min(560px, 100%); max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: 16px;
  box-shadow: 0 24px 64px rgba(16, 24, 42, .3);
  overflow: hidden;
}

.cc-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 16px; border-bottom: 1px solid var(--cc-line);
  position: relative;
}
.cc-modal-head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--cc-ink); }
.cc-modal-head .cc-x { position: static; }

.cc-modal-body { padding: 20px 24px; overflow-y: auto; }
.cc-modal-intro { margin: 0 0 18px; font-size: 13px; line-height: 1.6; color: var(--cc-muted); }

.cc-cat { padding: 16px 0; border-bottom: 1px solid #f0f4fb; }
.cc-cat:last-child { border-bottom: 0; }
.cc-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cc-cat h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--cc-ink); }
.cc-cat p { margin: 7px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--cc-body); max-width: 62ch; }
.cc-always { font-size: 11px; font-weight: 600; color: var(--cc-muted); background: #f2f5fb; border-radius: 999px; padding: 4px 10px; }

/* Toggle */
.cc-switch { position: relative; display: inline-block; width: 44px; height: 25px; flex: none; }
.cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.cc-slider { position: absolute; inset: 0; background: #cfd7e6; border-radius: 999px; transition: background .18s ease; }
.cc-slider::before {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 19px; height: 19px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .18s ease;
}
.cc-switch input:checked + .cc-slider { background: var(--cc-primary); }
.cc-switch input:checked + .cc-slider::before { transform: translateX(19px); }
.cc-switch input:focus-visible + .cc-slider { outline: 2px solid var(--cc-primary); outline-offset: 2px; }

.cc-modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 24px; border-top: 1px solid var(--cc-line); background: #fbfcff;
}
.cc-policy { font-size: 12.5px; color: var(--cc-muted); text-decoration: underline; text-underline-offset: 3px; }
.cc-policy:hover { color: var(--cc-primary); }
.cc-modal-actions { display: flex; gap: 10px; }
.cc-modal-actions .cc-btn { flex: 0 0 auto; min-width: 108px; }

body.cc-locked { overflow: hidden; }

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 520px) {
  .cc-banner { left: 12px; right: 12px; bottom: 12px; width: auto; transform: translateY(12px); padding: 22px 20px 18px; }
  .cc-banner.is-open { transform: translateY(0); }
  .cc-actions { flex-direction: column; align-items: stretch; }
  .cc-btn { width: 100%; }
  .cc-link { text-align: center; padding-top: 4px; }
  .cc-modal-foot { flex-direction: column; align-items: stretch; }
  .cc-modal-actions { width: 100%; }
  .cc-modal-actions .cc-btn { flex: 1 1 auto; }
}
