/* Cookie consent banner + preferences dialog */
#cookieConsent[hidden], #cookieConsent [hidden] { display: none !important; }

.cc-banner {
  position: fixed; left: 24px; bottom: 24px; z-index: 2000;
  width: min(440px, calc(100vw - 32px));
  background: #fff; color: #1E293B;
  border: 1px solid #E2E8F0; border-top: 4px solid #3C2CDA;
  border-radius: 16px; padding: 1.25rem 1.35rem 1.15rem;
  box-shadow: 0 20px 50px rgba(4, 13, 67, 0.22);
  font-family: 'Manrope', system-ui, sans-serif;
  animation: ccIn .35s cubic-bezier(.16, 1, .3, 1);
}
@keyframes ccIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cc-banner { animation: none; } }

.cc-banner__head { display: flex; align-items: center; gap: .65rem; margin-bottom: .5rem; }
.cc-banner__icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #EEF0FF; color: #3C2CDA; font-size: 1.15rem; flex-shrink: 0; }
.cc-banner__title { font-size: 1.08rem; font-weight: 800; color: #040D43; margin: 0; letter-spacing: -.01em; }
.cc-banner__text { font-size: .875rem; line-height: 1.6; color: #475569; margin: 0 0 1rem; }
.cc-banner__text a { color: #3C2CDA; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.cc-banner__actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.cc-btn { font: inherit; font-size: .85rem; font-weight: 700; line-height: 1; padding: .72rem 1.05rem; border-radius: 999px; border: 2px solid transparent; cursor: pointer; transition: background .2s, color .2s, border-color .2s, box-shadow .2s; }
.cc-btn:focus-visible { outline: 3px solid #14CBDE; outline-offset: 2px; }
.cc-btn--primary { background: #3C2CDA; color: #fff; border-color: #3C2CDA; }
.cc-btn--primary:hover { background: #2f21b8; border-color: #2f21b8; box-shadow: 0 6px 16px rgba(60, 44, 218, .3); }
.cc-btn--outline { background: #fff; color: #3C2CDA; border-color: #3C2CDA; }
.cc-btn--outline:hover { background: #EEF0FF; }
.cc-btn--link { background: transparent; color: #475569; text-decoration: underline; text-underline-offset: 3px; padding-left: .5rem; padding-right: .5rem; }
.cc-btn--link:hover { color: #3C2CDA; }

/* dialog */
.cc-modal { position: fixed; inset: 0; z-index: 2100; display: flex; align-items: center; justify-content: center; padding: 16px; font-family: 'Manrope', system-ui, sans-serif; }
.cc-modal__backdrop { position: absolute; inset: 0; background: rgba(4, 13, 67, .55); backdrop-filter: blur(2px); }
.cc-modal__panel { position: relative; width: min(600px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); outline: none; }
.cc-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.4rem; border-bottom: 1px solid #EEF0F8; }
.cc-modal__head h2 { font-size: 1.2rem; font-weight: 800; color: #040D43; margin: 0; }
.cc-modal__close { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #F1F3FF; color: #3C2CDA; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.cc-modal__close:hover { background: #E3E7FF; }
.cc-modal__close:focus-visible { outline: 3px solid #14CBDE; outline-offset: 2px; }
.cc-modal__body { padding: 1.1rem 1.4rem; overflow-y: auto; }
.cc-modal__intro { font-size: .9rem; color: #475569; line-height: 1.6; margin: 0 0 1rem; }
.cc-modal__foot { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; padding: 1rem 1.4rem; border-top: 1px solid #EEF0F8; }

.cc-cat { border: 1px solid #E4E7F3; border-radius: 14px; padding: 1rem 1.1rem; margin-bottom: .75rem; background: #FAFBFF; }
.cc-cat__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.cc-cat__name { font-size: .98rem; font-weight: 800; color: #040D43; margin: 0 0 .25rem; }
.cc-cat__desc { font-size: .85rem; color: #64748B; line-height: 1.55; margin: 0; }
.cc-cat__always { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #16a34a; background: #DCFCE7; padding: .3rem .6rem; border-radius: 999px; white-space: nowrap; }

.cc-switch { position: relative; flex-shrink: 0; width: 48px; height: 28px; margin-top: 2px; cursor: pointer; }
.cc-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.cc-switch__track { position: absolute; inset: 0; background: #CBD5E1; border-radius: 999px; transition: background .2s; }
.cc-switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.cc-switch input:checked + .cc-switch__track { background: #3C2CDA; }
.cc-switch input:checked + .cc-switch__track::after { transform: translateX(20px); }
.cc-switch input:focus-visible + .cc-switch__track { outline: 3px solid #14CBDE; outline-offset: 2px; }

/* footer "Cookie settings" link-button */
.footer-link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.footer-link-btn:hover { text-decoration: underline; }
.siteFooter .footer-link-btn:focus-visible { outline: 3px solid var(--hx-cyan); outline-offset: 3px; border-radius: 4px; }

@media (max-width: 575.98px) {
  .cc-banner { left: 0; right: 0; bottom: 0; width: 100%; border-radius: 18px 18px 0 0; padding: 1.1rem 1.1rem calc(1rem + env(safe-area-inset-bottom)); }
  .cc-banner__actions .cc-btn--primary, .cc-banner__actions .cc-btn--outline { flex: 1 1 calc(50% - .25rem); text-align: center; }
  .cc-banner__actions .cc-btn--link { flex: 1 1 100%; text-align: center; }
  .cc-modal { align-items: flex-end; padding: 0; }
  .cc-modal__panel { border-radius: 18px 18px 0 0; max-height: 92vh; }
  .cc-modal__foot .cc-btn { flex: 1 1 100%; text-align: center; }
}

/* hide the banner while the preferences dialog is open (it returns if the dialog is closed without saving) */
#cookieConsent:has(.cc-modal:not([hidden])) .cc-banner { visibility: hidden; }
@media (max-width: 575.98px) {
  .cc-banner__actions .cc-btn { padding-left: .5rem; padding-right: .5rem; font-size: .82rem; white-space: nowrap; }
}
