/* Estilos adicionais para acessibilidade e melhorias */

/* Modo de alto contraste */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0D4E17;
        --secondary-color: #004D40;
        --text-dark: #000000;
        --text-light: #1B1B1B;
        --text-muted: #424242;
    }
    
    .btn {
        border-width: 3px;
        font-weight: 600;
    }
    
    .info-card,
    .documento-card {
        border: 2px solid var(--primary-color);
    }
}

/* Redução de movimento para usuários sensíveis */
@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-element {
        transform: none !important;
        opacity: 1 !important;
    }
}

/* Melhorias para leitores de tela */
.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;
}

.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--primary-color);
    color: white;
    z-index: 10001;
}

/* Skip links para navegação */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 10001;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Melhor contraste para links */
a {
    color: var(--secondary-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    text-decoration-thickness: 2px;
}

/* Estados de foco mais visíveis */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* Melhorias para botões */
button,
.btn {
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
}

button:disabled,
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading state para botões */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Melhorias para formulários */
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

input,
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
}

input:invalid,
textarea:invalid {
    border-color: #dc3545;
}

/* Mensagens de status */
.status-message {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Melhorias para tabelas */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: var(--light-bg);
    font-weight: 600;
    color: var(--text-dark);
}

tr:hover {
    background: rgba(0, 166, 81, 0.05);
}

/* Melhorias para modo escuro */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #ffffff;
        --lighter-bg: #f8f9fa;
        --text-dark: #1b1b1b;
        --text-light: #424242;
        --text-muted: #757575;
        --light-bg: #f5f5f5;
        --green-light-bg: #E8F5E8;
        --blue-light-bg: #E0F2F1;
    }
    
    .footer {
        background: var(--lighter-bg);
        color: var(--text-dark);
    }
    
    .info-card,
    .documento-card {
        background: var(--white);
        color: var(--text-dark);
        border: 1px solid var(--green-light-bg);
    }
    
    .info-card h3,
    .documento-card h3 {
        color: var(--text-dark);
    }
    
    .info-card p,
    .documento-card p {
        color: var(--text-light);
    }
}

/* Print styles */
@media print {
    .header,
    .footer,
    .btn,
    .cta-section,
    .reuniao-section {
        display: none !important;
    }
    
    .hero,
    .info-section,
    .documentos-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
        background: white;
    }
    
    h1, h2, h3 {
        color: black;
        page-break-after: avoid;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}

/* Prevenção de FOUC (Flash of Unstyled Content) */
.no-js body {
    visibility: hidden;
}

.js body {
    visibility: visible;
}

/* Lazy loading placeholder */
img[data-src] {
    filter: blur(5px);
    transition: filter 0.3s;
    background: #f0f0f0;
}

img[data-src].loaded {
    filter: none;
}

/* Utilidades de espaçamento */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }