/**
 * Estilos de acessibilidade e responsividade para a landing page Focol
 */

/* Skip to content link - visível apenas quando focado */
.skip-link {
  position: absolute;
  top: -44px;
  left: 0;
  background: var(--primary-dark);
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Foco visível apenas para navegação por teclado */
.keyboard-user a:focus,
.keyboard-user button:focus,
.keyboard-user input:focus,
.keyboard-user textarea:focus,
.keyboard-user [tabindex="0"]:focus {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

.keyboard-user :focus {
  outline: 3px solid #2070e0 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 3px rgba(32, 112, 224, 0.4) !important;
}

/* Esconde o contorno de foco para usuários de mouse */
:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

/* Estilos de acessibilidade para a landing page Focol */

/* Foco visível em elementos interativos para navegação por teclado */
:focus {
  outline: 3px solid #0050FF;
  outline-offset: 2px;
}

/* Remover outline de itens não interativos */
:focus:not(:focus-visible) {
  outline: none;
}

/* Garantir que o foco seja bem visível em elementos interativos */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex="0"]:focus {
  outline: 3px solid #0050FF;
  outline-offset: 2px;
}

/* Skip links para navegação por teclado */
.skip-link {
  background: #0050FF;
  color: white;
  font-weight: 700;
  left: 50%;
  padding: 0.5rem 1rem;
  position: absolute;
  transform: translateX(-50%) translateY(-100%);
  transition: transform 0.3s;
  z-index: 9999;
}

.skip-link:focus {
  transform: translateX(-50%) translateY(0%);
}

/* Quando usar o teclado, adicionar indicadores visuais adicionais */
body.keyboard-navigation a:focus,
body.keyboard-navigation button:focus,
body.keyboard-navigation input:focus,
body.keyboard-navigation select:focus,
body.keyboard-navigation textarea:focus,
body.keyboard-navigation [tabindex="0"]:focus {
  outline: 3px solid #0050FF;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(0, 80, 255, 0.2);
}

/* Melhorar visibilidade do texto para leitores de tela */
.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Texto visível apenas em leitores de tela, mas que aparece em foco */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Cores acessíveis com contraste adequado */
.text-contrast-improved {
  color: #14213d; /* Cor escura para texto com contraste melhorado */
}

.bg-contrast-improved {
  background-color: #f8f9fa; /* Fundo claro para melhorar legibilidade */
}

/* Melhorar contraste dos placeholders em formulários */
::placeholder {
  color: #6c757d;
  opacity: 0.8;
}

/* Indicadores de foco específicos para formulários */
.form-control:focus {
  border-color: #0050FF;
  box-shadow: 0 0 0 0.25rem rgba(0, 80, 255, 0.25);
}

.form-check-input:focus {
  border-color: #0050FF;
  box-shadow: 0 0 0 0.25rem rgba(0, 80, 255, 0.25);
}

/* Estado de foco para botões */
.btn:focus {
  box-shadow: 0 0 0 0.25rem rgba(0, 80, 255, 0.25);
}

/* Melhorar legibilidade de textos pequenos */
.small, small {
  font-size: 87.5%;
  font-weight: 400;
  line-height: 1.5;
}

/* Indicador visual de teclado ativo */
.keyboard-indicator {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  transition: transform 0.3s ease;
  background-color: #0050FF;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  font-weight: 600;
}

body.keyboard-navigation .keyboard-indicator {
  transform: translateX(-50%) translateY(0);
}

/* Melhorar leitura em telas pequenas */
@media (max-width: 576px) {
  html {
    font-size: 16px; /* Garantir tamanho de fonte mínimo legível */
  }
  
  input, select, textarea, button {
    font-size: 16px !important; /* Evitar zoom automático em iOS */
  }
}

/* Suporte de tema escuro para usuários que preferem */
@media (prefers-color-scheme: dark) {
  body.auto-dark-mode {
    background-color: #121212;
    color: #f8f9fa;
  }
  
  body.auto-dark-mode .bg-light {
    background-color: #1e1e1e !important;
  }
  
  body.auto-dark-mode .text-dark {
    color: #f8f9fa !important;
  }
  
  body.auto-dark-mode .border-light {
    border-color: #2d2d2d !important;
  }
  
  body.auto-dark-mode .card {
    background-color: #1e1e1e;
    border-color: #2d2d2d;
  }
  
  body.auto-dark-mode a:not(.btn) {
    color: #90caf9;
  }
}

/* Script para detecção de navegação por teclado */
/* Este script será acompanhado por JavaScript no arquivo main.js */
/*
document.addEventListener('keydown', function(e) {
  if (e.key === 'Tab') {
    document.body.classList.add('keyboard-navigation');
  }
});

document.addEventListener('mousedown', function() {
  document.body.classList.remove('keyboard-navigation');
});
*/

/* Esconder visualmente, mas manter para leitores de tela */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Melhorias para navegação móvel */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 70px;
    right: -250px;
    width: 250px;
    height: calc(100vh - 70px);
    background-color: var(--color-background);
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
  }
  
  .nav-links.active {
    right: 0;
  }
  
  .nav-links li {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    margin: 15px 0;
  }
  
  .nav-links.active li {
    opacity: 1;
    transform: translateX(0);
  }
  
  /* Atraso para cada item do menu aparecer sequencialmente */
  .nav-links li:nth-child(1) { transition-delay: 0.1s; }
  .nav-links li:nth-child(2) { transition-delay: 0.2s; }
  .nav-links li:nth-child(3) { transition-delay: 0.3s; }
  .nav-links li:nth-child(4) { transition-delay: 0.4s; }
  .nav-links li:nth-child(5) { transition-delay: 0.5s; }
  
  /* Estilo para o botão hamburguer */
  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    height: 24px;
    width: 30px;
    z-index: 1001;
  }
  
  .hamburger div {
    width: 100%;
    height: 3px;
    background-color: var(--color-text);
    border-radius: 3px;
    transition: all 0.3s ease;
  }
  
  /* Animação do hambúrguer para X */
  .hamburger.active div:nth-child(1) {
    transform: rotate(-45deg) translate(-6px, 6px);
  }
  
  .hamburger.active div:nth-child(2) {
    opacity: 0;
  }
  
  .hamburger.active div:nth-child(3) {
    transform: rotate(45deg) translate(-6px, -6px);
  }
  
  /* Ajuste para interface móvel */
  .nav-right {
    display: none;
  }
  
  body.nav-open {
    overflow: hidden;
  }
  
  /* Overlay escuro quando o menu está aberto */
  .nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .nav-overlay.active {
    display: block;
    opacity: 1;
  }

  .btn, 
  .nav-links a, 
  .plan-card-cta,
  input[type="submit"],
  select,
  .hamburger {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 16px;
  }
  
  /* Espaçamento vertical para formulários em mobile */
  form .form-group {
    margin-bottom: 16px;
  }
}

