/* Buslio — cookie consent banner styles.

   SAME-ORIGIN static stylesheet (style-src 'self'), so it is CSP-safe and does
   NOT depend on the Vite/Tailwind build (self-contained, no rebuild required).
   Brand blue #1F63F2, ink #0F172A. Mobile-first, high z-index, accessible. */

:root {
  --buslio-consent-brand: #1F63F2;
  --buslio-consent-brand-hover: #1a54cf;
  --buslio-consent-ink: #0F172A;
  --buslio-consent-muted: #475569;
  --buslio-consent-border: #e2e8f0;
  --buslio-consent-bg: #ffffff;
}

#buslio-consent-banner[hidden] { display: none !important; }

#buslio-consent-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 2147483000; /* above app chrome, modals, datepicker overlays */
  display: flex;
  justify-content: center;
  padding: 12px;
  pointer-events: none;
}

#buslio-consent-banner::before {
  /* Subtle scrim so the banner reads clearly on busy pages, without blocking. */
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  z-index: -1;
  pointer-events: none;
}

.buslio-consent-card {
  pointer-events: auto;
  width: 100%;
  max-width: 720px;
  background: var(--buslio-consent-bg);
  color: var(--buslio-consent-ink);
  border: 1px solid var(--buslio-consent-border);
  border-radius: 16px;
  box-shadow: 0 20px 45px -12px rgba(15, 23, 42, 0.35);
  padding: 20px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}

.buslio-consent-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--buslio-consent-ink);
}

.buslio-consent-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--buslio-consent-muted);
  margin: 0 0 14px;
}

.buslio-consent-text a {
  color: var(--buslio-consent-brand);
  text-decoration: underline;
  font-weight: 600;
}

.buslio-consent-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 560px) {
  .buslio-consent-actions { flex-direction: row; flex-wrap: wrap; }
  .buslio-consent-actions .buslio-consent-btn { flex: 1 1 auto; }
}

.buslio-consent-btn {
  appearance: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
  text-align: center;
}

.buslio-consent-btn:focus-visible {
  outline: 3px solid rgba(31, 99, 242, 0.4);
  outline-offset: 2px;
}

/* Accept + Reject share the same visual weight (reject as easy as accept). */
.buslio-consent-btn--primary {
  background: var(--buslio-consent-brand);
  color: #ffffff;
}
.buslio-consent-btn--primary:hover { background: var(--buslio-consent-brand-hover); }

.buslio-consent-btn--secondary {
  background: #f1f5f9;
  color: var(--buslio-consent-ink);
  border-color: var(--buslio-consent-border);
}
.buslio-consent-btn--secondary:hover { background: #e2e8f0; }

.buslio-consent-btn--ghost {
  background: transparent;
  color: var(--buslio-consent-brand);
  border-color: transparent;
  font-weight: 600;
  text-decoration: underline;
}
.buslio-consent-btn--ghost:hover { color: var(--buslio-consent-brand-hover); }

/* ── Preferences panel ── */
.buslio-consent-group {
  border: 1px solid var(--buslio-consent-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.buslio-consent-group-info { min-width: 0; }

.buslio-consent-group-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--buslio-consent-ink);
  margin: 0 0 4px;
}

.buslio-consent-group-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--buslio-consent-muted);
  margin: 0;
}

/* Accessible toggle switch built on a native checkbox. */
.buslio-consent-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex: 0 0 auto;
}
.buslio-consent-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.buslio-consent-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background-color .15s ease;
}
.buslio-consent-slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform .15s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.3);
}
.buslio-consent-switch input:checked + .buslio-consent-slider { background: var(--buslio-consent-brand); }
.buslio-consent-switch input:checked + .buslio-consent-slider::before { transform: translateX(18px); }
.buslio-consent-switch input:focus-visible + .buslio-consent-slider {
  outline: 3px solid rgba(31, 99, 242, 0.4);
  outline-offset: 2px;
}
.buslio-consent-switch input:disabled + .buslio-consent-slider { background: var(--buslio-consent-brand); opacity: .55; cursor: not-allowed; }

.buslio-consent-prefs-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
@media (min-width: 560px) {
  .buslio-consent-prefs-actions { flex-direction: row; }
  .buslio-consent-prefs-actions .buslio-consent-btn { flex: 1 1 auto; }
}
