/* Tourtify cookie consent banner. Self-contained: everything is scoped to .tt-consent. */
.tt-consent {
  --ttc-bg: #ffffff;
  --ttc-fg: #14121f;
  --ttc-muted: #5b5870;
  --ttc-border: #e4e2ee;
  --ttc-brand: #5d47eb;
  --ttc-brand-hover: #4a35d6;
  --ttc-brand-fg: #ffffff;
  --ttc-soft: #f4f2ff;
  --ttc-shadow: 0 12px 40px rgba(20, 18, 31, 0.18), 0 2px 6px rgba(20, 18, 31, 0.08);
  --ttc-focus: 0 0 0 3px rgba(93, 71, 235, 0.45);

  position: fixed;
  z-index: 2147483000;
  inset: auto 16px 16px 16px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ttc-fg);
  -webkit-font-smoothing: antialiased;
}

.tt-consent[hidden] { display: none; }

@media (prefers-color-scheme: dark) {
  .tt-consent {
    --ttc-bg: #1b1a26;
    --ttc-fg: #f3f2f8;
    --ttc-muted: #b4b1c6;
    --ttc-border: #34324a;
    --ttc-brand: #8b7bf5;
    --ttc-brand-hover: #a194f7;
    --ttc-brand-fg: #14121f;
    --ttc-soft: #26243a;
    --ttc-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    --ttc-focus: 0 0 0 3px rgba(139, 123, 245, 0.55);
  }
}

.tt-consent *,
.tt-consent *::before,
.tt-consent *::after { box-sizing: border-box; }

.tt-consent__panel {
  pointer-events: auto;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px 22px;
  background: var(--ttc-bg);
  border: 1px solid var(--ttc-border);
  border-radius: 16px;
  box-shadow: var(--ttc-shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tt-consent.is-visible .tt-consent__panel { opacity: 1; transform: none; }
.tt-consent__panel:focus { outline: none; box-shadow: var(--ttc-shadow), var(--ttc-focus); }

.tt-consent__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--ttc-fg);
  letter-spacing: -0.01em;
}

.tt-consent__text { margin: 0; color: var(--ttc-muted); }

.tt-consent__link {
  color: var(--ttc-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.tt-consent__link:focus-visible { outline: none; box-shadow: var(--ttc-focus); border-radius: 4px; }

.tt-consent__settings {
  margin-top: 14px;
  border: 1px solid var(--ttc-border);
  border-radius: 12px;
  overflow: hidden;
}

.tt-consent__settings[hidden] { display: none; }

.tt-consent__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
}

.tt-consent__row + .tt-consent__row { border-top: 1px solid var(--ttc-border); }

.tt-consent__row-title { display: block; margin: 0; font-weight: 600; color: var(--ttc-fg); cursor: default; }
label.tt-consent__row-title { cursor: pointer; }
.tt-consent__row-text { margin: 2px 0 0; font-size: 13px; color: var(--ttc-muted); }

.tt-consent__always {
  flex: none;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ttc-muted);
  background: var(--ttc-soft);
  border-radius: 999px;
}

/* Accessible toggle switch built on a native checkbox (role="switch"). */
.tt-consent__switch {
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 44px;
  height: 26px;
  margin: 2px 0 0;
  background: var(--ttc-border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tt-consent__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}

.tt-consent__switch:checked { background: var(--ttc-brand); }
.tt-consent__switch:checked::after { transform: translateX(18px); }
.tt-consent__switch:focus-visible { outline: none; box-shadow: var(--ttc-focus); }

.tt-consent__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.tt-consent__btn {
  appearance: none;
  min-height: 44px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ttc-fg);
  background: var(--ttc-bg);
  border: 1px solid var(--ttc-border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tt-consent__btn:hover { border-color: var(--ttc-muted); }
.tt-consent__btn:focus-visible { outline: none; box-shadow: var(--ttc-focus); }
.tt-consent__btn[hidden] { display: none; }

.tt-consent__btn--primary {
  color: var(--ttc-brand-fg);
  background: var(--ttc-brand);
  border-color: var(--ttc-brand);
}

.tt-consent__btn--primary:hover { background: var(--ttc-brand-hover); border-color: var(--ttc-brand-hover); }

.tt-consent__btn--ghost {
  margin-right: auto;
  border-color: transparent;
  color: var(--ttc-brand);
  padding-left: 8px;
  padding-right: 8px;
}

.tt-consent__btn--ghost:hover { border-color: transparent; text-decoration: underline; }

/* When settings are open, "Save choices" replaces Accept as the primary action. */
.tt-consent.is-expanded [data-tt-consent-action="accept"] { display: none; }

@media (max-width: 560px) {
  .tt-consent { inset: auto 0 0 0; }
  .tt-consent__panel { padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; border-bottom: 0; }
  .tt-consent__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .tt-consent__btn--ghost { grid-column: 1 / -1; order: 3; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tt-consent__panel,
  .tt-consent__switch,
  .tt-consent__switch::after { transition: none; }
}

@media (forced-colors: active) {
  .tt-consent__panel { border: 2px solid CanvasText; }
  .tt-consent__switch { border: 2px solid CanvasText; }
  .tt-consent__switch:checked { background: Highlight; }
}