/* Melhorias para formulários e feedback visual */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group {
  position: relative;
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Estados de foco e hover para inputs */
.form-control:hover {
  border-color: #b0b6bc;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.25);
}

.form-control:focus {
  border-color: #2070e0;
  box-shadow: 0 0 0 3px rgba(32, 112, 224, 0.25);
}

.form-control.invalid {
  border-color: var(--color-error);
}

.form-control.invalid {
  border-color: #dc3545;
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3E%3Ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.error-message {
  color: var(--color-error);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.error-message {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #dc3545;
}

/* Tooltips de ajuda para campos de formulário */
.tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  background-color: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.875rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  width: 200px;
  z-index: 10;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 15px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.form-group:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

.success-message {
  text-align: center;
  padding: 2rem;
  background: var(--color-success-bg);
  border-radius: var(--border-radius);
  color: var(--color-success);
}

.success-message {
  text-align: center;
  padding: 30px 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.5s ease-in-out;
}

.success-message svg {
  color: var(--color-success);
  margin-bottom: 1rem;
}

.success-message svg {
  color: #28a745;
  margin-bottom: 15px;
}

.success-message h3 {
  margin-bottom: 10px;
  color: #28a745;
}

/* Lazy Loading de Imagens */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

img.lazy-loaded {
  opacity: 1;
}

img.lazy-loaded {
  opacity: 1;
}

/* Estilo temporário para placeholder de imagem */
.image-placeholder {
  background-color: #f0f0f0;
  display: inline-block;
  position: relative;
  overflow: hidden;
}

.image-placeholder {
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 150px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.image-placeholder::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s infinite;
}

.image-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Indicador de progresso de rolagem */
.scroll-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 1000;
}

.scroll-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.1);
}

.scroll-progress-bar {
  height: 100%;
  background: var(--color-primary);
  width: 0%;
  transition: width 0.1s ease-out;
}

