/* TextPast consent banner styles — WCAG 2.2 AA contrast, framework-free. */

.tp-consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 2147483647;
  padding: 16px;
  background: transparent;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
  animation: tp-consent-in 240ms ease-out;
}

@keyframes tp-consent-in {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.tp-consent__box {
  max-width: 880px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  padding: 20px 22px 18px;
}

.tp-consent__head { margin-bottom: 14px; }

.tp-consent__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
  color: #111111;
}

.tp-consent__intro {
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 8px;
  color: #333333;          /* 4.5:1 on white = 12.6:1, comfortable AA */
  max-width: 70ch;
}

.tp-consent__privacy {
  display: inline-block;
  font-size: 12.5px;
  color: #0a4a8a;          /* 8.59:1 on white — AA */
  text-decoration: underline;
}
.tp-consent__privacy:hover { color: #062a55; }
.tp-consent__privacy:focus-visible {
  outline: 2px solid #0a4a8a;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Layer 1: EQUAL prominence for Accept and Reject (same size, weight, radius). */
.tp-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tp-consent__btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  padding: 11px 16px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  cursor: pointer;
  min-height: 40px;        /* touch target >= 24px, comfortable on mobile */
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.tp-consent__btn:focus-visible {
  outline: 2px solid #0a4a8a;
  outline-offset: 2px;
}

.tp-consent__btn--reject {
  background: #ffffff;
  color: #111111;
  border-color: #444444;   /* 9.74:1 — AA */
}
.tp-consent__btn--reject:hover { background: #f2f2f2; }

.tp-consent__btn--accept {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}
.tp-consent__btn--accept:hover { background: #000000; }

.tp-consent__btn--ghost {
  background: transparent;
  color: #0a4a8a;
  border-color: transparent;
  text-decoration: underline;
  padding-left: 8px;
  padding-right: 8px;
}
.tp-consent__btn--ghost:hover { color: #062a55; }

/* Layer 2: category panel */
.tp-consent__panel { margin-top: 14px; border-top: 1px solid rgba(0, 0, 0, 0.08); padding-top: 10px; }
.tp-consent__panel[hidden] { display: none; }

.tp-consent__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.tp-consent__row:last-of-type { border-bottom: 0; }

.tp-consent__row-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tp-consent__row-name { font-size: 13.5px; font-weight: 600; color: #111111; }
.tp-consent__row-desc { font-size: 12.5px; color: #444444; line-height: 1.45; max-width: 60ch; }

.tp-consent__always-on {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #555555;
  white-space: nowrap;
}

/* Toggle switch (role="switch") */
.tp-consent__toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  color: #444444;
  flex: 0 0 auto;
}
.tp-consent__toggle:focus-visible {
  outline: 2px solid #0a4a8a;
  outline-offset: 3px;
  border-radius: 999px;
}
.tp-consent__toggle-track {
  display: inline-block;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #888888;
  position: relative;
  transition: background-color 140ms ease;
}
.tp-consent__toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 140ms ease;
}
.tp-consent__toggle[aria-checked="true"] .tp-consent__toggle-track { background: #0a7a3a; }
.tp-consent__toggle[aria-checked="true"] .tp-consent__toggle-thumb { transform: translateX(18px); }

.tp-consent__toggle-on { display: none; }
.tp-consent__toggle-off { display: inline; }
.tp-consent__toggle[aria-checked="true"] .tp-consent__toggle-on { display: inline; }
.tp-consent__toggle[aria-checked="true"] .tp-consent__toggle-off { display: none; }

.tp-consent__panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.tp-consent__panel-spacer { flex: 1; }

@media (max-width: 600px) {
  .tp-consent { padding: 10px; }
  .tp-consent__box { padding: 16px 14px 14px; border-radius: 10px; }
  .tp-consent__btn { flex: 1 1 auto; }
  .tp-consent__btn--ghost { flex: 0 0 auto; }
  .tp-consent__intro { font-size: 13px; }
  .tp-consent__row { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .tp-consent { animation: none; }
  .tp-consent__toggle-track, .tp-consent__toggle-thumb { transition: none; }
}
