:root {
  --wcag-widget-z: 1200;
  --wcag-widget-blue: #1f5f93;
  --wcag-widget-blue-dark: #173f63;
  --wcag-widget-surface: rgba(255, 255, 255, 0.98);
  --wcag-widget-border: rgba(217, 233, 240, 0.95);
  --wcag-widget-text: #122033;
  --wcag-widget-muted: #5c6d7e;
  --wcag-widget-shadow: 0 24px 60px rgba(18, 32, 51, 0.18);
  --wcag-widget-radius: 24px;
}

html {
  font-size: var(--wcag-font-scale, 100%);
}

.wcag-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--wcag-widget-z);
}

.wcag-widget__trigger {
  position: absolute;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wcag-widget-blue) 0%, #2a6fbe 100%);
  color: #fff;
  box-shadow: 0 18px 36px rgba(31, 95, 147, 0.32);
}

.wcag-widget__trigger:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.wcag-widget__trigger svg {
  width: 34px;
  height: 34px;
}

.wcag-widget__panel {
  width: min(420px, calc(100vw - 32px));
  margin-right: 14px;
  margin-bottom: 92px;
  border: 1px solid var(--wcag-widget-border);
  border-radius: var(--wcag-widget-radius);
  background: var(--wcag-widget-surface);
  box-shadow: var(--wcag-widget-shadow);
  backdrop-filter: blur(12px);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease;
}

.wcag-widget.is-open .wcag-widget__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.wcag-widget__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 16px;
  background: linear-gradient(135deg, var(--wcag-widget-blue) 0%, #2a6fbe 100%);
  color: #fff;
}

.wcag-widget__title {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.1;
}

.wcag-widget__subtitle {
  display: inline-block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wcag-widget__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
}

.wcag-widget__body {
  display: grid;
}

.wcag-widget__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px 22px;
  border-top: 1px solid rgba(217, 233, 240, 0.9);
}

.wcag-widget__label {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--wcag-widget-text);
}

.wcag-widget__label svg {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  color: var(--wcag-widget-blue-dark);
}

.wcag-widget__label strong {
  display: block;
  font-size: 1.02rem;
  line-height: 1.3;
}

.wcag-widget__label small {
  display: block;
  margin-top: 4px;
  color: var(--wcag-widget-muted);
  line-height: 1.4;
}

.wcag-widget__switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 84px;
  height: 46px;
  padding: 4px;
  border: 0;
  border-radius: 999px;
  background: #b8c0ca;
  transition: background 0.2s ease;
}

.wcag-widget__switch::after {
  content: "";
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(18, 32, 51, 0.22);
  transform: translateX(0);
  transition: transform 0.2s ease;
}

.wcag-widget__switch[aria-pressed="true"] {
  background: #2a6fbe;
}

.wcag-widget__switch[aria-pressed="true"]::after {
  transform: translateX(38px);
}

.wcag-widget__font-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wcag-widget__font-btn {
  min-width: 58px;
  height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(31, 95, 147, 0.14);
  border-radius: 14px;
  background: #fff;
  color: var(--wcag-widget-blue-dark);
  font-weight: 800;
}

.wcag-widget__font-btn.is-active {
  background: rgba(31, 95, 147, 0.1);
  border-color: rgba(31, 95, 147, 0.3);
}

.wcag-widget__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 22px 22px;
  border-top: 1px solid rgba(217, 233, 240, 0.9);
}

.wcag-widget__btn {
  min-height: 58px;
  padding: 14px 18px;
  border-radius: 16px;
  font-weight: 800;
  border: 1px solid rgba(31, 95, 147, 0.16);
}

.wcag-widget__btn--ghost {
  background: #fff;
  color: var(--wcag-widget-text);
}