.scroll-progress-bar {
  height: 100%;
  background-color: #2070e0;
  width: 0;
  transition: width 0.1s ease;
}

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner {
  animation: spin 1.2s linear infinite;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  stroke: var(--color-primary);
  transform-origin: center;
  stroke-linecap: round;
  fill: none;
  stroke-width: 4;
}

.spinner {
  animation: rotate 1.5s linear infinite;
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

.spinner circle {
  stroke: white;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 94, 94;
  stroke-dashoffset: 0;
  animation: dash 1.5s ease-in-out infinite;
  fill: none;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dashoffset: 94;
  }
  50% {
    stroke-dashoffset: 23.5;
  }
  100% {
    stroke-dashoffset: 94;
  }
}

.animate-in {
  opacity: 0;
}

.animate-in.visible {
  animation: fadeIn 0.6s ease-out forwards;
}

[class*="animate-in"] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[class*="animate-in"].visible {
  opacity: 1;
  transform: translateY(0);
}

/* Componentes com estilo de entrada diferente */
.feature-card.animate-in.visible {
  animation: slideInRight 0.5s ease-out forwards;
}

.hero-content h1.animate-in.visible,
.section-title.animate-in.visible {
  animation: slideInLeft 0.5s ease-out forwards;
}

/* Atrasos para animações sequenciais */
.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }

.animate-in-1 { transition-delay: 0.1s; }
.animate-in-2 { transition-delay: 0.2s; }
.animate-in-3 { transition-delay: 0.3s; }
.animate-in-4 { transition-delay: 0.4s; }

/* Reduz animações se o usuário preferir movimentos reduzidos */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .animate-in {
    opacity: 1;
  }
  
  img[loading="lazy"] {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  
  .feature-card:hover {
    transform: none;
  }
  
  .btn:hover, .btn:focus {
    transform: none;
  }
  
  .social-links a:hover {
    transform: none;
  }
  
  .whatsapp-fab:hover, .whatsapp-fab:focus {
    transform: none;
  }
}

/* Estilos para elementos de urgência (chamadas à ação) */
.urgency-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50px;
  margin-bottom: 0.75rem;
  background-color: var(--color-accent);
  color: white;
}

.urgency-badge {
  background-color: #f53d3d;
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 10px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.countdown-timer {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  margin: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

.countdown-timer {
  display: flex;
  align-items: center;
  background-color: #f8f9fa;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 15px 0;
  border-left: 4px solid #2070e0;
}

.countdown-timer svg {
  margin-right: 0.5rem;
}

.countdown-timer svg {
  margin-right: 10px;
  color: #2070e0;
}

#countdown-text {
  font-weight: 600;
  color: #343a40;
}

/* Estilos de acessibilidade para toque em dispositivos móveis */
@media (hover: none) and (pointer: coarse) {
  /* Aumentar áreas de toque para links e botões em dispositivos de toque */
  .nav-links a,
  .footer-links-group a,
  button,
  .btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Aumentar espaçamento entre links para evitar toques errados */
  .nav-links li,
  .footer-links-group li {
    margin: 12px 0;
  }
  
  /* Aumentar tamanho do botão de fechar para modais */
  .close-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Ajustes de acessibilidade pelo tamanho da tela */
@media (max-width: 480px) {
  .btn {
    width: 100%;
    margin: 0.5rem 0;
  }
  
  .cta-buttons {
    flex-direction: column;
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
}

/* Configurações de impressão */
@media print {
  .no-print, .no-print * {
    display: none !important;
  }
  
  header nav,
  .scroll-progress-container,
  footer,
  .social-share,
  .cta-buttons,
  .hamburger {
    display: none !important;
  }
  
  body {
    background-color: white !important;
    color: black !important;
  }
  
  a {
    text-decoration: underline;
    color: black !important;
  }
  
  .container {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
  }
  
  section {
    page-break-inside: avoid;
    margin: 20px 0 !important;
    padding: 0 !important;
  }
  
  /* Forçar quebra de página em seções principais */
  section {
    page-break-after: always;
  }
  
  /* Mostrar URLs após os links */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
  
  /* Adiciona URLs visíveis para links */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
  
  /* Não exibe URLs para links internos e de ancoragem */
  a[href^="#"]:after,
  a[href^="javascript:"]:after {
    content: "";
  }
}

/* Accessibility CSS */

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #0031AA;
    --primary-dark: #002480;
    --secondary-color: #CC4400;
    --text-dark: #000000;
    --text-light: #FFFFFF;
    --text-muted: #333333;
    --border-color: #000000;
  }

  /* Increase contrast for better readability */
  body {
    color: var(--text-dark);
    background-color: var(--text-light);
  }

  /* Enhance focus indicators */
  *:focus-visible {
    outline: 3px solid #000000;
    outline-offset: 3px;
  }

  /* Increase contrast for links */
  a {
    text-decoration: underline;
    color: #0000EE;
  }

  a:visited {
    color: #551A8B;
  }

  a:hover, a:focus {
    text-decoration: underline;
    color: #000088;
  }

  /* Enhance form elements */
  input, textarea, select, button {
    border: 2px solid #000000;
  }

  /* Improve button contrast */
  .btn-primary {
    background-color: #000088;
    color: #FFFFFF;
    border: 2px solid #000000;
  }

  .btn-secondary {
    background-color: #EEEEEE;
    color: #000000;
    border: 2px solid #000000;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  
  .feature-card:hover {
    transform: none;
  }
  
  .btn:hover, .btn:focus {
    transform: none;
  }
  
  .social-links a:hover {
    transform: none;
  }
  
  .whatsapp-fab:hover, .whatsapp-fab:focus {
    transform: none;
  }
}

/* Text zoom accessibility */
@media screen and (max-width: 991px) and (min-resolution: 1dppx) {
  html {
    /* Allow text to be resized up to 200% without breaking layout */
    font-size: 100%;
  }
  
  body {
    /* Improve readability on mobile */
    word-break: break-word;
    hyphens: auto;
  }
  
  /* Ensure buttons remain usable when text is enlarged */
  .btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0.75rem;
  }
  
  /* Ensure forms remain usable */
  input, 
  select,
  textarea {
    font-size: 1rem; /* Prevent iOS zoom on focus */
    min-height: 44px;
  }
}

/* Screen reader only utilities */
.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;
}

