/* ===========================
   Accessibility Widget
   Adir Saban Fitness
   =========================== */

/* --- Skip to content --- */
.skip-link {
  position: absolute;
  top: -100px;
  right: 16px;
  background: var(--dark-red);
  color: var(--off-white);
  padding: 12px 24px;
  border-radius: var(--radius);
  z-index: 10000;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 16px;
  outline: 3px solid var(--cream);
  outline-offset: 2px;
}

/* --- Toggle Button --- */
.a11y-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  background: #1a4d9e;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(26, 77, 158, 0.4);
  z-index: 998;
  transition: var(--transition);
}
.a11y-toggle:hover,
.a11y-toggle:focus {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(26, 77, 158, 0.6);
  outline: 3px solid var(--cream);
  outline-offset: 2px;
}
.a11y-toggle svg {
  width: 28px;
  height: 28px;
}

/* Move back-to-top up so it doesn't overlap */
.back-to-top {
  bottom: 90px !important;
}

/* --- Panel --- */
.a11y-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 340px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 140px);
  background: var(--gray-900);
  border: 1px solid var(--gray-700);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  padding: 20px;
  overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.3s;
}
.a11y-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

.a11y-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gray-800);
  margin-bottom: 14px;
}
.a11y-header h3 {
  font-size: 1.1rem;
  color: var(--off-white);
  font-weight: 700;
}
.a11y-close {
  background: transparent;
  border: none;
  color: var(--gray-300);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition);
}
.a11y-close:hover,
.a11y-close:focus {
  background: var(--gray-800);
  color: var(--off-white);
  outline: 2px solid var(--cream);
}

.a11y-section {
  margin-bottom: 16px;
}
.a11y-section-title {
  font-size: 0.8rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  font-weight: 600;
}
.a11y-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.a11y-btn {
  background: var(--gray-800);
  border: 1px solid var(--gray-700);
  color: var(--off-white);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
}
.a11y-btn:hover,
.a11y-btn:focus {
  background: var(--gray-700);
  border-color: var(--dark-red);
  outline: 2px solid var(--cream);
  outline-offset: 1px;
}
.a11y-btn.active {
  background: var(--dark-red);
  border-color: var(--dark-red);
  color: var(--off-white);
}
.a11y-btn-full {
  grid-column: 1 / -1;
}

.a11y-reset {
  width: 100%;
  background: transparent;
  border: 1px solid var(--gray-700);
  color: var(--gray-300);
  padding: 10px;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px;
}
.a11y-reset:hover,
.a11y-reset:focus {
  background: var(--gray-800);
  color: var(--off-white);
  outline: 2px solid var(--cream);
}

.a11y-footer {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--gray-800);
  text-align: center;
}
.a11y-footer a {
  color: var(--cream);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: underline;
}
.a11y-footer a:hover,
.a11y-footer a:focus {
  color: var(--off-white);
}

/* --- Applied Modes --- */
body.a11y-font-large { font-size: 115%; }
body.a11y-font-xlarge { font-size: 130%; }
body.a11y-font-xxlarge { font-size: 150%; }

body.a11y-high-contrast {
  background: #000 !important;
  color: #fff !important;
}
body.a11y-high-contrast * {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}
body.a11y-high-contrast a,
body.a11y-high-contrast .btn-primary,
body.a11y-high-contrast .a11y-btn.active {
  color: #ffff00 !important;
  text-decoration: underline !important;
}
body.a11y-high-contrast img,
body.a11y-high-contrast svg {
  filter: grayscale(1) contrast(1.2);
}

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

body.a11y-grayscale {
  filter: grayscale(1);
}

body.a11y-highlight-links a {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
  outline: 2px solid var(--cream);
  outline-offset: 2px;
  padding: 2px 4px;
  border-radius: 4px;
}

body.a11y-highlight-headings h1,
body.a11y-highlight-headings h2,
body.a11y-highlight-headings h3,
body.a11y-highlight-headings h4 {
  outline: 2px dashed var(--cream);
  outline-offset: 4px;
  padding: 4px;
}

body.a11y-readable-font,
body.a11y-readable-font * {
  font-family: Arial, "Segoe UI", Tahoma, sans-serif !important;
  letter-spacing: 0.5px !important;
  word-spacing: 2px !important;
  line-height: 1.9 !important;
}

body.a11y-no-animations *,
body.a11y-no-animations *::before,
body.a11y-no-animations *::after {
  animation-duration: 0.001s !important;
  animation-delay: 0s !important;
  transition-duration: 0.001s !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}

