@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif !important;
}

body {
    background: #1c1c1c !important;
}

.hidden {
    display: none !important;
}

.desenvolvido {
    width: 100%;
    text-align: center;
    padding: 10px 0;
    font-size: 0.9em;
    z-index: 999;
    background: #d4d8db;
}
.desenvolvido span {
    color: #3498DB !important; 
}


form label {
    color: #fff !important;
    font-weight: 500 !important;
    font-size: .8rem !important;
}

input::placeholder {
  color: #a0aec0 !important;
  font-size: .8rem !important;
}

form input, form select, form .btn {
    color: #fff !important;
    outline: none;
    width: 100% !important;
    font-size: .8rem !important;
    background: #192E64 !important;
    border: solid #000 1px !important;
    border-radius: 4px !important;
    padding: .5rem .75rem;
}

form input:focus, form select:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.5) !important;
    border-color: #3498DB !important;
}

.btn-group-custom {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

@media (min-width: 576px) {
    .btn-group-custom {
        flex-direction: row;
        justify-content: space-around;
    }
}

.btn-group-custom .btn {
    flex-grow: 1;
    background-color: #6c757d !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    padding: 0.8rem 1rem;
    font-weight: 600 !important;
    transition: all 0.3s ease;
    border: none !important;
}

.btn-group-custom .btn:hover {
    background-color: #5a6268 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-group-custom .btn.active {
    background-color: #3498DB !important;
    border-color: #3498DB !important;
    color: #fff !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.5) !important;
    transform: translateY(0);
}


/* ======================================================= */
/* NOVA ABORDAGEM PARA MARCA D'ÁGUA (À PROVA DE FALHAS)     */
/* ======================================================= */
#resultados {
    font-family: 'Poppins', sans-serif;
    color: #fff;
    /* REMOVEMOS o background-color daqui. Será controlado pelas camadas. */
    border-radius: 8px;
    padding: 1.5rem;
    width: 100%;
    position: relative; 
    isolation: isolate; /* Cria um contexto de empilhamento seguro */
}

/* CAMADA 1 (A MAIS PROFUNDA): A MARCA D'ÁGUA */
#resultados::before {
    content: "";
    background-image: url("assets/tres logos.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1; /* Opacidade da imagem */
    z-index: -2; /* Camada mais baixa */
}

/* CAMADA 2 (INTERMEDIÁRIA): A SOBREPOSIÇÃO DE COR */
#resultados::after {
    content: "";
    background-color: #0e1f4a; /* A cor de fundo original */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.95; /* Deixa a cor um pouco transparente para a marca d'água aparecer */
    z-index: -1; /* Fica entre a marca d'água e o conteúdo */
}

/* O conteúdo adicionado pelo JS ficará na camada padrão (z-index: auto), ou seja, na frente. */
/* ======================================================= */


#resultados h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff !important;
    margin-bottom: 1rem;
    border-bottom: 1px solid #192E64;
    padding-bottom: 0.5rem;
}

#resultados .summary-box {
    background-color: transparent;
    border: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

#resultados .summary-box h3, #resultados .summary-box h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid #192E64;
    padding-bottom: .5rem;
    margin-bottom: .5rem;
}

#resultados .list-group-item {
    background-color: transparent;
    border: none;
    border-bottom: 1px solid #192E64;
    padding: .5rem 0;
    font-size: 0.9rem;
    color: #fff;
}

#resultados .list-group-item:last-child {
    border-bottom: none;
}

#resultados .list-group-item span {
    color: #bdc3c7;
}

#resultados .list-group-item strong {
    color: #fff;
    text-align: right;
}

#resultados .result-item {
    background-color: #192E64;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

#resultados .result-item span:first-child {
    font-weight: 500;
    color: #bdc3c7;
}

#resultados .result-item span:last-child {
    font-weight: 700;
    font-size: 1.1rem;
    color: #3498DB;
}

#resultados .result-item.highlight {
    background-color: rgba(46, 204, 113, 0.2);
    border-left: 4px solid #2ecc71;
}

#resultados .result-item.highlight span:last-child {
     color: #2ecc71;
     font-size: 1.4rem;
}