/* Make interactive elements more accessible */
button,
input,
select,
textarea,
[role="button"],
a.btn {
  min-height: 44px;
  min-width: 44px;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -44px;
  left: 0;
  background: var(--primary-dark);
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Table accessibility */
table {
  border-collapse: collapse;
  width: 100%;
}

th {
  text-align: left;
  font-weight: bold;
}

th, td {
  padding: 8px;
  border-bottom: 1px solid var(--border-color);
}

/* Caption for tables for screen readers */
caption {
  font-weight: bold;
  text-align: left;
  margin-bottom: 8px;
}

/* Accessible data visualizations */
.chart {
  position: relative;
}

.chart-description {
  margin-top: 8px;
  font-style: italic;
}

/* Use aria-hidden to hide decorative elements from screen readers */
.decorative-element[aria-hidden="true"] {
  /* styles */
}

/* ARIA landmark roles styling */
[role="complementary"],
[role="banner"],
[role="navigation"],
[role="main"],
[role="contentinfo"],
[role="search"] {
  margin-bottom: 16px;
}

/* Accessible Form validation */
input:invalid,
select:invalid,
textarea:invalid {
  border-color: var(--error-color);
}

.validation-message {
  color: var(--error-color);
  font-size: 0.875rem;
  margin-top: 4px;
}

/* Better contrast ratio for placeholder text */
::placeholder {
  color: #555;
  opacity: 1;
}

/* Melhorias de acessibilidade adicionais - 2025-05-11 */

/* Melhor contraste de texto para leitores com dificuldades visuais */
.text-enhanced-contrast {
  color: var(--text-dark);
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Melhorias no contraste para elementos de formulário */
.form-control::placeholder {
  color: #555;
  opacity: 1;
}

/* Melhorias para leitores de tela */
.screen-reader-description {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Botões e links acessíveis com teclas de acesso */
[accesskey]:after {
  content: " (" attr(accesskey) ")";
  font-size: 0.75em;
  vertical-align: super;
  color: var(--text-muted);
}

/* Indicadores direcionais para seguir leitura */
[aria-flowto]:after {
  content: " →";
}

/* Melhorias de acessibilidade para galerias de imagens */
.gallery-item img {
  border: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.gallery-item:focus img,
.gallery-item:focus-within img {
  border-color: var(--primary-color);
}

.gallery-item figcaption {
  margin-top: 8px;
  font-style: italic;
  font-size: 0.9em;
}

/* Melhorias para links de download */
a[download]:after {
  content: " ↓";
  font-size: 0.8em;
}

/* Indicação de links externos */
a[target="_blank"]:after {
  content: " ↗";
  font-size: 0.8em;
}

/* Suporte para temas de alto contraste do Windows */
@media screen and (-ms-high-contrast: active) {
  * {
    text-shadow: none !important;
  }
  
  button, .btn {
    border: 1px solid currentColor;
  }
}

/* Melhor suporte para leitores de tela */
.accordion-header button {
  width: 100%;
  text-align: left;
}

.accordion-header button[aria-expanded="true"]::before {
  content: "▼ ";
}

.accordion-header button[aria-expanded="false"]::before {
  content: "► ";
}

/* Melhorias para tabindex */
[tabindex]:not([tabindex="-1"]):focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* Melhorias para zonas de toque em dispositivos móveis */
@media (pointer: coarse) {
  .touch-target {
    min-height: 44px;
    min-width: 44px;
    padding: 12px;
  }
  
  .form-checkbox, .form-radio {
    transform: scale(1.25);
  }
  
  /* Aumentar checkbox e radio para facilitar o toque */
  input[type="checkbox"], 
  input[type="radio"] {
    min-width: 22px;
    min-height: 22px;
    margin-right: 8px;
  }
}

/* Adicionar transições suaves para estados de foco */
a, button, .btn, input, select, textarea {
  transition: outline 0.2s ease, box-shadow 0.2s ease;
}

/* Melhorias para pessoas com dificuldade em distinguir cores */
@media (prefers-contrast: more) {
  input:focus, 
  select:focus, 
  textarea:focus, 
  button:focus,
  a:focus {
    outline: 3px solid #000000 !important;
    outline-offset: 2px !important;
  }
  
  .btn-primary, 
  .btn-secondary {
    border: 2px solid #000000;
  }
  
  /* Não depender apenas de cores para transmitir informações */
  .error-message:before {
    content: "⚠ ";
  }
  
  .success-message:before {
    content: "✓ ";
  }
}

/* Indicador de aria-required para campos obrigatórios */
[aria-required="true"] + label:after {
  content: " *";
  color: var(--error-color);
}

/* Feedback visual para campos obrigatórios */
.form-label .required {
  color: var(--error-color);
  margin-left: 4px;
}

/* Melhorias para botões e CTAs */
.btn-large {
  padding: 14px 24px;
  font-size: 1.2rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  margin-right: 8px;
}

/* Melhorias para navegação com teclado */
.keyboard-nav-indicator {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  z-index: 9999;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

body.keyboard-user .keyboard-nav-indicator {
  opacity: 1;
}

/* Melhorias para links pular navegação */
.skip-links {
  position: absolute;
  top: -1000px;
  left: 0;
  width: 100%;
  z-index: 9999;
  padding: 0;
  margin: 0;
  list-style: none;
}

.skip-links a {
  position: absolute;
  top: 0;
  left: 0;
  padding: 10px 15px;
  background: var(--primary-dark);
  color: white;
  font-weight: bold;
  text-decoration: none;
}

.skip-links a:focus {
  top: 1000px;
}

/* Melhorias para formulários acessíveis */
fieldset {
  border: 1px solid var(--border-color);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 6px;
}

legend {
  padding: 0 10px;
  font-weight: bold;
}

/* Acessibilidade para tooltips */
.tooltip {
  display: none;
  position: absolute;
  z-index: 100;
  padding: 8px 12px;
  background: #333;
  color: white;
  border-radius: 4px;
  max-width: 200px;
}

.tooltip[data-visible="true"] {
  display: block;
}

.tooltip-trigger:hover + .tooltip,
.tooltip-trigger:focus + .tooltip {
  display: block;
}

/* Contraste adequado para textos sobre imagens */
.text-on-image {
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.dark-overlay {
  position: relative;
}

.dark-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1;
}

.dark-overlay > * {
  position: relative;
  z-index: 2;
}

/* Melhorias para indicadores de status ARIA */
[aria-busy="true"]::after {
  content: "Carregando...";
  display: inline-block;
  margin-left: 8px;
  font-size: 0.9em;
  font-style: italic;
}

/* Suporte para tamanhos de texto grandes */
@media screen and (min-width: 992px) {
  html {
    font-size: calc(16px + 0.2vw);
  }
}

/* Suporte para navegação por voz */
[data-voice-command]:before {
  content: attr(data-voice-command);
  display: block;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8em;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

@media speech {
  [data-voice-command]:hover:before {
    opacity: 1;
  }
}