/* ============================================
   ACCESSIBILITY & UI UTILITIES
   ============================================ */

:root {
  --a11y-panel-width: min(1040px, calc(100vw - 40px));
  --a11y-panel-bg: #edf2f8;
  --a11y-hero-bg: var(--secondary-color, #06273b);
  --a11y-surface: #ffffff;
  --a11y-card-bg: #f5f8fc;
  --a11y-card-border: rgba(15, 28, 44, 0.08);
  --a11y-card-hover: #eef4fa;
  --a11y-accent: var(--primary-color, #265eea);
  --a11y-text: #182433;
  --a11y-text-muted: #6e7a8b;
  --a11y-shadow: 0 32px 70px rgba(7, 22, 36, 0.28);
  --a11y-radius-xl: 34px;
  --a11y-radius-lg: 28px;
  --a11y-radius-md: 20px;
  --a11y-transition: 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  --wa-green: #25D366;
  --wa-green-hover: #20bd5a;
}

.a11y-trigger {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 999999;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.25s ease, filter 0.25s ease;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.25));
}

.a11y-trigger:hover {
  transform: scale(1.08);
}

.a11y-trigger:focus-visible {
  outline: 3px solid var(--a11y-accent);
  outline-offset: 4px;
}

.a11y-trigger-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  pointer-events: none;
}

.a11y-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 17, 28, 0.45);
  z-index: 999998;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--a11y-transition), visibility var(--a11y-transition);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.a11y-overlay.active {
  opacity: 1;
  visibility: visible;
}

.a11y-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: min(700px, calc(100vw - 24px));
  height: 100vh;
  height: 100dvh;
  background: var(--a11y-panel-bg);
  z-index: 999999;
  border-radius: 0 var(--a11y-radius-xl) var(--a11y-radius-xl) 0;
  box-shadow: var(--a11y-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  opacity: 1;
  visibility: visible;
  transition: transform var(--a11y-transition);
}

.a11y-panel.open {
  transform: translateX(0);
}

.a11y-panel-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background: linear-gradient(to bottom, var(--a11y-hero-bg) 0 330px, var(--a11y-panel-bg) 330px 100%);
}

.a11y-panel-scroll::-webkit-scrollbar {
  width: 10px;
}

.a11y-panel-scroll::-webkit-scrollbar-thumb {
  background: rgba(24, 36, 51, 0.16);
  border-radius: 999px;
}

/* Lock both roots to avoid browser-specific modal glitches. */
html.a11y-panel-open,
body.a11y-panel-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

.a11y-panel-hero {
  padding: 26px 28px 0;
  color: #fff;
}

.a11y-panel-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
}

.a11y-lang-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: calc(100% - 72px);
}

.a11y-lang-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background var(--a11y-transition), border-color var(--a11y-transition), transform var(--a11y-transition);
}

.a11y-lang-card:hover {
  background: rgba(255, 255, 255, 0.18);
}

.a11y-lang-card.active {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.2);
}

.a11y-lang-card:focus-visible,
.a11y-panel-close:focus-visible,
.a11y-card:focus-visible,
.a11y-stepper-btn:focus-visible,
.a11y-reset-btn:focus-visible {
  outline: 2px solid var(--a11y-accent);
  outline-offset: 2px;
}

.a11y-lang-flag {
  font-size: 19px;
  line-height: 1;
}

.a11y-lang-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.a11y-lang-check {
  color: #fff;
  opacity: 0;
  margin-left: 2px;
}

.a11y-lang-card.active .a11y-lang-check {
  opacity: 1;
}

.a11y-panel-close {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.a11y-panel-close svg {
  width: 24px;
  height: 24px;
}

.a11y-panel-hero-icon {
  width: 90px;
  height: 90px;
  display: block;
  margin: 0 auto 26px;
  border-radius: 999px;
  padding: 14px;
}

.a11y-panel-hero-title {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
  text-align: center;
  color: #fff;
}

.a11y-panel-hero-subtitle {
  margin: 20px 0 38px;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 22px;
}

.a11y-panel-hero-subtitle span {
  text-decoration: underline;
}

.a11y-section {
  margin: 0 24px 24px;
  padding: 28px;
  background: var(--a11y-surface);
  border-radius: var(--a11y-radius-lg);
  background: #dadada !important;
  top: 60px !important;
}

.a11y-section-title {
  margin: 0 0 22px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--a11y-text);
}

.a11y-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.a11y-grid--content .a11y-card--stepper {
  grid-column: span 2;
}

.a11y-card {
  min-height: 230px;
  padding: 26px 22px 24px;
  border-radius: var(--a11y-radius-md);
  background: var(--a11y-card-bg);
  border: 1px solid var(--a11y-card-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  text-align: center;
  cursor: pointer;
  transition: transform var(--a11y-transition), border-color var(--a11y-transition), box-shadow var(--a11y-transition), background var(--a11y-transition);
}

.a11y-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(14, 31, 49, 0.08);
}

.a11y-card.active {
  border-color: #0a2031;
  box-shadow: inset 0 0 0 3px #0a2031;
}

