/* SynaptIQ Labs: cookie consent banner and preferences dialog.
   Uses the design tokens from the Base layout (:root in Base.css). */

.cc-banner,
.cc-modal {
  --cc-ease: var(--ease, cubic-bezier(.2, .7, .2, 1));
  font-family: var(--font);
  color: var(--body);
  -webkit-font-smoothing: antialiased;
}

.cc-banner[hidden],
.cc-modal[hidden] {
  display: none !important;
}

/* ---- Banner -------------------------------------------------------------- */
.cc-banner {
  position: fixed;
  z-index: 1000;
  left: var(--gutter);
  right: var(--gutter);
  bottom: var(--gutter);
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px 40px;
  align-items: end;
  padding: 24px 28px;
  background: var(--paper);
  border: 1px solid var(--line-2);
  box-shadow: 0 18px 48px -16px rgba(11, 14, 23, .28);
  animation: cc-rise .45s var(--cc-ease) both;
}

.cc-k {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.cc-title {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--ink);
}

.cc-desc {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
}

.cc-desc a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cc-desc a:hover {
  color: var(--accent);
}

.cc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 340px;
}

.cc-actions .cc-link {
  grid-column: 1 / -1;
}

/* Accept and reject share one style on purpose: EDPB guidance treats a
   visually weaker "reject" as a dark pattern. */
.cc-btn {
  min-height: 46px;
  padding: 0 18px;
  font: 600 12.5px/1 var(--font);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background .25s, border-color .25s;
}

.cc-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.cc-link,
.cc-footer-link {
  padding: 0;
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.cc-link {
  min-height: 36px;
  font-size: 14px;
  font-weight: 500;
}

.cc-link:hover,
.cc-footer-link:hover {
  color: var(--accent);
}

/* Footer trigger inherits the footer's link colour. */
.cc-footer-link {
  color: inherit;
  text-decoration: none;
}

.cc-btn:focus-visible,
.cc-link:focus-visible,
.cc-footer-link:focus-visible,
.cc-close:focus-visible,
.cc-switch input:focus-visible + .cc-switch__ui {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Dialog -------------------------------------------------------------- */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: rgba(11, 14, 23, .55);
  animation: cc-fade .25s ease both;
}

.cc-modal__panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 600px;
  max-height: calc(100dvh - 2 * var(--gutter));
  background: var(--paper);
  border: 1px solid var(--line-2);
  animation: cc-rise .4s var(--cc-ease) both;
}

.cc-modal__head {
  position: relative;
  padding: 24px 64px 16px 28px;
  border-bottom: 1px solid var(--line);
}

.cc-modal__head .cc-title {
  font-size: 22px;
  margin: 0;
}

.cc-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--ink);
  background: none;
  border: 1px solid var(--line);
  cursor: pointer;
}

.cc-close:hover {
  border-color: var(--ink);
}

.cc-modal__body {
  overflow-y: auto;
  padding: 20px 28px 8px;
}

.cc-row {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.cc-modal__body > .cc-desc {
  margin-bottom: 18px;
}

.cc-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cc-row__title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.cc-row__desc {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.cc-modal__foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 16px 28px 24px;
  border-top: 1px solid var(--line);
}

/* ---- Switch -------------------------------------------------------------- */
.cc-switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 24px;
}

.cc-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cc-switch input:disabled {
  cursor: not-allowed;
}

.cc-switch__ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--line-2);
  border-radius: 999px;
  transition: background .2s;
}

.cc-switch__ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(11, 14, 23, .25);
  transition: transform .25s var(--cc-ease);
}

.cc-switch input:checked + .cc-switch__ui {
  background: var(--accent);
}

.cc-switch input:checked + .cc-switch__ui::after {
  transform: translateX(20px);
}

.cc-switch input:disabled + .cc-switch__ui {
  opacity: .55;
}

/* ---- Cookie policy page -------------------------------------------------- */
/* Lets the legal grid column shrink so wide tables scroll inside their wrapper
   instead of pushing the whole page sideways on phones. */
.legal__body {
  min-width: 0;
}

.cc-btn--inline {
  margin-top: 4px;
}

.cc-table-wrap {
  margin: 14px 0 22px;
  overflow-x: auto;
  border: 1px solid var(--line);
}

.cc-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.5;
}

.cc-table th,
.cc-table td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.cc-table tbody tr:last-child td {
  border-bottom: 0;
}

.cc-table th {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--bg);
}

.cc-table code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
}

html.cc-modal-open {
  overflow: hidden;
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 860px) {
  .cc-banner {
    grid-template-columns: 1fr;
    padding: 20px;
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .cc-actions {
    min-width: 0;
  }

  .cc-desc {
    font-size: 14px;
  }
}

@media (max-width: 520px) {
  .cc-banner {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  .cc-modal__foot {
    grid-template-columns: 1fr;
  }

  .cc-modal__head,
  .cc-modal__body,
  .cc-modal__foot {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@keyframes cc-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes cc-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner,
  .cc-modal,
  .cc-modal__panel {
    animation: none;
  }

  .cc-switch__ui,
  .cc-switch__ui::after {
    transition: none;
  }
}