.wcag-widget__btn--primary {
  background: linear-gradient(135deg, var(--wcag-widget-blue) 0%, #2a6fbe 100%);
  border-color: transparent;
  color: #fff;
}

.wcag-widget__status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.wcag-links a:not(.btn):not(.nav-live-demo):not(.nav-cta):not(.wcag-widget__btn) {
  text-decoration: underline !important;
  text-underline-offset: 0.14em;
  text-decoration-thickness: 0.12em;
}

body.wcag-stop-animations *,
body.wcag-stop-animations *::before,
body.wcag-stop-animations *::after {
  animation: none !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

body.wcag-dark {
  --bg: #0d1520;
  --bg-gradient: linear-gradient(180deg, #101a27 0%, #0b131c 100%);
  --surface: #13202f;
  --surface-soft: #1b2c3f;
  --text: #f4f8fc;
  --muted: #bfd0e2;
  --primary: #7fc1ff;
  --primary-dark: #d9efff;
  --accent: #7fc1ff;
  --border: #294159;
}

body.wcag-dark .site-header,
body.wcag-dark .cookie-banner__content,
body.wcag-dark .hero-demo,
body.wcag-dark .premium-strip,
body.wcag-dark .premium-card,
body.wcag-dark .visual-card,
body.wcag-dark .image-card,
body.wcag-dark .contact-card,
body.wcag-dark .info-card,
body.wcag-dark .benefit-card,
body.wcag-dark .mini-card,
body.wcag-dark .nav-dropdown__menu {
  background: #13202f !important;
  color: #f4f8fc !important;
  border-color: #294159 !important;
}

body.wcag-dark .site-nav a,
body.wcag-dark .nav-dropdown__toggle,
body.wcag-dark .footer-copy,
body.wcag-dark .footer-copy a,
body.wcag-dark .footer-top,
body.wcag-dark .cookie-banner__text p,
body.wcag-dark .premium-card p,
body.wcag-dark .hero-tags span {
  color: #f4f8fc !important;
}

body.wcag-dark .btn-secondary,
body.wcag-dark .cookie-btn-settings,
body.wcag-dark .wcag-widget__btn--ghost,
body.wcag-dark .wcag-widget__font-btn {
  background: #13202f;
  color: #f4f8fc;
  border-color: #36577a;
}

body.wcag-dark .hero-tags span {
  background: #13202f;
  border-color: #294159;
}

body.wcag-contrast {
  --bg: #ffffff;
  --bg-gradient: linear-gradient(180deg, #ffffff 0%, #ffffff 100%);
  --surface: #ffffff;
  --surface-soft: #ffffff;
  --text: #000000;
  --muted: #000000;
  --primary: #0037ff;
  --primary-dark: #000000;
  --accent: #000000;
  --border: #000000;
}

body.wcag-contrast,
body.wcag-contrast p,
body.wcag-contrast li,
body.wcag-contrast h1,
body.wcag-contrast h2,
body.wcag-contrast h3,
body.wcag-contrast h4,
body.wcag-contrast strong,
body.wcag-contrast span,
body.wcag-contrast label,
body.wcag-contrast .site-nav a,
body.wcag-contrast .nav-dropdown__toggle,
body.wcag-contrast .footer-copy,
body.wcag-contrast .footer-copy a,
body.wcag-contrast .footer-top {
  color: #000 !important;
}

body.wcag-contrast .site-header,
body.wcag-contrast .hero-demo,
body.wcag-contrast .premium-card,
body.wcag-contrast .premium-strip,
body.wcag-contrast .visual-card,
body.wcag-contrast .image-card,
body.wcag-contrast .contact-card,
body.wcag-contrast .info-card,
body.wcag-contrast .benefit-card,
body.wcag-contrast .mini-card,
body.wcag-contrast .nav-dropdown__menu,
body.wcag-contrast .cookie-banner__content,
body.wcag-contrast .hero-tags span,
body.wcag-contrast .eyebrow,
body.wcag-contrast .section-label {
  background: #fff !important;
  color: #000 !important;
  border: 2px solid #000 !important;
  box-shadow: none !important;
}

body.wcag-contrast .btn-primary,
body.wcag-contrast .nav-cta,
body.wcag-contrast .nav-live-demo,
body.wcag-contrast .btn-live,
body.wcag-contrast .wcag-widget__btn--primary,
body.wcag-contrast .wcag-widget__header,
body.wcag-contrast .wcag-widget__trigger {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #000 !important;
  box-shadow: none !important;
}

body.wcag-contrast .btn-secondary,
body.wcag-contrast .cookie-btn-settings,
body.wcag-contrast .wcag-widget__btn--ghost,
body.wcag-contrast .wcag-widget__font-btn,
body.wcag-contrast .form-row input,
body.wcag-contrast .form-row select,
body.wcag-contrast .form-row textarea,
body.wcag-contrast .menu-toggle {
  background: #fff !important;
  color: #000 !important;
  border: 2px solid #000 !important;
  box-shadow: none !important;
}

body.wcag-contrast img {
  filter: contrast(1.12);
}

@media (max-width: 700px) {
  .wcag-widget {
    right: 10px;
    bottom: 10px;
  }

  .wcag-widget__trigger {
    width: 60px;
    height: 60px;
  }

  .wcag-widget__trigger svg {
    width: 28px;
    height: 28px;
  }

  .wcag-widget__panel {
    width: min(360px, calc(100vw - 12px));
    max-height: min(78vh, 620px);
    margin-right: 0;
    margin-bottom: 72px;
    border-radius: 20px;
    overflow: auto;
  }

  .wcag-widget__header {
    gap: 14px;
    padding: 16px 14px 12px;
  }

  .wcag-widget__title {
    font-size: 1.18rem;
  }

  .wcag-widget__subtitle {
    margin-top: 6px;
    font-size: 0.92rem;
  }

  .wcag-widget__close {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }

  .wcag-widget__row,
  .wcag-widget__actions {
    padding-left: 14px;
    padding-right: 14px;
  }

  .wcag-widget__row {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .wcag-widget__label {
    gap: 12px;
  }

  .wcag-widget__label svg {
    width: 24px;
    height: 24px;
  }

  .wcag-widget__label strong {
    font-size: 0.94rem;
  }

  .wcag-widget__label small {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .wcag-widget__switch {
    width: 68px;
    height: 38px;
    padding: 4px;
  }

  .wcag-widget__switch::after {
    width: 30px;
    height: 30px;
  }

  .wcag-widget__switch[aria-pressed="true"]::after {
    transform: translateX(30px);
  }

  .wcag-widget__font-size {
    justify-self: start;
    gap: 6px;
  }

  .wcag-widget__font-btn {
    min-width: 46px;
    height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 0.95rem;
  }

  .wcag-widget__actions {
    gap: 10px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .wcag-widget__btn {
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 0.95rem;
  }
}

@media (max-width: 420px) {
  .wcag-widget {
    right: 8px;
    bottom: 8px;
  }

  .wcag-widget__panel {
    width: calc(100vw - 8px);
    max-height: 74vh;
    margin-bottom: 68px;
  }

  .wcag-widget__header {
    padding: 14px 12px 10px;
  }

  .wcag-widget__row,
  .wcag-widget__actions {
    padding-left: 12px;
    padding-right: 12px;
  }

  .wcag-widget__actions {
    grid-template-columns: 1fr;
  }
}