/* ============================================================
   CALCULADORA DE PORCENTAGEM
   Estilos exclusivos desta ferramenta
   ============================================================ */


/* ============================================================
   ÁREA DA FERRAMENTA
   ============================================================ */

.percentage-tool {
    max-width: 900px;
    margin: 0 auto;
}


/* ============================================================
   SELETOR DE OPERAÇÃO
   ============================================================ */

.operation-selector {
    margin-bottom: 25px;
}


.operation-selector label {
    display: block;
    margin-bottom: 8px;
    color: var(--cor-titulo);
    font-weight: 600;
}


.operation-select {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid var(--cor-borda);
    border-radius: var(--raio-controle);
    background: var(--cor-branco);
    color: var(--cor-texto);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}


.operation-select:focus {
    border-color: var(--cor-principal);
    outline: 3px solid rgba(37, 99, 235, 0.12);
    outline-offset: 1px;
}


.operation-description {
    margin-top: 8px;
    color: var(--cor-texto-suave);
    font-size: 0.86rem;
    line-height: 1.45;
}


/* ============================================================
   CAMPOS
   ============================================================ */

.percentage-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 25px;
}


.percentage-field {
    display: none;
}


.percentage-field.active {
    display: block;
}


.percentage-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--cor-titulo);
    font-weight: 600;
}


.percentage-input {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid var(--cor-borda);
    border-radius: var(--raio-controle);
    background: var(--cor-branco);
    color: var(--cor-texto);
    font-family: inherit;
    font-size: 0.95rem;
}


.percentage-input:focus {
    border-color: var(--cor-principal);
    outline: 3px solid rgba(37, 99, 235, 0.12);
    outline-offset: 1px;
}


.percentage-help {
    display: block;
    margin-top: 5px;
    color: var(--cor-texto-suave);
    font-size: 0.82rem;
    line-height: 1.4;
}


/* ============================================================
   AÇÕES
   ============================================================ */

.percentage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}


/* ============================================================
   RESULTADO
   ============================================================ */

.percentage-result {
    display: none;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--cor-borda);
}


.percentage-result.active {
    display: block;
}


.result-main {
    margin-bottom: 25px;
    padding: 25px;
    border: 1px solid var(--cor-borda);
    border-radius: var(--raio-card);
    background: var(--cor-branco);
    text-align: center;
}


.result-label {
    margin-bottom: 8px;
    color: var(--cor-texto-suave);
    font-size: 0.95rem;
}


.result-value {
    color: var(--cor-titulo);
    font-size: clamp(2.3rem, 6vw, 2.8rem);
    line-height: 1.1;
    font-weight: 700;
    word-break: break-word;
}


.result-description {
    margin-top: 12px;
    color: var(--cor-texto);
    font-size: 1rem;
    line-height: 1.45;
}


/* ============================================================
   RESUMO
   ============================================================ */

.result-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}


.summary-card {
    padding: 16px;
    border: 1px solid var(--cor-borda);
    border-radius: 12px;
    background: var(--cor-branco);
}


.summary-label {
    margin-bottom: 6px;
    color: var(--cor-texto-suave);
    font-size: 0.82rem;
}


.summary-value {
    color: var(--cor-titulo);
    font-size: 1.1rem;
    font-weight: 700;
    word-break: break-word;
}


/* ============================================================
   FÓRMULA
   ============================================================ */

.formula-box {
    margin-top: 25px;
    padding: 22px;
    border: 1px solid var(--cor-borda);
    border-radius: var(--raio-card);
    background: var(--cor-branco);
}


.formula-box h2 {
    margin: 0 0 12px;
    color: var(--cor-titulo);
    font-size: 1.2rem;
}


.formula {
    padding: 16px;
    border-radius: 10px;
    background: var(--cor-fundo);
    color: var(--cor-texto);
    font-family: "Courier New", Courier, monospace;
    font-size: 0.95rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}


/* ============================================================
   AÇÕES DO RESULTADO
   ============================================================ */

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}


/* ============================================================
   INFORMAÇÕES
   ============================================================ */

.tool-info h2 {
    margin-top: 30px;
}


.tool-info h2:first-child {
    margin-top: 0;
}


.tool-info p {
    line-height: 1.65;
}


/* ============================================================
   RESPONSIVIDADE
   ============================================================ */

@media (max-width: 650px) {

    .percentage-fields {
        grid-template-columns: 1fr;
    }


    .result-summary {
        grid-template-columns: repeat(2, 1fr);
    }


    .percentage-actions,
    .result-actions {
        flex-direction: column;
    }


    .percentage-actions button,
    .result-actions button {
        width: 100%;
    }

}


@media (max-width: 480px) {

    .result-summary {
        grid-template-columns: 1fr;
    }


    .result-main {
        padding: 22px 18px;
    }


    .result-value {
        font-size: 2.2rem;
    }


    .formula-box {
        padding: 18px;
    }

}


/* ============================================================
   IMPRESSÃO / PDF
   ============================================================ */

@media print {

    header,
    footer,
    .tool-breadcrumb,
    .tool-header,
    .percentage-tool .operation-selector,
    .percentage-tool .percentage-fields,
    .percentage-tool .percentage-actions,
    .result-actions,
    .ad-container {
        display: none !important;
    }


    .tool-page {
        padding: 0 !important;
    }


    .tool-section {
        padding: 0 !important;
    }


    .percentage-tool {
        max-width: none;
    }


    .percentage-result {
        display: block !important;
        margin: 0;
        padding: 0;
        border: none;
    }


    .result-main,
    .summary-card,
    .formula-box {
        box-shadow: none;
    }


    body {
        background: #ffffff;
    }

}