/* COMPATIBILIDADE DE FONTES UNIVERSAL */
/* Garantindo que as fontes funcionem em todos os navegadores e sistemas */

/* Definição de fontes com fallbacks completos */
:root {
    --font-primary: 'Segoe UI', 'Segoe UI Web', 'Segoe UI Symbol', 'Helvetica Neue', 'Helvetica', 'Arial', 'Roboto', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Liberation Sans', 'Nimbus Sans L', sans-serif;
    --font-monospace: 'Segoe UI Mono', 'Roboto Mono', 'Ubuntu Mono', 'Consolas', 'Courier New', 'Liberation Mono', 'DejaVu Sans Mono', monospace;
}

/* Aplicar fontes universais */
body, html {
    font-family: var(--font-primary) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'kern' 1;
    font-kerning: normal;
    font-variant-ligatures: common-ligatures;
}

/* Garantir que todos os elementos herdem a fonte */
*, *::before, *::after {
    font-family: inherit;
}

/* Elementos específicos */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary) !important;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

p, li, span, div, a, button, input, select, textarea, label {
    font-family: var(--font-primary) !important;
    line-height: 1.5;
}

/* Fontes para código */
code, pre, kbd, samp {
    font-family: var(--font-monospace) !important;
}

/* Melhorias de legibilidade */
body {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* Tamanhos de fonte responsivos */
h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h2 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

h4 {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
}

h5 {
    font-size: clamp(1rem, 2vw, 1.25rem);
}

h6 {
    font-size: clamp(0.875rem, 1.5vw, 1.125rem);
}

p, li {
    font-size: clamp(0.875rem, 2vw, 1rem);
}

small {
    font-size: clamp(0.75rem, 1.5vw, 0.875rem);
}

/* Melhorias para diferentes sistemas operacionais */

/* Windows */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    body {
        font-family: 'Segoe UI', Arial, sans-serif !important;
    }
}

/* macOS */
@supports (-webkit-appearance: none) {
    body {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
    }
}

/* Linux */
@media screen and (min-resolution: 192dpi) {
    body {
        font-family: 'Ubuntu', 'Liberation Sans', 'DejaVu Sans', 'Segoe UI', Arial, sans-serif !important;
    }
}

/* Android */
@media screen and (max-width: 768px) and (orientation: portrait) {
    body {
        font-family: 'Roboto', 'Droid Sans', 'Segoe UI', Arial, sans-serif !important;
    }
}

/* iOS */
@supports (-webkit-touch-callout: none) {
    body {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
    }
}

/* Melhorias de acessibilidade */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    body {
        color: #000;
        background-color: #fff;
    }
    
    a {
        color: #0000EE;
        text-decoration: underline;
    }
    
    button {
        border: 2px solid #000;
        background-color: #fff;
        color: #000;
    }
}

/* Suporte a diferentes densidades de pixel */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Melhorias para impressão */
@media print {
    body {
        font-family: 'Times New Roman', Times, serif !important;
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    h1, h2, h3, h4, h5, h6 {
        font-family: 'Times New Roman', Times, serif !important;
        font-weight: bold;
        color: #000;
    }
}

/* Correções específicas para navegadores antigos */

/* Internet Explorer */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    body {
        font-feature-settings: normal;
        text-rendering: auto;
    }
}

/* Firefox */
@-moz-document url-prefix() {
    body {
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Safari */
@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {
        body {
            -webkit-font-smoothing: antialiased;
        }
    }
}

/* Chrome */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    body {
        -webkit-font-smoothing: antialiased;
        font-feature-settings: 'kern' 1;
    }
}

/* Edge */
@supports (-ms-ime-align: auto) {
    body {
        font-family: 'Segoe UI', Arial, sans-serif !important;
    }
}

/* Garantir que inputs e formulários usem a fonte correta */
input, select, textarea, button {
    font-family: inherit !important;
    font-size: inherit;
    line-height: inherit;
}

/* Melhorias para elementos específicos do site */
.header, .nav, .menu {
    font-family: var(--font-primary) !important;
}

.footer {
    font-family: var(--font-primary) !important;
}

.hero h1, .hero p {
    font-family: var(--font-primary) !important;
}

.btn-primary, .btn-secondary {
    font-family: var(--font-primary) !important;
    font-weight: 600;
}

/* Garantir que cards e elementos especiais usem a fonte correta */
.about-card, .team-card, .depoimento-card {
    font-family: var(--font-primary) !important;
}

/* Melhorias para formulários */
.pre-matricula-form input,
.pre-matricula-form select,
.pre-matricula-form textarea,
.pre-matricula-form label {
    font-family: var(--font-primary) !important;
}

/* Garantir legibilidade em todos os tamanhos */
@media (max-width: 480px) {
    body {
        font-size: 14px;
        line-height: 1.5;
    }
    
    h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    p, li {
        font-size: 14px;
        line-height: 1.6;
    }
}

@media (min-width: 1200px) {
    body {
        font-size: 18px;
    }
    
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2.5rem;
    }
    
    p, li {
        font-size: 18px;
    }
}