/*
 * Cookie banner (apps/tracking). Self-contained: only db-consent classes.
 * A landing page or journey design may set these variables to match its look.
 * "Reject all" and "Accept all" share one style on purpose: rejecting must
 * be as easy and as visible as accepting (no nudging). Only "Settings" may
 * be quieter — it decides nothing.
 */
/* Variables are only read (with defaults), never set here, so a page can
 * set them anywhere, e.g. on :root. */
.db-consent {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2147483000;
  max-width: 760px;
  max-height: calc(100vh - 24px);
  margin: 0 auto;
  overflow-y: auto;
  padding: 16px 18px;
  background: var(--db-consent-bg, #ffffff);
  color: var(--db-consent-fg, #2b2b2b);
  border: 1px solid var(--db-consent-border, rgba(0, 0, 0, 0.15));
  border-radius: 12px;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.18);
  font: 14px/1.5 var(--db-consent-font, system-ui, -apple-system, "Segoe UI", sans-serif);
  box-sizing: border-box;
}

.db-consent *,
.db-consent *::before,
.db-consent *::after {
  box-sizing: inherit;
}

.db-consent-title {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 15px;
}

.db-consent-text {
  margin: 0 0 10px;
}

.db-consent-emoji {
  font-size: 18px;
  margin-right: 2px;
}

.db-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.db-consent-btn {
  flex: 1 1 160px;
  padding: 9px 14px;
  border: 1px solid var(--db-consent-accent, #2b2b2b);
  border-radius: 8px;
  background: transparent;
  color: var(--db-consent-accent, #2b2b2b);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.db-consent-btn:hover,
.db-consent-btn:focus-visible {
  background: var(--db-consent-accent, #2b2b2b);
  color: var(--db-consent-bg, #ffffff);
}

a.db-consent-btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

/* Quieter than the two decisions, never louder. */
.db-consent-btn-settings {
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.db-consent-btn-settings:hover,
.db-consent-btn-settings:focus-visible {
  border-color: var(--db-consent-accent, #2b2b2b);
}

.db-consent-actions[hidden],
.db-consent-details[hidden] {
  display: none;
}

.db-consent-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.db-consent-links {
  display: flex;
  gap: 16px;
  margin: 10px 0 0;
  font-size: 13px;
}

.db-consent-links a {
  color: inherit;
}

.db-consent-reopen {
  position: fixed;
  left: 8px;
  bottom: 8px;
  z-index: 2147482000;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  color: #555;
  font: 11px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  text-decoration: none;
}

.db-consent-reopen:hover,
.db-consent-reopen:focus-visible {
  color: #000;
  text-decoration: underline;
}

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

/* Settings layer — in the banner and on the settings page. */
.db-consent-details {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--db-consent-border, rgba(0, 0, 0, 0.15));
}

.db-consent-choice {
  margin: 0 0 12px;
}

.db-consent-choice-head {
  display: flex;
  gap: 10px;
  align-items: center;
}

.db-consent-choice-head label {
  flex: 1 1 auto;
  font-weight: 600;
  cursor: pointer;
}

.db-consent-always,
.db-consent-state {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
}

.db-consent-always,
.db-consent-state-on {
  color: var(--db-consent-on, #2e7d32);
}

.db-consent-state-off {
  color: var(--db-consent-off-text, #8a8a8a);
}

/* Show only the word that matches the switch — works without JavaScript. */
.db-consent-switch:checked ~ .db-consent-state-off,
.db-consent-switch:not(:checked) ~ .db-consent-state-on {
  display: none;
}

.db-consent-choice-text {
  margin: 4px 0 0 46px;
  font-size: 13px;
}

.db-consent-renewal {
  margin: 0 0 12px;
  font-size: 12px;
  opacity: 0.75;
}

/* A switch, built on the plain checkbox so it works without JavaScript. */
.db-consent-switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 20px;
  margin: 0;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: background 0.15s;
}

.db-consent-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.15s;
}

/* On is green — unmistakable, and independent of the page's accent colour. */
.db-consent-switch:checked {
  background: var(--db-consent-on, #2e7d32);
}

.db-consent-switch:checked::after {
  transform: translateX(16px);
}

.db-consent-switch:disabled {
  opacity: 0.6;
  cursor: default;
}

.db-consent-switch:focus-visible {
  outline: 2px solid var(--db-consent-accent, #2b2b2b);
  outline-offset: 2px;
}
