/* Estilos do Título Principal */
.cs-titulo-principal {
    margin-right: 10px;
    line-height: 1.3;
    color: #212121;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
}

/* Cores alternadas a cada duas palavras */
.cs-titulo-principal .cs-word-1,
.cs-titulo-principal .cs-word-2 {
    color: #1a73e8; /* Azul */
}

.cs-titulo-principal .cs-word-3,
.cs-titulo-principal .cs-word-4 {
    color: #ff5722; /* Laranja */
}

/* Efeito hover suave */
.cs-titulo-principal span {
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.cs-titulo-principal:hover span {
    opacity: 0.8;
}

/* Ajuste para telas menores */
@media (max-width: 768px) {
    .cs-titulo-principal {
        font-size: 1.5rem;
        padding: 0 1rem;
    }
    
    .calculadora-card {
        padding: 15px;
        border-radius: 10px;
    }
    
    .cs-card-header h2 {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }
    
    .cs-card-header p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

/* Estilos de barra de rolagem */
/* Esconde a barra de rolagem no Chrome, Safari e Edge */
::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Esconde a barra de rolagem no Firefox */
html, body, .cs-calculadora-salario-container, .calculadora-card {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Garante que o conteúdo ainda seja rolável */
body, .cs-calculadora-salario-container {
    -webkit-overflow-scrolling: touch;
}

/* Estilos base */
.cs-calculadora-salario-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Estilos para os cards separados */
.calculadora-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 25px;
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* Previne barras de rolagem indesejadas */
}

/* Container do formulário */
.cs-form-container {
    margin-top: 0;
}

/* Ajustes para o header */
.cs-card-header {
    text-align: center;
    padding: 20px 0;
}

.cs-card-header h2 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 1.8rem;
}

.cs-card-header p {
    color: #4a5568;
    margin: 0 auto;
    max-width: 700px;
    line-height: 1.6;
}

.calculadora-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.cs-form-layout {
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
    align-items: flex-start;
}

.cs-form-main {
    flex: 2;
    min-width: 0; /* Permite que o flex-shrink funcione corretamente */
    padding: 30px;
    box-sizing: border-box;
}

.cs-form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px 15px;
}

.cs-form-group {
    flex: 1 1 calc(50% - 20px);
    margin: 0 10px 20px;
    min-width: 250px;
    position: relative;
}

.cs-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.cs-input-with-prefix {
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: #fff;
    height: 42px;
}

.cs-input-with-prefix:focus-within {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.cs-currency-prefix {
    padding: 0 12px;
    background: #f8fafc;
    height: 100%;
    display: flex;
    align-items: center;
    border-right: 1px solid #e2e8f0;
    color: #4a5568;
    font-size: 14px;
}

.cs-input-wrapper {
    flex: 1;
    position: relative;
}

.cs-form-input,
.cs-form-select {
    width: 100%;
    padding: 10px 12px;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
    height: 40px;
    color: #2d3748;
}

.cs-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364758b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding-right: 36px;
    cursor: pointer;
}

.cs-form-select:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

/* Estilos para os ícones de informação */
.info-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #e2e8f0;
    border-radius: 50%;
    margin-left: 6px;
    cursor: help;
    font-size: 10px;
    font-weight: bold;
    color: #4a5568;
    vertical-align: middle;
    line-height: 1;
    transition: all 0.2s ease;
}

.info-icon:hover {
    background: #cbd5e0;
}

.info-icon .tooltip {
    visibility: hidden;
    width: 220px;
    background-color: #2d3748;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.4;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.info-icon .tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2d3748 transparent transparent transparent;
}

.info-icon:hover .tooltip,
.info-icon:focus .tooltip {
    visibility: visible;
    opacity: 1;
}

/* Posicionamento inteligente do tooltip para evitar cortes */
.info-icon .tooltip.tooltip-left {
    left: 0;
    transform: translateX(0);
}

.info-icon .tooltip.tooltip-right {
    right: 0;
    left: auto;
    transform: translateX(0);
}

.info-icon .tooltip.tooltip-bottom {
    bottom: auto;
    top: 125%;
}

.info-icon .tooltip.tooltip-bottom::after {
    top: -5px;
    border-color: transparent transparent #2d3748 transparent;
}

/* Estilos para checkboxes personalizados */
.cs-checkbox-group {
    display: flex;
    flex-direction: column;
}

.cs-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 8px;
    font-size: 14px;
    color: #4a5568;
    position: relative;
    padding-left: 30px;
}

.cs-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cs-checkbox-label:hover input ~ .checkmark {
    border-color: #a0aec0;
}

.cs-checkbox-label input:checked ~ .checkmark {
    background-color: #4299e1;
    border-color: #4299e1;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.cs-checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

.cs-checkbox-label .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Estilos para os botões */
.cs-form-actions {
    margin-top: 25px;
    text-align: center;
}

.cs-btn-calcular {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    height: 48px;
}

.cs-btn-calcular:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2b6cb0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.cs-btn-calcular:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(66, 153, 225, 0.3);
}

