/* BecA Cookie Consent — scoped styles only. */
.beca-cookie-consent {
  --beca-consent-primary: var(--color-primary, #135AD5);
  --beca-consent-accent: var(--color-accent, #07A5F6);
  position: fixed;
  z-index: 2147483000;
  left: 50%;
  bottom: 0;
  width: 100vw;
  transform: translateX(-50%);
  padding: 1.5rem max(1.25rem, env(safe-area-inset-right)) calc(1.5rem + env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  box-sizing: border-box;
  color: #fff;
  font-family: 'Open Sans', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, rgba(10, 23, 47, .76), rgba(19, 90, 213, .32));
  border-top: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .18);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-user-select: none;
  user-select: none;
}

.beca-cookie-consent[hidden] { display: none !important; }

/* Keep all consent-panel typography on Google Open Sans, including controls
   that may otherwise inherit browser or site theme fonts. */
.beca-cookie-consent,
.beca-cookie-consent *,
.beca-cookie-consent *::before,
.beca-cookie-consent *::after {
  font-family: 'Open Sans', sans-serif !important;
}

.beca-cookie-consent__inner {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(145px, 180px);
  align-items: center;
  gap: 1.5rem;
}

.beca-cookie-consent__title {
  margin: 0 0 .45rem;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: .06em;
}

.beca-cookie-consent__message {
  margin: 0;
  max-width: 940px;
  color: #fff;
  font-size: .875rem;
  line-height: 1.55;
  font-weight: 400;
}

.beca-cookie-consent__link {
  position: relative;
  color: var(--beca-consent-accent) !important;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  white-space: nowrap;
}

.beca-cookie-consent__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -.12em;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .25s ease;
}

.beca-cookie-consent__link:hover::after,
.beca-cookie-consent__link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.beca-cookie-consent__link:focus-visible,
.beca-cookie-consent__button:focus-visible {
  outline: 2px solid var(--beca-consent-accent);
  outline-offset: 3px;
}

.beca-cookie-consent__divider {
  align-self: stretch;
  min-height: 62px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.38) 18%, rgba(255,255,255,.38) 82%, transparent);
}

.beca-cookie-consent__actions {
  display: grid;
  gap: .55rem;
}

.beca-cookie-consent .beca-cookie-consent__button {
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: .62rem .9rem;
  border: 1px solid rgba(255,255,255,.30);
  border-radius: .45rem;
  background: rgba(255,255,255,.10);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: .82rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transform: none;
  transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.beca-cookie-consent .beca-cookie-consent__button:hover {
  background: var(--beca-consent-primary);
  border-color: var(--beca-consent-primary);
  color: #fff;
  box-shadow: 0 8px 22px rgba(19,90,213,.28);
  transform: none;
}

@media (max-width: 760px) {
  .beca-cookie-consent {
    padding-top: 1.15rem;
    padding-bottom: calc(1.15rem + env(safe-area-inset-bottom));
  }
  .beca-cookie-consent__inner {
    grid-template-columns: 1fr;
    gap: .85rem;
  }
  .beca-cookie-consent__divider {
    width: 100%;
    min-height: 1px;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,.34) 12%, rgba(255,255,255,.34) 88%, transparent);
  }
  .beca-cookie-consent__actions {
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
  }
}

@media (max-width: 460px) {
  .beca-cookie-consent { padding-left: 1rem; padding-right: 1rem; }
  .beca-cookie-consent__message { font-size: .81rem; line-height: 1.48; }
  .beca-cookie-consent__actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .beca-cookie-consent *, .beca-cookie-consent *::before, .beca-cookie-consent *::after { transition: none !important; }
}