.a11y-card-icon {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--a11y-text);
}

.a11y-card-icon svg {
  width: 40px;
  height: 40px;
  fill: currentColor;
}

.a11y-card-label {
  color: var(--a11y-text);
  font-size: 19px;
  line-height: 1.35;
  font-weight: 500;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.a11y-card--stepper {
  align-items: stretch;
}

.a11y-card--stepper .a11y-card-icon,
.a11y-card--stepper .a11y-card-label {
  align-self: center;
}

.a11y-stepper {
  margin-top: auto;
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 0 12px;
}

.a11y-stepper-btn {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: none;
  background: #041b2d;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.a11y-stepper-btn svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.a11y-stepper-value,
.a11y-card-badge {
  min-height: 56px;
  padding: 0 18px;
  border-radius: 999px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--a11y-text);
  font-size: 19px;
  font-weight: 600;
}

.a11y-card-badge {
  margin-top: auto;
}

.a11y-section--reset {
  padding: 0;
  background: transparent;
}

.a11y-reset-btn {
  width: 100%;
  min-height: 94px;
  border-radius: 20px;
  border: none;
  background: #041b2d;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 27px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.a11y-reset-btn svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.wa-float {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 99999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--wa-green);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
  transition: transform var(--a11y-transition), box-shadow var(--a11y-transition);
  text-decoration: none;
}

.wa-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}

.wa-float svg {
  width: 30px;
  height: 30px;
  fill: #fff;
}

.wa-float-tooltip {
  position: absolute;
  right: 68px;
  top: 50%;
  transform: translateY(-50%);
  background: #333;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
}

.wa-float:hover .wa-float-tooltip {
  opacity: 1;
  visibility: visible;
}

.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99998;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #000000;
  border: 2px solid var(--secondary-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity var(--a11y-transition), visibility var(--a11y-transition), transform var(--a11y-transition), background var(--a11y-transition), border-color var(--a11y-transition);
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

body.a11y-readable-font,
body.a11y-readable-font * {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important;
}

body.a11y-bold-text *:not(script):not(style) {
  font-weight: bold !important;
}

body.a11y-big-cursor,
body.a11y-big-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M7 2l12 11.2-5.8.5 3.3 7.3-2.2 1-3.2-7.4L7 18.5V2' fill='%23000' stroke='%23fff' stroke-width='1'/%3E%3C/svg%3E") 4 2, auto !important;
}

body.a11y-align-left * { text-align: left !important; }
body.a11y-align-center * { text-align: center !important; }
body.a11y-align-justify * { text-align: justify !important; }
body.a11y-color-light { filter: brightness(1.06) contrast(1.05); }
body.a11y-color-high { filter: contrast(1.2) saturate(1.05); }
body.a11y-color-mono { filter: grayscale(1); }
body.a11y-hide-images img { visibility: hidden !important; }
body.a11y-highlight-links a { text-decoration: underline 3px solid currentColor !important; }
body.a11y-stop-animations *,
body.a11y-stop-animations *::before,
body.a11y-stop-animations *::after {
  animation: none !important;
  transition: none !important;
}

#back-to-top {
  display: none !important;
}

@media (max-width: 991.98px) {
  .a11y-panel {
    width: min(92vw, 860px);
  }

  .a11y-panel-hero-title {
    font-size: 44px;
  }

  .a11y-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .a11y-grid--content .a11y-card--stepper {
    grid-column: span 2;
  }
}

@media (max-width: 767.98px) {
  .a11y-panel {
    width: calc(100vw - 12px);
    border-radius: 0 24px 24px 0;
  }

  .a11y-panel-scroll {
    background: linear-gradient(to bottom, var(--a11y-hero-bg) 0 240px, var(--a11y-panel-bg) 240px 100%);
  }

  .a11y-panel-hero {
    padding: 18px 14px 0;
  }

  .a11y-panel-topbar {
    margin-bottom: 24px;
  }

  .a11y-lang-list {
    max-width: calc(100% - 56px);
  }

  .a11y-lang-card {
    padding: 8px 12px;
  }

  .a11y-lang-name {
    font-size: 14px;
  }

  .a11y-panel-close {
    width: 42px;
    height: 42px;
  }

  .a11y-panel-hero-icon {
    width: 72px;
    height: 72px;
  }

  .a11y-panel-hero-title {
    font-size: 34px;
  }

  .a11y-panel-hero-subtitle {
    font-size: 18px;
  }

  .a11y-section {
    margin: 0 12px 16px;
    padding: 18px;
  }

  .a11y-section-title {
    font-size: 22px;
  }

  .a11y-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .a11y-grid--content .a11y-card--stepper {
    grid-column: auto;
  }

  .a11y-card {
    min-height: 200px;
  }

  .a11y-reset-btn {
    min-height: 78px;
    font-size: 22px;
  }

  .wa-float-tooltip {
    display: none;
  }
}

@media print {
  .a11y-trigger,
  .a11y-panel,
  .a11y-overlay,
  .wa-float,
  .scroll-top-btn {
    display: none !important;
  }
}