/* Estilos da Barra Lateral */
.cs-salary-sidebar {
    flex: 1;
    min-width: 350px;
    max-width: 380px;
    padding: 30px;
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
    box-sizing: border-box;
    position: sticky;
    top: 20px;
    align-self: stretch;
    margin: -30px 0;
    padding-top: 30px;
    padding-bottom: 30px;
    height: calc(100vh - 40px);
    overflow-y: auto;
}

.cs-salary-summary {
    position: sticky;
    top: 20px;
}

.cs-net-salary-display {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px 10px;
    background: #f8fafc;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.result-label {
    font-size: 1rem;
    color: #4a5568;
    margin-bottom: 5px;
    font-weight: 500;
}

.result-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    margin: 5px 0 10px;
    line-height: 1.2;
}

.cs-chart-container {
    margin: 10px auto 15px;
    position: relative;
    width: 100%;
    max-width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Placeholder do gráfico */
#salary-chart.placeholder {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        #f0f0f0 0% 100%
    );
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#salary-chart.placeholder::after {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: white;
}

.cs-result-group {
    margin-bottom: 30px;
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cs-result-title-green,
.cs-result-title-red {
    display: flex;
    align-items: center;
    margin: 0 0 20px;
    font-size: 1.1rem;
    font-weight: 600;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

/* Add spacing between colon and currency in results */
.cs-result-title-green::after,
.cs-result-title-red::after {
    content: ":";
    margin: 0 2px 0 0;
}

/* Hide the original colon from the HTML */
.cs-result-title-green span:contains(":"),
.cs-result-title-red span:contains(":") {
    display: none;
}

/* Result label text and separator */
.result-label-text {
    margin-right: 2px;
}

.result-separator {
    margin-right: 2px;
}

.cs-result-title-green { 
    color: #27ae60;
}

.cs-result-title-red { 
    color: #e74c3c;
}

.cs-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
}

.cs-legend-green { background: #2ecc71; }
.cs-legend-red { background: #e74c3c; }

.cs-result-items p {
    display: flex;
    justify-content: space-between;
    margin: 12px 0;
    font-size: 0.95rem;
    color: #4a5568;
}

.cs-result-items span:last-child {
    font-weight: 500;
    color: #2d3748;
}

.cs-btn-calcular {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    padding: 16px 30px;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

.cs-btn-calcular:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}
/* Responsividade */
@media (max-width: 992px) {
    .cs-form-layout {
        flex-direction: column;
    }
    
    .cs-card-header h2 {
        font-size: 1.5rem;
    }
    
    .cs-card-header p {
        font-size: 0.95rem;
        padding: 0 10px;
    }
    
    .cs-form-main {
        width: 100%;
        padding: 25px;
        flex: none;
    }
    
    .cs-salary-sidebar {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
        border-left: none;
        border-top: 1px solid #e2e8f0;
        margin: 0;
        height: auto;
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .cs-calculadora-salario-container {
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .calculadora-card {
        border-radius: 8px;
        margin: 0;
        width: 100%;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .cs-form-main,
    .cs-salary-sidebar {
        padding: 15px;
    }
    
    .cs-form-group {
        flex: 1 1 100%;
        margin: 0 0 15px 0;
        padding: 0;
        min-width: auto; /* Remove min-width para telas pequenas */
    }
    
    .result-value {
        font-size: 1.6rem;
    }
    
    .cs-chart-container {
        width: 100px;
        height: 100px;
    }
    
    .cs-form-row {
        margin: 0 0 10px 0;
        flex-direction: column;
    }
    
    /* Ajustes específicos para o cabeçalho do card */
    .cs-card-header {
        padding: 15px;
    }
    
    .cs-card-header h2 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .cs-card-header p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Ajustes para o footer do card */
    .cs-card-footer {
        padding: 15px;
    }
    
    .cs-card-footer h3 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .cs-card-footer p {
        font-size: 0.85rem;
    }
    
    /* Melhora o espaçamento dos elementos do formulário */
    .cs-form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    /* Ajusta o tamanho dos inputs para mobile */
    .cs-input-with-prefix {
        height: 40px;
    }
    
    .cs-form-input, .cs-form-select {
        font-size: 14px;
        padding: 8px 10px;
    }
    
    /* Melhora a visualização dos resultados na sidebar */
    .cs-net-salary-display {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .cs-result-group {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .cs-result-title-green,
    .cs-result-title-red {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .cs-result-items p {
        font-size: 0.9rem;
        margin: 8px 0;
    }
}

/* Estilos para o rodapé do cartão */
.cs-card-footer {
    padding: 20px 30px;
    margin-right: 20px;
    border-top: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

.cs-card-footer h3 {
    color: #2d3748;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.cs-card-footer p {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* Estilos para campos de quantidade que aparecem ao marcar os checkboxes */
.cs-quantity-input {
    margin-top: 10px;
    padding-left: 30px;
    display: none;
}

.cs-quantity-input label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #4a5568;
}

/* Mostrar campos de quantidade quando o checkbox estiver marcado */
.cs-checkbox-group input[type="checkbox"]:checked ~ .cs-quantity-input {
    display: block;
}

/* Estilo para o campo de número */
.cs-quantity-input input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.cs-quantity-input input[type="number"]:focus {
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
    outline: none;
}

/* Estilos para o select de quantidade */
.cs-quantity-input select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364758b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.cs-quantity-input select:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
    outline: none;
}

/* Overlay de tooltip é gerenciado pelo JavaScript */
.tooltip {
    position: absolute;
    background-color: #2d3748;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    text-align: left;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    word-wrap: break-word;
    white-space: normal;
}

/* Estilo quando o tooltip está visível */
.tooltip.tooltip-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Melhorias para o texto do tooltip */
.tooltip {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Estilos de tooltip para mobile são gerenciados pelo JavaScript */

/* Ajuste de margem para o rótulo de dependentes menores em dispositivos móveis */
@media (max-width: 768px) {
    #calculadora-form > div > div.cs-form-main > div:nth-child(3) > div:nth-child(1) > label > span:nth-child(3) > span {
        margin-left: 20px;
        display: inline-block;
    }
}

/* Estilos duplicados removidos - já definidos anteriormente */



/* Garante que não haja rolagem horizontal em telas pequenas */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Ajustes adicionais para telas muito pequenas */
@media (max-width: 480px) {
    .cs-calculadora-salario-container {
        padding: 10px;
    }
    
    .calculadora-card {
        padding: 15px 12px;
    }
    
    .cs-card-header h2 {
        font-size: 1.3rem;
    }
    
    .cs-card-header p {
        font-size: 0.85rem;
    }
    .cs-titulo-principal {
        font-size: 1.2rem;
    }

    .cs-form-main, .cs-salary-sidebar {
        padding: 10px;
    }

    .cs-form-group {
        margin-bottom: 10px;
    }

    .cs-input-with-prefix, .cs-form-select {
        height: 38px;
    }

    .cs-form-input, .cs-form-select {
        font-size: 13px;
        padding: 8px 10px;
    }

    .cs-currency-prefix {
        padding: 0 10px;
        font-size: 13px;
    }

    .cs-checkbox-label {
        font-size: 13px;
        padding-left: 25px;
    }

    .checkmark {
        height: 18px;
        width: 18px;
    }

    .checkmark:after {
        left: 6px;
        top: 2px;
        width: 4px;
        height: 8px;
    }

    .cs-btn-calcular {
        padding: 10px 20px;
        font-size: 1rem;
        height: 45px;
    }

    .result-label {
        font-size: 1rem;
    }

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

    .cs-result-items p {
        font-size: 0.9rem;
    }

    .info-icon {
        width: 14px;
        height: 14px;
        font-size: 9px;
    }

    .info-icon .tooltip {
        width: 180px;
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* Ajustes para o posicionamento do tooltip em dispositivos móveis */
@media (max-width: 768px) {
    .info-icon .tooltip {
        left: 0%; /* Alinha à esquerda do ícone */
        transform: translateX(0%); /* Remove a transformação X */
        bottom: auto; /* Remove o posicionamento inferior */
        top: 125%; /* Posiciona abaixo do ícone */
        text-align: left; /* Alinha o texto à esquerda */
    }

    .info-icon .tooltip::after {
        top: -5px; /* Seta para cima */
        left: 10px; /* Ajusta a posição da seta */
        margin-left: 0;
        border-color: transparent transparent #2d3748 transparent;
    }

    /* Garante que o tooltip não seja cortado */
    .cs-form-group {
        overflow: visible; /* Permite que o tooltip transborde */
    }

    .cs-checkbox-label {
        overflow: visible; /* Permite que o tooltip transborde */
    }

    .cs-checkbox-label .info-icon .tooltip {
        left: 0; /* Alinha à esquerda do ícone dentro do checkbox */
        transform: translateX(0%);
    }
}

/* Ajuste para o botão calcular */
.cs-form-actions {
    width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Adiciona padding para o botão não colar nas bordas */
}

.cs-btn-calcular {
    width: 100%; /* Garante que o botão ocupe a largura total */
}

/* Estilos do cabeçalho e footer já definidos anteriormente */

/* Título principal já definido anteriormente */

/* Remove a duplicação do botão calcular */
.cs-btn-calcular:nth-of-type(2) {
    display: none; /* Oculta o segundo botão calcular se houver duplicação */
}

