/* ============================================================
   Flex — cookie banner (js/consent.js)
   Uses the tokens and .flex-btn from assets/colors_and_type.css.
   ============================================================ */
.flex-consent {
  position: fixed; z-index: 2147483001; /* above the Intercom launcher */
  left: 16px; right: 16px; bottom: 16px;
  max-width: 420px; margin: 0 auto; padding: 20px 22px 18px;
  max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--color-white); color: var(--color-gray-650);
  border: 1px solid var(--color-gray-300); border-radius: 14px;
  box-shadow: 0 1px 1px rgba(13, 28, 39, 0.12), 0 18px 48px rgba(13, 28, 39, 0.22);
  font: 400 0.875rem/1.55 var(--font-product);
  transform: translateY(calc(100% + 32px)); opacity: 0;
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.25, 1), opacity 0.3s;
}
/* Bottom right on wider screens, clear of the hero buttons on the left. */
@media (min-width: 640px) { .flex-consent { right: 24px; bottom: 24px; left: auto; margin: 0; } }
@media (prefers-reduced-motion: reduce) { .flex-consent { transition: none; } }
.flex-consent.is-open { transform: none; opacity: 1; }
.flex-consent[hidden] { display: block; visibility: hidden; }
/* paia-manual.html is laid out for printing, and a fixed element repeats on every printed page. */
@media print { .flex-consent { display: none; } }
.flex-consent [hidden] { display: none; }

.flex-consent h2 { margin: 0 0 6px; font: 700 1rem/1.3 var(--font-product); color: var(--fg-primary); }
.flex-consent p { margin: 0 0 16px; }
.flex-consent a { color: var(--color-blue-700); }

.flex-consent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.flex-consent-actions .flex-btn { flex: 1 1 auto; min-height: 40px; font-size: 0.875rem; }
.flex-consent-actions .flex-btn-secondary { color: var(--color-blue-700); }
.flex-consent-more {
  margin-top: 6px; padding: 6px 0 0; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 0.8125rem; color: var(--color-gray-650);
  text-decoration: underline; text-underline-offset: 0.18em;
}
.flex-consent-more:hover { color: var(--color-blue-700); }

.flex-consent-prefs { border-top: 1px solid var(--color-gray-300); margin: 4px -22px 16px; padding: 4px 22px 0; }
.flex-consent-pref {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--color-gray-200);
}
.flex-consent-pref:last-child { border-bottom: 0; }
.flex-consent-pref-name { font-weight: 600; color: var(--fg-primary); }
.flex-consent-pref-desc { grid-column: 1; font-size: 0.78rem; line-height: 1.45; }
.flex-consent-switch { grid-row: 1 / span 2; grid-column: 2; position: relative; width: 42px; height: 24px; }
.flex-consent-switch input { position: absolute; inset: 0; z-index: 1; margin: 0; opacity: 0; cursor: pointer; }
.flex-consent-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--color-gray-400); transition: background-color 0.2s; }
.flex-consent-switch span::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.2s;
}
.flex-consent-switch input:checked + span { background: var(--color-green-600); }
.flex-consent-switch input:checked + span::after { transform: translateX(18px); }
.flex-consent-switch input:disabled { cursor: not-allowed; }
.flex-consent-switch input:disabled + span { opacity: 0.6; }
.flex-consent-switch input:focus-visible + span { outline: 3px solid var(--color-blue-400); outline-offset: 2px; }

/* Footer "Cookie settings" button, styled as a link. */
.flex-consent-link { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.foot-grid .flex-consent-link:hover { color: #fff; }

/* Chat button shown in place of the Intercom launcher (js/chat.js), in the launcher's position. */
.flex-chat-launcher {
  position: fixed; z-index: 2147483000; right: 20px; bottom: 20px;
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  background: var(--color-blue-700); color: #fff;
  box-shadow: 0 1px 6px rgba(13, 28, 39, 0.12), 0 6px 20px rgba(13, 28, 39, 0.22);
}
.flex-chat-launcher:focus-visible { outline: 3px solid var(--color-blue-400); outline-offset: 2px; }
@media print { .flex-chat-launcher { display: none; } }
