/* Dostępność — WCAG 2.1 (poziom AA, elementy AAA gdzie możliwe) */

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(31, 31, 31, 0.2);
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 16px;
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

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

/* Wyraźny fokus klawiatury */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

.main-nav a:focus-visible {
  border-radius: 8px;
}

/* Linki w treści — lepiej widoczne */
.legal-prose a,
.faq-answer a,
.form-check a,
.about-lead a,
.footer-legal a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-prose a:hover,
.faq-answer a:hover,
.form-check a:hover {
  color: var(--blue-dark, #5a9fbf);
}

/* Minimalny cel dotykowy 44×44 px */
.nav-toggle,
.reviews-nav,
.float-call,
.float-a11y-toggle,
.cookie-accept,
.btn-nav-cta,
.btn-hero-primary,
.btn-hero-outline,
.btn-call {
  min-height: 44px;
  min-width: 44px;
}

.nav-toggle { justify-content: center; align-items: center; }

/* Aktywna strona w menu */
.main-nav a[aria-current="page"] {
  color: var(--blue);
  font-weight: 600;
}

/* Formularze — wyraźne wymagane pola */
.site-form input[aria-required="true"]:invalid:not(:placeholder-shown),
.site-form textarea[aria-required="true"]:invalid:not(:placeholder-shown) {
  border-color: #c0392b;
}
.form-alert[role="alert"] {
  border-left: 4px solid #c0392b;
}

/* Karuzela opinii */
.reviews-slider-wrap [aria-live] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* FAQ — lepszy fokus na summary */
.faq-item summary:focus-visible {
  background: var(--blue-light);
}

/* Cookie banner — czytelny dialog */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner:not([hidden]) {
  outline: none;
}

/* Wysoki kontrast (systemowy) */
@media (prefers-contrast: more) {
  :root {
    --line: rgba(31, 31, 31, 0.25);
    --ink-dim: rgba(31, 31, 31, 0.85);
  }
  .header-inner,
  .form-card,
  .faq-item,
  .feature-col {
    border-width: 2px;
  }
  :focus-visible {
    outline-width: 4px;
  }
}

/* Zmniejszone animacje */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skip-link { transition: none; }
  .has-js .reveal,
  .has-js .page-home .reveal-stagger > .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-orb,
  .prep-card-icon,
  .prep-timeline::before,
  .float-call {
    animation: none !important;
  }
}

/* Powiększenie tekstu — lepsze łamanie */
@media (min-width: 1px) {
  html { text-size-adjust: 100%; }
}

/* ── Pływający przycisk dostępności ── */
.float-a11y {
  position: relative;
}
.float-a11y-toggle {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--blue);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(111, 175, 207, 0.45);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  animation: floatCallIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.float-a11y-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.float-a11y-toggle:hover,
.float-a11y-toggle[aria-expanded="true"] {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 40px rgba(111, 175, 207, 0.5);
  background: var(--blue-dark);
  color: #fff;
}
.float-a11y-toggle:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.float-a11y-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  z-index: 10;
  min-width: 300px;
}
.float-a11y-panel[hidden] {
  display: none !important;
}
.float-a11y-panel-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line-blue);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(31, 31, 31, 0.16);
}
.a11y-btn {
  appearance: none;
  -webkit-appearance: none;
  min-height: 40px;
  min-width: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.a11y-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.a11y-btn[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.a11y-btn-reset {
  font-weight: 500;
  color: var(--ink-dim);
}
.a11y-btn-reset:hover {
  color: var(--ink);
}

@media (max-width: 640px) {
  .float-a11y-panel {
    right: 0;
    min-width: 260px;
  }
}

/* ── Tryby z paska dostępności ── */

/* Powiększenie tekstu */
html.a11y-text-large {
  zoom: 1.15;
}
html.a11y-text-xlarge {
  zoom: 1.3;
}
@supports not (zoom: 1) {
  html.a11y-text-large { font-size: 115%; }
  html.a11y-text-xlarge { font-size: 130%; }
}

/* Wysoki kontrast (ręczny) */
html.a11y-contrast {
  --ink: #000000;
  --ink-dim: #111111;
  --line: rgba(0, 0, 0, 0.35);
  --blue: #005a9e;
  --blue-dark: #003d6b;
  --blue-light: rgba(0, 90, 158, 0.12);
}
html.a11y-contrast body {
  background: #fff;
  color: #000;
}
html.a11y-contrast a:not(.a11y-btn):not(.btn-hero-primary):not(.btn-hero-outline):not(.btn-call) {
  text-decoration: underline;
  text-underline-offset: 3px;
}
html.a11y-contrast .header-inner,
html.a11y-contrast .form-card,
html.a11y-contrast .faq-item,
html.a11y-contrast .feature-col,
html.a11y-contrast .service-card,
html.a11y-contrast .review-card,
html.a11y-contrast .contact-info-card,
html.a11y-contrast .prep-card,
html.a11y-contrast .a11y-btn {
  border-width: 2px !important;
  border-color: #000 !important;
}
html.a11y-contrast :focus-visible {
  outline-width: 4px;
  outline-color: #000;
}

/* Wyłączenie animacji (ręczne) */
html.a11y-no-motion {
  scroll-behavior: auto !important;
}
html.a11y-no-motion *,
html.a11y-no-motion *::before,
html.a11y-no-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}
html.a11y-no-motion .has-js .reveal,
html.a11y-no-motion .has-js .page-home .reveal-stagger > .reveal {
  opacity: 1 !important;
  transform: none !important;
}
html.a11y-no-motion .hero-orb,
html.a11y-no-motion .prep-card-icon,
html.a11y-no-motion .prep-timeline::before,
html.a11y-no-motion .float-call,
html.a11y-no-motion .prep-tip-icon {
  animation: none !important;
}
html.a11y-no-motion .a11y-btn {
  transition: none;
}
