/* Cookie consent banner + "Manage cookies" dialog (cookie-consent.js). Builds on styles.css colours. */

/* ---------- Banner ---------- */
.cc-banner {
  position: fixed;
  z-index: 60;
  left: 16px;
  bottom: 16px;
  width: min(420px, calc(100vw - 24px));
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 24px 60px rgba(20, 70, 150, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: var(--navy);
  font-family: inherit;
  overflow: hidden;
  animation: cc-up .4s ease-out;
}
.cc-banner.cc-leaving { animation: cc-down .3s ease-in forwards; }
@keyframes cc-up { from { opacity: 0; transform: translateY(100px); } }
@keyframes cc-down { to { opacity: 0; transform: translateY(100px); } }

.cc-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 10px; }
.cc-icon {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(31, 111, 224, 0.12);
  color: var(--accent);
}
.cc-icon svg { width: 20px; height: 20px; }
.cc-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.cc-text { padding: 0 22px 16px; }
.cc-text p { font-size: 14px; line-height: 1.55; color: var(--navy-soft); margin-bottom: 10px; }
.cc-link { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 700; color: var(--accent); }
.cc-link svg { width: 14px; height: 14px; transition: transform .15s ease; }
.cc-link:hover svg { transform: translateX(2px); }
.cc-actions {
  display: flex; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(11, 31, 75, 0.08);
  background: rgba(255, 255, 255, 0.45);
}

/* buttons, in the site's pill style */
.cc-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 0;
  font: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.cc-btn:hover { transform: translateY(-1px); }
.cc-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(31, 111, 224, 0.25); }
.cc-primary { background: var(--navy); color: #fff; box-shadow: 0 8px 20px rgba(11, 31, 75, 0.25); }
.cc-primary:hover { box-shadow: 0 12px 26px rgba(11, 31, 75, 0.32); }
.cc-outline { background: #fff; color: var(--navy); border: 1px solid rgba(11, 31, 75, 0.16); }
.cc-outline:hover { background: var(--sky-low); }

/* ---------- Dialog ---------- */
.cc-dialog {
  width: min(500px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 30px 70px rgba(11, 31, 75, 0.3);
  color: var(--navy);
  font-family: inherit;
  overflow: hidden;
}
.cc-dialog[open] { display: flex; flex-direction: column; animation: cc-pop .3s cubic-bezier(.2, .9, .3, 1.2); }
.cc-dialog::backdrop { background: rgba(11, 31, 75, 0.28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes cc-pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }

.cc-dhead { position: relative; padding: 22px 24px 16px; border-bottom: 1px solid rgba(11, 31, 75, 0.08); }
.cc-dhead h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.cc-dhead p { margin-top: 4px; font-size: 14px; color: var(--navy-soft); }
.cc-close {
  position: absolute; top: 16px; right: 16px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 11px;
  background: rgba(11, 31, 75, 0.06);
  color: var(--navy-soft);
  cursor: pointer;
}
.cc-close svg { width: 17px; height: 17px; }

.cc-list { list-style: none; display: grid; gap: 12px; padding: 20px 24px; overflow-y: auto; }
.cc-cat {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(11, 31, 75, 0.1);
  background: rgba(255, 255, 255, 0.7);
  transition: border-color .2s ease, background .2s ease;
  animation: cc-in .25s ease both;
}
.cc-cat.on { border-color: rgba(31, 111, 224, 0.35); background: rgba(31, 111, 224, 0.05); }
@keyframes cc-in { from { opacity: 0; transform: translateY(10px); } }
.cc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cc-name { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; cursor: pointer; }
.cc-cat-icon {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(11, 31, 75, 0.06);
  color: var(--navy-soft);
  transition: background .2s ease, color .2s ease;
}
.cc-cat.on .cc-cat-icon { background: rgba(31, 111, 224, 0.12); color: var(--accent); }
.cc-cat-icon svg { width: 17px; height: 17px; }
.cc-required {
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(31, 111, 224, 0.12); color: var(--accent);
}
.cc-cat p { margin-top: 10px; font-size: 13.5px; line-height: 1.5; color: var(--navy-soft); }

/* switch, same as the dashboard's Listed toggle */
.cc-switch {
  position: relative;
  width: 46px; height: 28px; flex: none;
  border: 0; border-radius: 999px;
  background: rgba(11, 31, 75, 0.2);
  cursor: pointer;
  transition: background .2s ease;
}
.cc-switch i {
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(11, 31, 75, .25);
  transition: transform .2s ease;
}
.cc-switch[aria-checked="true"] { background: var(--accent); }
.cc-switch[aria-checked="true"] i { transform: translateX(18px); }
.cc-switch:disabled { cursor: not-allowed; opacity: .6; }
.cc-switch:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(31, 111, 224, 0.25); }

.cc-dfoot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid rgba(11, 31, 75, 0.08);
  background: rgba(255, 255, 255, 0.45);
}
.cc-dfoot .cc-btn { flex: 0 0 auto; min-width: 130px; }

@media (max-width: 520px) {
  .cc-banner { left: 12px; bottom: 12px; }
  .cc-actions, .cc-dfoot { flex-direction: column-reverse; }
  .cc-dfoot .cc-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .cc-banner, .cc-banner.cc-leaving, .cc-dialog[open], .cc-cat { animation: none; }
}