body.a11y-big-cursor,
body.a11y-big-cursor * {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'><path fill='white' stroke='black' stroke-width='2' d='M6 6 L6 38 L14 30 L20 42 L26 40 L20 28 L32 28 Z'/></svg>") 0 0, auto !important;
}

/* Focus visible for all interactive elements - improved */
body :focus-visible {
  outline: 3px solid var(--cream) !important;
  outline-offset: 2px !important;
  border-radius: 4px;
}

/* Respect user's reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}

/* --- Mobile --- */
@media (max-width: 480px) {
  .a11y-panel {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 84px;
  }
  .a11y-toggle {
    width: 48px;
    height: 48px;
    bottom: 16px;
    right: 16px;
  }
  .a11y-toggle svg {
    width: 24px;
    height: 24px;
  }
}

/* --- Legal Pages --- */
.legal-page {
  padding: 140px 0 80px;
  min-height: 100vh;
}
.legal-page h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
  color: var(--off-white);
}
.legal-page .legal-subtitle {
  color: var(--gray-400);
  margin-bottom: 40px;
  font-size: 1rem;
}
.legal-page h2 {
  font-size: 1.5rem;
  margin-top: 40px;
  margin-bottom: 16px;
  color: var(--cream);
}
.legal-page h3 {
  font-size: 1.15rem;
  margin-top: 24px;
  margin-bottom: 12px;
  color: var(--off-white);
}
.legal-page p,
.legal-page li {
  color: var(--gray-300);
  line-height: 1.9;
  margin-bottom: 12px;
  font-size: 1rem;
}
.legal-page ul,
.legal-page ol {
  padding-right: 24px;
  margin-bottom: 16px;
}
.legal-page li {
  list-style: disc;
  margin-bottom: 8px;
}
.legal-page ol li {
  list-style: decimal;
}
.legal-page a {
  color: var(--cream);
  text-decoration: underline;
}
.legal-page a:hover {
  color: var(--off-white);
}
.legal-contact-box {
  background: var(--gray-900);
  border: 1px solid var(--gray-700);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
}
.legal-contact-box strong {
  color: var(--off-white);
}
.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  color: var(--cream);
  font-weight: 600;
}

/* --- Service card CTA --- */
.service-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 14px 32px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 6px 20px rgba(87, 6, 6, 0.35);
  transition: var(--transition);
}
.service-card-cta:hover,
.service-card-cta:focus {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(87, 6, 6, 0.55);
}
.service-card-cta-arrow {
  transition: transform 0.25s ease;
}
.service-card-cta:hover .service-card-cta-arrow {
  transform: translateX(-6px);
}

/* --- Process Section --- */
.process-section {
  background: linear-gradient(180deg, var(--black) 0%, var(--gray-900) 50%, var(--black) 100%);
  position: relative;
}
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 50px;
}
.process-step {
  position: relative;
  padding: 32px 24px 28px;
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}
.process-step:hover {
  border-color: var(--dark-red);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.process-num {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--dark-red);
  margin-bottom: 12px;
  font-family: var(--font-main);
  letter-spacing: -2px;
}
.process-step h3 {
  font-size: 1.3rem;
  color: var(--off-white);
  margin-bottom: 12px;
}
.process-step p {
  color: var(--gray-300);
  font-size: 0.95rem;
  line-height: 1.75;
}

@media (max-width: 1024px) {
  .process-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .process-grid { grid-template-columns: 1fr; gap: 16px; }
  .process-num { font-size: 2.8rem; }
}

/* --- Services CTA --- */
.services-cta {
  margin-top: 50px;
  text-align: center;
  padding: 40px 24px;
  background: linear-gradient(135deg, rgba(87, 6, 6, 0.15), rgba(87, 6, 6, 0.05));
  border: 1px solid var(--gray-800);
  border-radius: var(--radius-lg);
}
.services-cta p {
  font-size: 1.3rem;
  color: var(--off-white);
  font-weight: 600;
  margin-bottom: 20px;
}
@media (max-width: 480px) {
  .services-cta p { font-size: 1.1rem; }
}

/* --- Footer Legal Links --- */
.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 24px 0 16px;
  border-top: 1px solid var(--gray-800);
  margin-top: 40px;
}
.footer-legal-links a {
  color: var(--gray-300);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}
.footer-legal-links a:hover,
.footer-legal-links a:focus {
  color: var(--cream);
  text-decoration: underline;
}
.footer-legal-links span {
  color: var(--gray-700);
}
