/* Panou accesibilitate — WCAG 2.1 AA (preferințe utilizator) */

.a11y-trigger {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #0b57d0;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(11, 87, 208, 0.45);
}

.a11y-trigger:hover,
.a11y-trigger:focus-visible {
  background: #083b8a;
  outline: 3px solid #f4b400;
  outline-offset: 2px;
}

.a11y-trigger-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  line-height: 1;
}

.a11y-panel {
  position: fixed;
  left: 16px;
  bottom: 80px;
  z-index: 9998;
  width: min(360px, calc(100vw - 32px));
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 18px;
  border: 2px solid #0b57d0;
  border-radius: 18px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}

.a11y-panel[hidden] {
  display: none !important;
}

.a11y-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.a11y-panel-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #0b57d0;
}

.a11y-close {
  border: 0;
  background: #e8f0fe;
  color: #0b57d0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.a11y-close:focus-visible {
  outline: 3px solid #f4b400;
}

.a11y-group {
  margin-bottom: 14px;
}

.a11y-group-title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.a11y-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.a11y-btn {
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.a11y-btn:hover {
  background: #e8f0fe;
  border-color: #0b57d0;
}

.a11y-btn[aria-pressed="true"] {
  background: #0b57d0;
  border-color: #0b57d0;
  color: #fff;
}

.a11y-btn:focus-visible {
  outline: 3px solid #f4b400;
  outline-offset: 2px;
}

.a11y-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  font-size: 0.85rem;
}

.a11y-footer a {
  color: #0b57d0;
  font-weight: 700;
}

/* Preferințe aplicate pe document */

html.a11y-font-md {
  font-size: 106.25%;
}

html.a11y-font-lg {
  font-size: 118.75%;
}

html.a11y-font-xl {
  font-size: 131.25%;
}

html.a11y-readable-font body {
  font-family: Arial, Helvetica, sans-serif !important;
}

html.a11y-spacing body {
  letter-spacing: 0.04em;
  line-height: 1.85 !important;
}

html.a11y-spacing p,
html.a11y-spacing li {
  margin-bottom: 1.1em;
}

html.a11y-underline-links a {
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

html.a11y-large-cursor,
html.a11y-large-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath fill='%23000' d='M2 2l8 24 4-10 10-4z'/%3E%3C/svg%3E") 2 2, auto !important;
}

html.a11y-grayscale body {
  filter: grayscale(100%);
}

html.a11y-invert body {
  filter: invert(1) hue-rotate(180deg);
}

html.a11y-invert body img,
html.a11y-invert body video,
html.a11y-invert body iframe {
  filter: invert(1) hue-rotate(180deg);
}

html.a11y-high-contrast {
  --bg: #000;
  --surface: #000;
  --text: #fff;
  --muted: #e5e7eb;
  --primary: #ffff00;
  --primary-dark: #ffff00;
  --accent: #ffff00;
  --border: #fff;
}

html.a11y-high-contrast .header {
  background: #000 !important;
  border-bottom-color: #fff !important;
}

html.a11y-high-contrast .footer {
  background: #000 !important;
  color: #fff !important;
}

html.a11y-high-contrast .btn-primary {
  background: #ffff00 !important;
  color: #000 !important;
}

html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

@media (max-width: 600px) {
  .a11y-trigger-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .a11y-trigger {
    padding: 14px;
    border-radius: 50%;
  }
}
