/* CSS personalizado para Calculadora de Originação LB */

/* Estilos gerais */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Card principal */
.card {
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Títulos */
h2 {
    color: #2c3e50;
    font-size: 1.5rem; /* Reduzido de 1.75rem para 1.5rem */
    font-weight: 700;
    margin-bottom: 1rem; /* Reduzido de 1.5rem para 1rem */
}

/* BOXES VISUAIS - Divisões da tela */
.input-section-box {
    background-color: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 0.3rem 0.875rem 0rem;
    margin-bottom: 0.9rem; /* Reduzido de 1.5rem para 1rem */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    padding-right: 3rem;
}

.input-section-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    /* background: linear-gradient(135deg, #f8f9fa, #e9ecef); */
    border-radius: 12px;
    z-index: -1;
}

/* Campos de formulário - Estilo minimalista */
.form-control, .form-select {
    border: none;
    border-bottom: 1px solid #e1e5e9;
    border-radius: 0;
    padding: 0.25rem 0;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: transparent;
    box-shadow: none;
}

.form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    border-bottom-width: 2px;
    box-shadow: none;
    background-color: transparent;
    outline: none;
}

.form-label {
    color: #6c757d;
    font-weight: 400;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: none;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

/* Estilo específico para labels de campos de texto e data */
.input-section-box .form-label {
    color: #8e9aaf;
    font-weight: 300;
    font-size: 0.85rem;
    text-transform: none;
    letter-spacing: 0.5px;
    margin-bottom: 0px;
}

/* Estilo específico para campos de texto e data */
input[type="text"], input[type="date"] {
    border: none;
    border-bottom: 2px solid #8e9aaf;
    border-radius: 0;
    padding: 0.5rem 0;
    font-size: 1rem;
    font-weight: 500;
    color: #000;
    background-color: transparent;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

input[type="text"]:focus, input[type="date"]:focus {
    border-bottom: 2px solid #0d6efd;
    box-shadow: none;
    outline: none;
    background-color: transparent;
    border-radius: 0;
}

input[type="text"]:hover, input[type="date"]:hover {
    border-bottom-color: #6c757d;
}

/* Estilo para campos de número (manter estilo original) */
input[type="number"] {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

input[type="number"]:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    background-color: #ffffff;
}

/* Estilo para selects (manter estilo original) */
select.form-select {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

select.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    background-color: #ffffff;
}

/* Novo estilo para selects na página calculadora-originacao-lb */
.calculadora-originacao-lb select.form-select {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 1.5em 1.5em;
    color: #16a34a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.calculadora-originacao-lb select.form-select:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 0.2rem rgba(22, 163, 74, 0.15);
    background-color: #ffffff;
    outline: none;
}

.calculadora-originacao-lb select.form-select:hover {
    border-color: #15803d;
    background-color: #f9fafb;
}

.calculadora-originacao-lb select.form-select option {
    background-color: #ffffff;
    color: #16a34a;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 1rem;
}

.calculadora-originacao-lb select.form-select option:checked {
    background-color: #16a34a;
    color: #ffffff;
}

.calculadora-originacao-lb select.form-select option:hover {
    background-color: #f0fdf4;
    color: #16a34a;
}

/* Melhorias adicionais para campos de texto e data */
input[type="text"]::placeholder, input[type="date"]::placeholder, input[type="number"]::placeholder {
    color: #adb5bd;
    font-style: italic;
    font-size: 0.9rem;
}

/* Efeito de linha animada no focus */
input[type="text"]:focus, input[type="date"]:focus, input[type="number"]:focus {
    box-shadow: none;
    outline: none;
    transform: translateY(-1px);
}

/* Container para campos de texto e data */
.input-text-container, .input-date-container {
    position: relative;
    margin-bottom: 1.5rem;
}

/* Efeito de elevação sutil no hover */
input[type="text"]:hover, input[type="date"]:hover, input[type="number"]:hover {
    border-bottom-color: #adb5bd;
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

/* Estilo para campos com valor preenchido */
input[type="text"]:not(:placeholder-shown), input[type="date"]:not(:placeholder-shown), input[type="number"]:not(:placeholder-shown) {
    font-weight: 600;
}

/* Animação de entrada para novos campos */
@keyframes fieldAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

input[type="text"], input[type="date"], input[type="number"] {
    animation: fieldAppear 0.3s ease-out;
}

/* Campos opcionais - controle de visibilidade */
.campo-opcional {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 200px; /* Altura máxima para animação suave */
}

.campo-opcional.hidden {
    max-height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.campo-opcional.visible {
    height: auto;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* Transições suaves para campos opcionais */
.campo-opcional {
    transform: translateY(0);
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                margin 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Manter altura consistente dos boxes */
.input-section-box {
    min-height: auto;
    transition: min-height 0.3s ease;
}

/* Ajuste para campos que podem ser ocultados */
.input-section-box .col-md-4 {
    transition: all 0.3s ease;
}

/* Estilo para campos vazios */
input[type="text"]:placeholder-shown, input[type="date"]:placeholder-shown, input[type="number"]:placeholder-shown {
    border-bottom-color: #8e9aaf;
    font-weight: 400;
}

/* Efeito de linha mais elegante - removido gradiente para bordas retas */

input[type="text"], input[type="date"], input[type="number"] {
    position: relative;
}

input[type="text"]:focus, input[type="date"]:focus, input[type="number"]:focus {
    border-bottom: 2px solid #0d6efd;
}

/* Estilo para campos com valor */
input[type="text"]:not(:placeholder-shown), input[type="date"]:not(:placeholder-shown), input[type="number"]:not(:placeholder-shown) {
    border-bottom: 2px solid #28a745;
}

/* Melhorar espaçamento entre campos */
.input-section-box .col-md-4,
.input-section-box .col-md-6 {
    margin-bottom: 1.5rem;
}

/* Estilo para campos de data específicos */
input[type="date"] {
    color: #000;
    font-family: inherit;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    filter: invert(0.3);
    transform: scale(1.1);
}

/* Garantir bordas retas para todos os campos de texto e data */
input[type="text"], input[type="date"], input[type="number"] {
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    -moz-border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: 2px solid #8e9aaf !important;
}

/* Estilos específicos para diferentes estados */
input[type="text"]:focus, input[type="date"]:focus, input[type="number"]:focus {
    border-bottom: 2px solid #0d6efd !important;
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    -moz-border-radius: 0 !important;
}

input[type="text"]:hover, input[type="date"]:hover, input[type="number"]:hover {
    border-bottom: 2px solid #6c757d !important;
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    -moz-border-radius: 0 !important;
}

input[type="text"]:not(:placeholder-shown), input[type="date"]:not(:placeholder-shown), input[type="number"]:not(:placeholder-shown) {
    border-bottom: 1px solid #ccc !important;
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    -moz-border-radius: 0 !important;
}

/* Botões de controle superior */
.btn-outline-secondary {
    border: 1px solid #dee2e6;
    color: #6c757d;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-outline-secondary:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

/* Botões de tipo de prêmio */
.btn-group .btn {
    padding: 0.5rem 1rem; /* Reduzido de 0.75rem 1.5rem para 0.5rem 1rem */
    font-weight: 500;
    border-radius: 8px;
}

.btn-check:checked + .btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-check:checked + .btn-outline-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

/* Painel direito - Box de custos com sobreposição */
.costs-panel {
    background-color: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem; /* Reduzido de 1.5rem para 1rem */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    margin-left: -2rem; /* Margem negativa para sobrepor os boxes da esquerda */
    z-index: 10; /* Garante que fique por cima */
    height: fit-content;
}

.costs-panel::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    /* background: linear-gradient(135deg, #f8f9fa, #e9ecef); */
    border-radius: 12px;
    z-index: -1;
}

/* Lista de custos - SEM BOX INTERNO */
.costs-list {
    background-color: transparent; /* Removido background */
    padding: 0; /* Removido padding */
    border-radius: 0; /* Removido border-radius */
    border: none; /* Removido border */
    margin-bottom: 1rem; /* Reduzido de 1.5rem para 1rem */
}

.cost-item {
    padding: 0.25rem 0; /* Reduzido de 0.5rem para 0.25rem */
    border-bottom: none; /* Removido border-bottom */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cost-item:last-child {
    border-bottom: none;
}

.cost-label {
    color: #808080;
    font-weight: 500;
    font-size: 0.85rem; /* Reduzido de 0.9rem para 0.85rem */
}

.cost-value {
    background-color: #212529;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem; /* Reduzido de 0.85rem para 0.8rem */
    text-align: center;
}

/* Disclaimer */
.alert-danger {
    border-color: #f5c6cb;
    color: #dc3545; /* Vermelho mais fraco */
    border-radius: 8px;
    font-size: 1.1rem;
    padding: 0.5rem 0;
    margin-bottom: 0.75rem; /* Reduzido para ficar mais compacto */
    max-width: 330px;
    font-style: italic;
}

/* Preço de oferta */
.offer-price-label {
    font-size: 1.2rem;
    color: #309c33;
    margin-bottom: 0.5rem;
}

.offer-price-value {
    background-color: #309c33;
    color: white;
    padding: 2px 8px;
    border-radius: 25px;
    font-size: 1rem;
    display: inline-block;
    margin-bottom: 0.75rem; /* Reduzido para ficar mais compacto */
}

/* Valores resumo - SEM BOX INTERNO */
.summary-values {
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 1rem;
}

.summary-item {
    text-align: left;
    padding: 0.25rem;
}

.summary-label {
    color: #6c757d;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.8rem;
}

.summary-value {
    background-color: #212529;
    color: white;
    padding: 2px 8px;
    border-radius: 11px;
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-block;
    float: right;
}

/* Botões de ação */
.btn-success {
    background-color: #309c33;
    border-color: #309c33;
    padding: 0.75rem 1.5rem; /* Reduzido de 1rem 2rem para 0.75rem 1.5rem */
    font-weight: 600;
    font-size: 1rem; /* Reduzido de 1.1rem para 1rem */
}

.btn-success:hover {
    background-color: #157347;
    border-color: #157347;
}

.btn-outline-secondary {
    padding: 0.75rem 1.5rem; /* Reduzido de 1rem 2rem para 0.75rem 1.5rem */
    font-weight: 600;
    font-size: 1rem; /* Reduzido de 1.1rem para 1rem */
    border-width: 2px;
}
.btn-salvar {
    position: absolute;
    bottom: -1.5rem;
    right: 30px;
}
.btn-salvar button {
    padding: 0.75rem 2rem; /* Reduzido de 1rem 2rem para 0.75rem 1.5rem */
    font-weight: 600;
    font-size: 1.2rem; /* Reduzido de 1.1rem para 1rem */
    border-width: 2px;
    background-color: #fff;
    color: #000;
    width: auto;
}

/* Responsividade */
@media (max-width: 1200px) {
    
    h2 {
        font-size: 1.25rem; /* Reduzido de 1.5rem para 1.25rem */
    }
    
    .input-section-box {
        padding-right: 3rem;
    }
    
    .costs-panel {
        margin-left: -1.5rem;
        padding: 0.875rem; /* Reduzido de 1.25rem para 0.875rem */
    }
}

@media (max-width: 768px) {
    
    
    .costs-panel {
        margin-left: 0;
        margin-top: 1.5rem; /* Reduzido de 2rem para 1.5rem */
        padding: 0.75rem; /* Reduzido de 1rem para 0.75rem */
    }
    
    .offer-price-value {
        font-size: 1.1rem; /* Reduzido de 1.25rem para 1.1rem */
        padding: 0.5rem 1rem; /* Reduzido de 0.75rem 1.5rem para 0.5rem 1rem */
        min-width: 140px; /* Reduzido de 150px para 140px */
    }
    
    .btn-success, .btn-outline-secondary {
        padding: 0.5rem 1rem; /* Reduzido de 0.75rem 1.5rem para 0.5rem 1rem */
        font-size: 0.9rem; /* Reduzido de 1rem para 0.9rem */
    }
}

/* Animações */
.form-control, .form-select, .btn {
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Estados especiais */
.form-control[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
}

.form-control[readonly]:focus {
    border-color: #e1e5e9;
    box-shadow: none;
}

/* Melhorias visuais */
.card {
    background: transparent;
    box-shadow: none !important;
    /* backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95); */
}

/* Sombras sutis */
.btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cost-value, .summary-value, .offer-price-value {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Efeito de profundidade para os boxes */
.input-section-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.costs-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* Toggle Switch Styles */
.toggle-switch-container {
    width: 100%;
}

.toggle-switch {
    position: relative;
    width: 100%;
    height: 40px;
    /* background-color: #f8f9fa; */
    background-color: #fff;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-switch:hover {
    /* border-color: #0d6efd; */
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.2);
}

.toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s ease;
    z-index: 2;
    cursor: pointer;
    padding: 0 15%;
}

.toggle-label-left {
    left: 0;
    color: #000;
}

.toggle-label-right {
    right: 0;
}

.toggle-slider {
    position: absolute;
    top: -2px;
    right: -2px;
    width: calc(50% + 2px);
    height: calc(100% + 4px);
    background-color: #fff;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1;
    pointer-events: none;
}

/* Estados dos inputs - Simplificado */
.toggle-input[value="swap"]:checked ~ .toggle-slider {
    left: calc(50% + 2px);
}

.toggle-input[value="swap"]:checked ~ .toggle-label-left {
    color: #6c757d;
}

.toggle-input[value="swap"]:checked ~ .toggle-label-right {
    color: #000;
}

.toggle-input[value="opcoes"]:checked ~ .toggle-slider {
    left: 2px;
}

.toggle-input[value="opcoes"]:checked ~ .toggle-label-left {
    color: #000;
}

.toggle-input[value="opcoes"]:checked ~ .toggle-label-right {
    color: #6c757d;
}

/* Responsividade para toggle switch */
@media (max-width: 768px) {
    .toggle-switch {
        height: 36px;
    }
    
    .toggle-label {
        font-size: 0.8rem;
        padding: 0 12px;
    }
    
    .toggle-slider {
        width: calc(50% - 2px);
        height: calc(100% - 4px);
    }
}

/* Melhorias adicionais para toggle switch */
.toggle-switch:focus-within {
    /* border-color: #0d6efd; */
    /* box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25); */
}

.toggle-label:hover {
    color: #0d6efd;
}

/* Estado ativo para melhor feedback visual */
.toggle-switch.active {
    border-color: #0d6efd;
    background-color: #f8f9ff;
}

/* Animação suave para transições */
.toggle-switch * {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Previne formatação automática do campo volume */
input[name="volume"] {
    /* Remove formatação automática */
    -webkit-appearance: none;
    -moz-appearance: textfield;
    
    /* Previne formatação de números */
    font-variant-numeric: tabular-nums;
    
    /* Garante que não haja formatação automática */
    text-align: right;
}

/* Remove setas do input number no Chrome/Safari */
input[name="volume"]::-webkit-outer-spin-button,
input[name="volume"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Remove setas do input number no Firefox */
input[name="volume"] {
    -moz-appearance: textfield;
}