/* Granular cookie settings. */
.beca-cookie-consent__settings {
  margin-top: 1rem;
  padding-top: .35rem;
  border-top: 1px solid rgba(255,255,255,.18);
}
.beca-cookie-consent__setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: .7rem 0;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.beca-cookie-consent__setting > div { display: grid; gap: .16rem; }
.beca-cookie-consent__setting strong { color: #fff; font-size: .82rem; font-weight: 700; text-transform: uppercase; }
.beca-cookie-consent__setting span:not(.beca-cookie-consent__switch):not(.beca-cookie-consent__required) { font-size: .75rem; line-height: 1.4; opacity: .82; }
.beca-cookie-consent__required { font-size: .72rem; font-weight: 700; color: #fff; opacity: .82; white-space: nowrap; }
.beca-cookie-consent__setting input { position: absolute; opacity: 0; pointer-events: none; }
.beca-cookie-consent__switch {
  position: relative; width: 42px; height: 23px; border-radius: 999px;
  background: rgba(255,255,255,.20); border: 1px solid rgba(255,255,255,.30);
  cursor: pointer; transition: background-color .2s ease, border-color .2s ease;
}
.beca-cookie-consent__switch::after {
  content: ''; position: absolute; width: 17px; height: 17px; left: 2px; top: 2px;
  border-radius: 50%; background: #fff; transition: transform .2s ease;
}
.beca-cookie-consent__setting input:checked + .beca-cookie-consent__switch { background: var(--beca-consent-primary); border-color: var(--beca-consent-accent); }
.beca-cookie-consent__setting input:checked + .beca-cookie-consent__switch::after { transform: translateX(19px); }
.beca-cookie-consent__setting input:focus-visible + .beca-cookie-consent__switch { outline: 2px solid var(--beca-consent-accent); outline-offset: 3px; }
/* Main disclaimer primary action remains blue. In Cookie Settings, only the
   currently active preset (Accept All or Reject All) receives primary blue. */
.beca-cookie-consent__main-actions .beca-cookie-consent__button--primary,
.beca-cookie-consent__settings-actions .beca-cookie-consent__button.is-active {
  background: var(--beca-consent-primary) !important;
  border-color: var(--beca-consent-primary) !important;
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(19,90,213,.28);
}
.beca-cookie-consent__settings-actions .beca-cookie-consent__button:not(.is-active) {
  background: rgba(255,255,255,.10) !important;
  border-color: rgba(255,255,255,.30) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
}
.beca-cookie-consent__settings-actions .beca-cookie-consent__button:not(.is-active):hover {
  background: rgba(255,255,255,.16) !important;
  border-color: rgba(255,255,255,.42) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.beca-cookie-consent__button--save { border-color: var(--beca-consent-accent) !important; }

@media (max-width: 760px) {
  .beca-cookie-consent__settings { max-height: 42vh; overflow-y: auto; padding-right: .25rem; }
  .beca-cookie-consent__setting { gap: .75rem; }
}

/* Cookie Settings floating control.
 * Matches the BecA theme scroll-to-top control while remaining module-owned.
 */
.beca-cookie-settings-trigger {
  position: fixed;
  right: 5rem;
  bottom: 5rem;
  z-index: 1100;
  width: 4.5rem;
  height: 4.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color-primary, #135AD5);
  box-shadow: 0 8px 24px rgba(19, 90, 213, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color var(--transition-fast, 150ms ease),
    box-shadow var(--transition-fast, 150ms ease);
}

.beca-cookie-settings-trigger[hidden] { display: none !important; }

.beca-cookie-settings-trigger:hover,
.beca-cookie-settings-trigger:focus-visible {
  background: var(--color-primary-dark, #0f49b1);
  box-shadow: 0 10px 28px rgba(19, 90, 213, 0.36);
}

.beca-cookie-settings-trigger:focus-visible {
  outline: 3px solid var(--color-white, #fff);
  outline-offset: 3px;
}

.beca-cookie-settings-trigger img {
  width: 2rem;
  height: 2rem;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

@media (max-width: 1199px) {
  .beca-cookie-settings-trigger { right: 4rem; bottom: 4rem; }
}
@media (max-width: 991px) {
  .beca-cookie-settings-trigger { right: 3rem; bottom: 3rem; }
}
@media (max-width: 767px) {
  .beca-cookie-settings-trigger {
    right: 2rem;
    bottom: 2rem;
    width: 4rem;
    height: 4rem;
  }
  .beca-cookie-settings-trigger img { width: 1.75rem; height: 1.75rem; }
}
@media (max-width: 479px) {
  .beca-cookie-settings-trigger { right: 1.5rem; bottom: 1.5rem; }
}
@media (min-width: 1480px) {
  .beca-cookie-settings-trigger {
    left: calc(50% + 620px + 3rem);
    right: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .beca-cookie-settings-trigger { transition: none; }
}


/* Premium floating Cookie Settings control sizing.
 * Matches the theme's scroll-up utility control.
 */
.beca-cookie-settings-trigger {
  width: 3.5rem;
  height: 3.5rem;
  box-shadow: 0 6px 18px rgba(19, 90, 213, 0.22);
}

.beca-cookie-settings-trigger:hover,
.beca-cookie-settings-trigger:focus-visible {
  box-shadow: 0 8px 22px rgba(19, 90, 213, 0.30);
}

.beca-cookie-settings-trigger img {
  width: 1.4rem;
  height: 1.4rem;
}

@media (max-width: 767px) {
  .beca-cookie-settings-trigger {
    width: 3.25rem;
    height: 3.25rem;
  }
  .beca-cookie-settings-trigger img {
    width: 1.35rem;
    height: 1.35rem;
  }
}


/* Cookie Settings action spacing.
 * Keeps Accept All, Reject All and Save Settings visually separated when stacked.
 */
.beca-cookie-consent__settings-actions,
.beca-cookie-consent__settings .beca-cookie-consent__actions {
  gap: 0.75rem;
  row-gap: 0.75rem;
}

.beca-cookie-consent__settings-actions > *,
.beca-cookie-consent__settings .beca-cookie-consent__actions > * {
  margin-top: 0;
  margin-bottom: 0;
}


/* Explicit Cookie Settings button separation.
 * Ensures Accept All, Reject All and Exit Settings never touch.
 */
.beca-cookie-consent__settings-actions > button + button,
.beca-cookie-consent__settings .beca-cookie-consent__actions > button + button {
  margin-top: 0.5rem !important;
}


/* Explicit home consent-panel button separation.
 * Ensures Accept All, Reject All and Cookie Settings never touch.
 */
.beca-cookie-consent__main-actions > button + button {
  margin-top: 0.5rem !important;
}


/* Home consent panel: no preset is visually selected.
 * Accept All, Reject All and Cookie Settings remain neutral until clicked.
 */
.beca-cookie-consent__main-actions button.is-active,
.beca-cookie-consent__main-actions button.is-selected,
.beca-cookie-consent__main-actions button[aria-pressed="true"] {
  background: transparent !important;
  color: inherit;
}

/* Preserve the normal button border if an active-state rule previously changed it. */
.beca-cookie-consent__main-actions button.is-active,
.beca-cookie-consent__main-actions button.is-selected,
.beca-cookie-consent__main-actions button[aria-pressed="true"] {
  box-shadow: inherit;
}


/* --------------------------------------------------------------------------
   Home consent actions: glass -> blue hover/focus -> persistent blue active
   -------------------------------------------------------------------------- */
.beca-cookie-consent__main-actions button {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.48) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.beca-cookie-consent__main-actions button:hover,
.beca-cookie-consent__main-actions button:focus-visible,
.beca-cookie-consent__main-actions button.is-active,
.beca-cookie-consent__main-actions button.is-selected,
.beca-cookie-consent__main-actions button[aria-pressed="true"] {
  background: var(--color-primary, #135AD5) !important;
  color: #fff !important;
  border-color: var(--color-primary, #135AD5) !important;
  box-shadow: 0 6px 18px rgba(19, 90, 213, 0.26) !important;
}

.beca-cookie-consent__main-actions button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 2px;
}
