/* ==============================================================================
   CIVIL CONNECTION - CUSTOM STYLESHEET
   Extensão para classes utilitárias, animações e regras de acessibilidade
   ============================================================================== */

/* Suavização de rolagem */
html {
    scroll-behavior: smooth;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Otimização de fontes e renderização de texto */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Transições suaves para botões e links */
a, button {
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out,
        box-shadow 0.2s ease-in-out, color 0.2s ease-in-out, opacity 0.2s ease-in-out,
        transform 0.2s ease-in-out;
}

/* Preserve long technical labels and values inside responsive layouts. */
:where(.flex, .grid) > * {
    min-width: 0;
}

:where(p, span, a, label, li, td, th) {
    overflow-wrap: anywhere;
}

button {
    min-width: 2.75rem;
    min-height: 2.75rem;
}

/* Efeito de foco visual acessível */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid #FD9432;
    outline-offset: 2px;
}

/* Barra de progresso animada */
.progress-bar-fill {
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Toast de notificações animado */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast-animate {
    animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
