/*
 * iubenda Cookie Solution banner — presentation-only restyle for AlfredAI.
 *
 * This site's actual dashboard config (confirmed by fetching
 * embeds.iubenda.com/widgets/54035f74-fcca-42e1-bb74-718a4062a210.js and
 * reading its embedded settings) is `"theme":"dark"` /
 * `"position":"float-bottom-center"`, which iubenda renders as classes
 * `iubenda-cs-black iubenda-cs-default-floating iubenda-cs-bottom
 * iubenda-cs-center` — a wide bottom-center bar with system-font text and
 * two identically-colored Accept/Reject buttons. (An earlier version of
 * this file assumed the OTHER AlfredAI site's `-top-` anchor without
 * checking this site's own config, which matched nothing and rendered no
 * changes at all — anchor classes must be verified per site, not assumed.)
 * This restyles it into a compact bottom-right card using AlfredAI's own
 * design tokens (--navy/--gold/--teal/--ivory, --font-sans, --radius-2xl)
 * and the pill-shaped CTA style already used across the site (see the
 * "Request a demo" / "Sign & Access Data Room" buttons in contact.tsx /
 * NdaModal.jsx).
 *
 * Every selector targets iubenda's own stable rendered class names. No
 * consent logic, config, or button behavior is touched — appearance only.
 *
 * Specificity note (carried over from the equivalent override on
 * helloalfred.ai, verified empirically there): iubenda's own stylesheet sets
 * several of these same properties via rules like
 * `#iubenda-cs-banner.iubenda-cs-bottom { ... !important }`. A plain
 * `#iubenda-cs-banner { ... }` override loses to those — `#id.class` beats
 * `#id` alone at equal !important weight. Every rule below is anchored on
 * BANNER, iubenda's full default theme-class list, so specificity always
 * matches or exceeds theirs regardless of stylesheet load order.
 *
 * This stylesheet is loaded via a <link> in the root route's `head().links`
 * (src/routes/__root.tsx), not imported into a component — the widget
 * script (first entry in `head().scripts`, per iubenda's own install
 * instructions) renders the banner with its default styling almost
 * immediately, well before a component-level CSS import would apply,
 * which would otherwise produce a visible flash of iubenda's raw default
 * theme. Loading this stylesheet directly from <head> closes that gap.
 *
 * Not yet verified live: if AlfredAI's iubenda dashboard config sets an
 * inline `style="...!important"` background on the banner (some accounts'
 * color-picker settings do this), the `background` rule below won't win —
 * that would need the same inline-<script>-with-MutationObserver fix used
 * on helloalfred.ai. Check the live banner after deploying; flag if the
 * navy background isn't taking.
 */

/* Reposition: bottom-right instead of iubenda's default bottom-center
   (vertical anchor is already bottom; only justify-content needs to flip). */
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center {
  align-items: flex-end !important;
  justify-content: flex-end !important;
}

#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-container {
  width: auto !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-content {
  pointer-events: auto !important;
  position: relative !important;
  box-sizing: border-box !important;
  width: min(25rem, calc(100vw - 2rem)) !important;
  max-width: min(25rem, calc(100vw - 2rem)) !important;
  /* Safety net only, not a normal-case constraint — the disclosure text +
     actions comfortably fit well under typical viewport heights. */
  max-height: calc(100vh - 2rem) !important;
  overflow-y: auto !important;
  margin: 0 1rem calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
  padding: 1rem 1rem 0.875rem !important;
  background: var(--navy) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: var(--radius-2xl, 1.125rem) !important;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  font-family: var(--font-sans, "DM Sans", sans-serif) !important;
}

#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center #iubenda-cs-paragraph {
  margin: 0 !important;
}

#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iub-p {
  font-family: var(--font-sans, "DM Sans", sans-serif) !important;
  font-size: 0.75rem !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  color: var(--ivory) !important;
  opacity: 0.85 !important;
  margin: 0 0 0.5rem !important;
}
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iub-p:last-child {
  margin-bottom: 0 !important;
}
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iub-p:empty {
  display: none !important;
}
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iub-p strong {
  font-weight: 600 !important;
  color: var(--ivory) !important;
  opacity: 1 !important;
}
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iub-p a {
  color: var(--gold) !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
  font-weight: 500 !important;
}
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iub-p a:hover {
  color: var(--gold-soft) !important;
}

/* Actions */
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-opt-group {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0.5rem !important;
  margin: 0.75rem 0 0 !important;
  padding: 0 !important;
}

#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-opt-group-custom {
  margin: 0 !important;
}
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-customize-btn {
  background: transparent !important;
  border: none !important;
  color: var(--ivory) !important;
  opacity: 0.65 !important;
  font-family: var(--font-sans, "DM Sans", sans-serif) !important;
  font-size: 0.6875rem !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  cursor: pointer !important;
}
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-customize-btn:hover,
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-customize-btn:focus-visible {
  opacity: 1 !important;
}

#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-opt-group-consent {
  display: flex !important;
  flex-direction: row !important;
  gap: 0.5rem !important;
  margin: 0 !important;
  width: 100% !important;
}

/* Pill-shaped buttons, matching the site's primary CTA style (see the
   "Request a demo" / "Sign & Access Data Room" buttons elsewhere). */
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-reject-btn,
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-accept-btn {
  flex: 1 1 0% !important;
  font-family: var(--font-sans, "DM Sans", sans-serif) !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  padding: 0.5rem 0.75rem !important;
  margin: 0 !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  transition: background-color 0.15s ease, filter 0.15s ease !important;
}

/* Accept — primary, most prominent (gold-on-navy, matching the site's
   dark-panel CTA pattern used in investors.tsx). */
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-accept-btn {
  background: var(--gold) !important;
  color: var(--navy) !important;
  border: none !important;
}
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-accept-btn:hover,
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-accept-btn:focus-visible {
  background: var(--gold-soft) !important;
}

/* Reject — secondary, outlined, still clearly actionable. */
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-reject-btn {
  background: transparent !important;
  color: var(--ivory) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-reject-btn:hover,
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-reject-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08) !important;
}

#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center button:focus-visible {
  outline: 2px solid var(--teal) !important;
  outline-offset: 2px !important;
}

#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-brand-badge-text {
  margin: 0.5rem 0 0 !important;
  font-family: var(--font-sans, "DM Sans", sans-serif) !important;
  font-size: 0.625rem !important;
  color: var(--ivory) !important;
  opacity: 0.5 !important;
}
#iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-brand-badge-text a {
  color: inherit !important;
  text-decoration: underline !important;
}

/* Compact viewports: tighter margins, full-bleed-minus-gutter width. */
@media (max-width: 30rem) {
  #iubenda-cs-banner.iubenda-cs-black.iubenda-cs-default-floating.iubenda-cs-bottom.iubenda-cs-center .iubenda-cs-content {
    width: calc(100vw - 1.5rem) !important;
    max-width: calc(100vw - 1.5rem) !important;
    margin: 0 0.75rem calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
    padding: 0.875rem 0.875rem 0.75rem !important;
  }
}

/* US state-privacy "Notice at collection" / "Your Privacy Choices" footer
 * bar — iubenda's `.iub__us-widget`. If enabled on this site's dashboard
 * config, it's a visual duplicate of the floating preferences button
 * (`.iubenda-tp-btn.iubenda-cs-preferences-link`, which stays visible and
 * functional) — hiding it here is purely cosmetic and doesn't remove any
 * consent-management entry point. No-op if this site's config doesn't use
 * that bar at all.
 */
.iub__us-widget {
  display: none !important;
}