.enchimento-mancal-box {
    background-color: #192E64;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    border: 1px dashed #3498DB;
    text-align: center;
}
.enchimento-mancal-box h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
}
.enchimento-mancal-box p {
    margin: 0;
    font-size: 1rem;
    color: #bdc3c7;
}
.enchimento-mancal-box strong {
    color: #fff;
    font-weight: 700;
}

#recomendacaoGraxa {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 4px;
    background-color: #192E64;
    border-top: 2px solid #3498DB;
    color: #fff;
}
#recomendacaoGraxa strong {
    color: #fff !important;
}
#recomendacaoGraxa p.small {
    color: #95a5a6 !important;
}


#avisoFinal {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #192E64;
    font-size: 0.8rem;
    color: #95a5a6;
}

#botao-calcular {
    background-color: #e44d26 !important;
    border-color: #d1401d !important;
    font-weight: 700 !important;
    color: #fff !important;
}
#botao-calcular:hover {
    background-color: #d1401d !important;
}

#toggleRolamentoMode {
    color: #000 !important;
    font-weight: 700 !important;
    padding: 0.375rem .75rem !important;
    font-size: .8rem !important;
    border: solid 1px #000 !important;
}

@media print {
    body { 
        background: #ffffff !important;
        color: #000000 !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    /* MARCA D'ÁGUA PARA IMPRESSÃO (JÁ ESTAVA CORRETA) */
    body::after {
        content: ""; 
        background-image: url("assets/tres logos.png"); 
        background-repeat: no-repeat;
        background-position: center center;
        background-size: contain;
        position: fixed;
        top: 25%;
        left: 25%;
        width: 50%;
        height: 50%;
        opacity: 0.1;
        z-index: -1;
        pointer-events: none; 
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .no-print { display: none !important; }
    
    .print-logo-header {
        display: block !important;
        width: 100% !important;
        max-width: 600px !important;
        margin: 0 auto 20px auto !important;
        padding: 10px !important;
        background-color: white !important;
        border-radius: 4px !important;
        text-align: center !important;
    }
    
    .print-logo-header img {
        width: auto;
        max-width: 100%;
        height: auto;
    }

    #resultados {
        display: block !important;
        background: #ffffff !important; /* Na impressão, fundo branco sólido */
        color: #000000 !important;
        box-shadow: none;
        border: 1px solid #cccccc !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    /* Esconde as camadas de fundo no print, pois a página já terá a marca d'água no body */
    #resultados::before, #resultados::after {
        display: none !important;
    }

    #resultados h2 {
        color: #000000 !important;
        border-bottom: 1px solid #cccccc !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    #resultados .summary-box h3, 
    #resultados .summary-box h4 {
        color: #000000 !important;
        border-bottom: 1px solid #cccccc !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    #resultados .list-group-item {
        background-color: transparent !important;
        color: #333333 !important;
        border-bottom: 1px solid #eeeeee !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    #resultados .list-group-item span {
        color: #555555 !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    #resultados .list-group-item strong {
        color: #000000 !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    #resultados .result-item {
        background-color: #f0f0f0 !important;
        color: #000000 !important;
        border: 1px solid #dddddd !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    #resultados .result-item span:first-child {
        color: #555555 !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    #resultados .result-item span:last-child {
        color: #007bff !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    #resultados .result-item.highlight {
        background-color: #e6ffe6 !important;
        border-left: 4px solid #28a745 !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    #resultados .result-item.highlight span:last-child {
        color: #1e7e34 !important;
        font-size: 1.4rem;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    .enchimento-mancal-box {
        background-color: #f0f8ff !important;
        border: 1px dashed #a0d0ed !important;
        color: #333333 !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .enchimento-mancal-box h4,
    .enchimento-mancal-box p,
    .enchimento-mancal-box strong {
        color: #000000 !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    #recomendacaoGraxa {
        background-color: #f8f8f8 !important;
        border-top: 2px solid #a0d0ed !important;
        color: #333333 !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    #recomendacaoGraxa strong,
    #recomendacaoGraxa p.small {
        color: #000000 !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    #avisoFinal {
        border-top: 1px solid #eeeeee !important;
        color: #777777 !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .desenvolvido {
        background: #ffffff !important; 
        color: #3498DB !important;
        border-top: 1px solid #cccccc !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    .desenvolvido span {
        color: #3498DB !important;
    }
}