/* Cookie banner + preferences dialog. Loaded by both the marketing and app bases, so it is self-contained: its own
   colours and sizes, nothing from Tailwind or the app's globals.css. A light card, so it stands apart from the dark
   site. */
.ck,
.ck-dialog {
  --ck-ink: #18181b;
  --ck-muted: #52525b;
  --ck-line: #e4e4e7;
  --ck-link: #c41800;
  --ck-accent: #d01a00;
  box-sizing: border-box;
  color: var(--ck-ink);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}

.ck *,
.ck-dialog * {
  box-sizing: border-box;
}

.ck[hidden],
.ck-dialog [hidden] {
  display: none !important;
}

/* ── Banner ── */
.ck {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 60;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 28px 30px 26px;
  transform: translateX(-50%);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  font-size: 15px;
  line-height: 1.65;
}

.ck-text {
  margin: 0;
  padding-right: 28px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ck-ink);
}

.ck a,
.ck-dialog a {
  color: var(--ck-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ck-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ck-ink);
  cursor: pointer;
}

.ck-close:hover {
  background: #f4f4f5;
}

.ck-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
}

.ck-link {
  padding: 4px 0;
  border: 0;
  border-bottom: 1.5px solid currentColor;
  background: transparent;
  color: var(--ck-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.ck-buttons {
  display: flex;
  gap: 10px;
}

.ck-btn {
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.ck-btn--outline {
  border-color: #c4c4c8;
  background: #fff;
  color: var(--ck-ink);
}

.ck-btn--outline:hover {
  border-color: var(--ck-ink);
}

.ck-btn--dark {
  background: var(--ck-ink);
  color: #fff;
}

.ck-btn--dark:hover {
  background: #3f3f46;
}

.ck-btn--light {
  background: #f4f4f5;
  color: var(--ck-ink);
}

.ck-btn--light:hover {
  background: #e4e4e7;
}

.ck-btn:focus-visible,
.ck-link:focus-visible,
.ck-close:focus-visible,
.ck-expand:focus-visible,
.ck-switch:focus-visible,
.ck a:focus-visible,
.ck-dialog a:focus-visible {
  outline: 2px solid var(--ck-accent);
  outline-offset: 2px;
}

/* ── Preferences dialog ── */
.ck-dialog {
  /* Tailwind's reset zeroes every margin, which drops the browser's centring of a modal <dialog>. */
  inset: 0;
  margin: auto;
  height: fit-content; /* the app's dialog reset sets height: auto, which with inset: 0 fills the screen */
  width: min(740px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.ck-dialog[open] {
  display: flex;
  flex-direction: column;
}

.ck-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.ck-dialog-body {
  position: relative;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 34px 30px 24px;
}

/* Both bases style h2/h3 with their display fonts; the dialog keeps the plain body font. */
.ck-dialog-title,
.ck-section-title {
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.ck-dialog-title {
  margin: 0 0 18px;
  padding-right: 40px;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ck-ink);
}

.ck-section-title {
  margin: 30px 0 14px;
  font-size: 21px;
  font-weight: 600;
  color: var(--ck-ink);
}

.ck-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--ck-line);
  border-radius: 10px;
}

.ck-item + .ck-item {
  border-top: 1px solid var(--ck-line);
}

.ck-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 20px 6px 12px;
}

.ck-expand {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ck-ink);
  font: inherit;
  font-size: 17px;
  text-align: left;
  cursor: pointer;
}

.ck-chevron {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.ck-expand[aria-expanded="true"] .ck-chevron {
  transform: rotate(180deg);
}

.ck-item-desc {
  margin: 0;
  padding: 0 20px 16px 52px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ck-muted);
}

/* Toggle switch: a native checkbox (role="switch"), so keyboard and screen readers work unchanged. */
.ck-switch {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 26px;
  margin: 0;
  border-radius: 999px;
  background: #d4d4d8;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background 0.2s;
}

.ck-switch::before {
  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, 0.3);
  transition: transform 0.2s;
}

.ck-switch:checked {
  background: var(--ck-accent);
}

.ck-switch:checked::before {
  transform: translateX(20px);
}

.ck-switch:disabled {
  background: #b9b3ad;
  cursor: not-allowed;
}

.ck-dialog-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 30px;
  border-top: 1px solid var(--ck-line);
  background: #fff;
}

@media (max-width: 640px) {
  .ck {
    padding: 22px 18px 18px;
  }

  .ck-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .ck-link {
    align-self: center;
  }

  .ck-buttons > .ck-btn {
    flex: 1;
  }

  .ck-dialog-body {
    padding: 28px 18px 20px;
  }

  .ck-dialog-title {
    font-size: 24px;
  }

  .ck-dialog-footer {
    padding: 14px 18px;
  }

  .ck-dialog-footer > .ck-btn {
    flex: 1 1 100%;
  }

  /* The banner spans the screen bottom, where the floating WhatsApp button sits. */
  .ck-open .wa-float {
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ck-chevron,
  .ck-switch,
  .ck-switch::before {
    transition: none;
  }
}

/* Buttons that only work with JS (the policy page's "Open cookie settings"); footer links fall back to /cookies. */
.no-js button[data-cookie-settings] {
  display: none;
}
