/* ==========================================================
   Reset e Configurações Globais
========================================================== */

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

html, body {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

html {
    overflow-y: scroll;
}

/* ==========================================================
   Preloader Global
========================================================== */

#preloader {
    position: fixed;
    inset: 0;
    background: #637d8b;
    z-index: 9999;
    transition: opacity .3s ease, visibility .3s ease;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

#preloader .inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.bolas > div {
    display: inline-block;
    width: 25px;
    height: 25px;
    margin: 3px;
    background: #fff;
    border-radius: 50%;
    animation: animarBola .75s linear infinite both;
}

.bolas > div:nth-child(2) { animation-delay: .12s; }
.bolas > div:nth-child(3) { animation-delay: .24s; }

@keyframes animarBola {
    0%, 33% { transform: scale(1); opacity: 1; }
    16% { transform: scale(.1); opacity: .7; }
}

/* ==========================================================
   Toast Notifications (Bootstrap 5)
========================================================== */

/* Largura e posição responsivas */
.toast-container .toast {
    width: 380px;
    max-width: 90vw;
}

/* Cores de Fundo do Header */
.toast-header-success { background-color: #198754; color: #ffffff; }
.toast-header-danger  { background-color: #dc3545; color: #ffffff; }
.toast-header-warning { background-color: #ffc107; color: #000000; }
.toast-header-info    { background-color: #0dcaf0; color: #000000; }

/* Adaptação dos botões fechar do BS5 para fundos escuros */
.toast-header-success .btn-close,
.toast-header-danger .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Bordas Laterais do Corpo */
.toast-body.border-success { border-left-color: #198754 !important; }
.toast-body.border-danger  { border-left-color: #dc3545 !important; }
.toast-body.border-warning { border-left-color: #ffc107 !important; }
.toast-body.border-info    { border-left-color: #0dcaf0 !important; }

/* Estilização da área de texto */
.toast-body {
    font-size: 0.925rem;
    line-height: 1.5;
    max-height: 150px;
    overflow-y: auto;
    word-break: break-word;
}