/* Cores personalizadas */
:root {
    --electric: #3B82F6;
    --electric-dark: #2563EB;
    --savings: #10B981;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-700: #374151;
    --gray-900: #111827;
    --orange-500: #F97316;
    --gas-bg: #FFF5F5;
    --input-bg: #F3F4F6;
    --input-bg-filled: #FFFFFF;
    --app-bg: #f4f2ee;
    --billing-section-bg: #f0f4f8; /* Nova cor de fundo para a seção de faturamento */
}

/* Classe para esconder elementos */
.hidden {
    display: none;
}

/* Animações */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Efeitos de sombra para cards */
.card-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Efeito de destaque nos inputs */
.input-highlight {
    background-color: var(--input-bg);
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    width: 100%;
    transition: all 0.2s ease;
}

.input-highlight:focus {
    outline: none;
    border-color: var(--electric);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: var(--input-bg-filled);
}

/* Estilo para inputs vazios */
.input-highlight:placeholder-shown {
    background-color: var(--input-bg);
    border-color: var(--gray-300);
    color: var(--gray-700);
    opacity: 0.7;
}

.input-highlight:placeholder-shown:hover {
    border-color: var(--gray-400);
}

.input-highlight:placeholder-shown:focus {
    opacity: 1;
    background-color: var(--input-bg-filled);
}

/* Estilos para as opções de tarifário */
.tariff-options {
    display: flex;
    gap: 1rem;
}

.tariff-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: white;
    border-radius: 0.5rem;
    cursor: pointer;
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.tariff-option:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tariff-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tariff-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tariff-circle {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    margin-right: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.tariff-circle::after {
    content: '';
    width: 0.75rem;
    height: 0.75rem;
    background-color: var(--electric);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
}

.tariff-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-900);
    transition: all 0.3s ease;
}

.tariff-radio:checked + .tariff-content .tariff-circle {
    border-color: var(--electric);
}

.tariff-radio:checked + .tariff-content .tariff-circle::after {
    opacity: 1;
}

.tariff-radio:checked + .tariff-content .tariff-text {
    color: var(--electric);
}

.tariff-radio:checked ~ .tariff-option {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: var(--electric);
    box-shadow: 0 0 0 2px var(--electric);
}

/* Estilos para o switch */
.switch-container {
    background-color: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 0.8rem 1rem;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.switch-container:hover {
    border-color: var(--electric);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.1);
}

.switch-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.switch-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-900);
}

.switch-option i {
    font-size: 1.25rem;
}

.switch-option i.fa-bolt {
    color: var(--electric);
}

.switch-option i.fa-fire {
    color: var(--orange-500);
}

/* Estilo do switch */
.switch {
    position: relative;
    display: inline-block;
    width: 4rem;
    height: 2rem;
    cursor: pointer;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: .4s;
    border-radius: 2rem;
}

.slider:before {
    position: absolute;
    content: "";
    height: 1.75rem;
    width: 1.75rem;
    left: 0.125rem;
    bottom: 0.125rem;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    border: 1px solid var(--gray-300);
}

input:checked + .slider {
    background-color: var(--electric);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--electric);
}

input:checked + .slider:before {
    transform: translateX(2rem);
}

/* Animação para os cards de resultado */
.result-card {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease-out;
}

.result-card.show {
    opacity: 1;
    transform: translateY(0);
}

/* Estilo para o botão de submit */
button[type="submit"] {
    background-color: var(--electric);
}

button[type="submit"]:hover {
    background-color: var(--electric-dark);
}

/* Estilo para os valores de poupança */
.text-savings {
    color: var(--savings);
}

.bg-savings {
    background-color: var(--savings);
}

/* Estilo para os valores elétricos */
.text-electric {
    color: var(--electric);
}

.bg-electric {
    background-color: var(--electric);
}

/* Estilo para os campos de entrada */
input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Estilo para a seção de gás */
.gas-section {
    background-color: var(--gas-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1rem 0;
    border: 1px solid var(--orange-500);
    animation: slideIn 0.3s ease-out forwards;
}

.gas-section.hidden {
    animation: slideOut 0.3s ease-in forwards;
    pointer-events: none;
}

.gas-section h3 {
    color: var(--orange-500);
    font-weight: 600;
    margin-bottom: 1rem;
}

.gas-section .input-highlight {
    background-color: var(--input-bg);
}

.gas-section .input-highlight:focus {
    border-color: var(--orange-500);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
    background-color: var(--input-bg-filled);
}

.gas-section .input-highlight:not(:placeholder-shown) {
    background-color: var(--input-bg-filled);
    border-color: var(--orange-500);
}

/* Cards das Comercializadoras */
.provider-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Provider Cards Base Styles */
.provider-card {
    background: white;
    border-radius: 1rem;
    overflow: visible;
    transition: all 0.3s ease;
}

.provider-header {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    background: linear-gradient(to right, #ffffff, #f8fafc);
    border: 1px solid var(--gray-200);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.provider-header:hover {
    border-color: var(--electric);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.provider-logo {
    width: 100%;
    height: 3rem;
    object-fit: contain;
    margin-right: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.provider-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    flex-grow: 1;
    letter-spacing: -0.025em;
}

.toggle-icon {
    font-size: 1rem;
    color: var(--electric);
    transition: transform 0.3s ease;
    background: rgba(59, 130, 246, 0.1);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.provider-details {
    padding: 1.5rem;
    background-color: white;
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 1rem 1rem;
    margin-top: -0.5rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

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

.detail-label {
    font-size: 0.875rem;
    color: var(--gray-700);
    font-weight: 500;
}

.detail-value {
    font-size: 0.875rem;
    color: var(--electric);
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
}

/* Discount badge styles */
.discount-badge {
    position: absolute;
    top: -12px;
    left: 12px;
    background: #3b82f6;
    color: #fff;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 1;
}

.discount-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.discount-item i {
    font-size: 0.875rem;
}

/* Ajuste do container principal */
.max-w-4xl {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* Ajuste do título */
h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

/* Estilos para a seção de consumo de kWh */
.consumption-section {
    background-color: rgba(59, 130, 246, 0.05);
    border: 2px solid var(--electric);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.consumption-section::before {
    content: '\f0e7';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: -0.75rem;
    left: 1rem;
    background-color: white;
    padding: 0 0.5rem;
    color: var(--electric);
    font-size: 1rem;
}

.consumption-section h3 {
    color: var(--electric);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.consumption-section h3 i {
    color: var(--electric);
}

.consumption-section .input-group {
    margin-bottom: 1rem;
}

.consumption-section label {
    color: var(--gray-700);
    font-weight: 500;
}

.consumption-section .input-highlight {
    background-color: white;
    border-color: var(--electric);
    transition: all 0.2s ease;
}

.consumption-section .input-highlight:focus {
    border-color: var(--electric-dark);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Estilo para inputs vazios dentro da consumption-section */
.consumption-section .input-highlight:placeholder-shown {
    background-color: rgba(255, 255, 255, 0.7);
    border-color: var(--electric);
    opacity: 0.5;
}

.consumption-section .input-highlight:placeholder-shown:hover {
    opacity: 0.7;
}

.consumption-section .input-highlight:placeholder-shown:focus {
    opacity: 1;
    background-color: white;
}

/* Estilos para a seção de potência */
.consumption-power {
    background-color: rgba(30, 64, 175, 0.05);
    border: 2px solid #1E40AF;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.consumption-power::before {
    content: '\f0e7';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: -0.75rem;
    left: 1rem;
    background-color: white;
    padding: 0 0.5rem;
    color: #1E40AF;
    font-size: 1rem;
}

.consumption-power label {
    color: var(--gray-700);
    font-weight: 500;
    display: block;
    margin-bottom: 0.5rem;
}

.consumption-power select,
.consumption-power input {
    background-color: white;
    border-color: #1E40AF;
    transition: all 0.2s ease;
    width: 100%;
}

.consumption-power select:focus,
.consumption-power input:focus {
    border-color: #1E3A8A;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.2);
}

.consumption-power select:placeholder-shown,
.consumption-power input:placeholder-shown {
    background-color: rgba(255, 255, 255, 0.7);
    border-color: #1E40AF;
    opacity: 0.5;
}

.consumption-power select:placeholder-shown:hover,
.consumption-power input:placeholder-shown:hover {
    opacity: 0.7;
}

.consumption-power select:placeholder-shown:focus,
.consumption-power input:placeholder-shown:focus {
    opacity: 1;
    background-color: white;
}

.consumption-power .col-span-2 {
    grid-column: span 2;
}

/* Estilos para a seção de Configurações de Fatura e Serviços */
.billing-services-section {
    background-color: var(--billing-section-bg);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease-out;
    margin-bottom: 1.5rem;
}

.billing-services-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.billing-services-section .section-header label {
    margin-bottom: 0;
    font-size: 1rem;
}

.billing-services-section .toggle-icon {
    transition: transform 0.3s ease;
}

.billing-services-section .section-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    max-height: 500px; /* Valor arbitrário grande para altura máxima */
    opacity: 1;
    margin-top: 1rem;
}

.billing-services-section .section-content.hidden {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0; /* Garante que não haja espaço extra quando escondido */
}

.text-discounted {
    background-color: #ffd9009e; /* Gold color */
    color: #111827;
}

/* Media Queries para telas menores que 532px */
@media screen and (max-width: 532px) {
  /* Ajustes para o grid de consumo */
  .consumption-section .grid {
    grid-template-columns: 1fr !important;
  }

  /* Ajustes para o grid de potência */
  .consumption-power {
    grid-template-columns: 1fr !important;
  }

  .consumption-power .col-span-2 {
    grid-column: span 1 !important;
  }

  /* Ajustes para o grid de gás */
  #gasSection .grid {
    grid-template-columns: 1fr !important;
  }

  /* Ajustes para os campos de tarifa */
  .tariff-options {
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100%;
  }
  .tariff-option {
    width: 100% !important;
    margin: 0 !important;
  }

  /* Ajustes para o escalão do gás */
  #gasSection .flex.gap-4 {
    flex-direction: column;
    gap: 0.5rem;
  }

  #gasSection .flex.gap-4 label {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: white;
  }

  #gasSection .flex.gap-4 label:hover {
    background-color: #f3f4f6;
  }

  /* Ajustes para os switches */
  .billing-services-section .section-content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
  }
  .switch-container {
    width: 100%;
    min-width: 140px;
    box-sizing: border-box;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.5rem;
    border-radius: 1rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .switch-content {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0.5rem;
  }
  .switch-option {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 0.3rem;
  }
  .switch {
    margin-top: 0.2rem;
    margin-bottom: 0.2rem;
    align-self: center;
  }

  /* Ajustes para os inputs e selects */
  .input-highlight {
    width: 100%;
  }

  /* Ajustes para os botões */
  button[type="submit"] {
    width: 100%;
  }
}

/* Botão extra e formulário recolhido */
#openExtraFormBtn {
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
    font-size: 1.15rem;
    letter-spacing: 0.01em;
    background: linear-gradient(90deg, #fffbe6 0%, #ffe082 100%);
    border: 2px solid #ffd700;
    color: #bfa100;
    transition: background 0.3s, color 0.3s, border 0.3s, box-shadow 0.3s, transform 0.2s;
}
#openExtraFormBtn:hover, #openExtraFormBtn:focus {
    background: linear-gradient(90deg, #ffe082 0%, #fffbe6 100%);
    color: #a68a00;
    border-color: #e6c200;
    box-shadow: 0 6px 18px rgba(191, 161, 0, 0.18);
    transform: scale(1.04);
}
#openExtraFormBtn .fa-edit, #openExtraFormBtn .fa-times {
    font-size: 1.2em;
    color: #bfa100;
    transition: color 0.3s;
}
#openExtraFormBtn:hover .fa-edit, #openExtraFormBtn:hover .fa-times {
    color: #a68a00;
}
#extraFormSection {
    animation: slideIn 0.3s;
}

@media (max-width: 600px) {
    #extraFormSection {
        padding: 1rem;
    }
    #openExtraFormBtn {
        width: 100%;
        font-size: 1rem;
        padding: 0.75rem 0;
    }
}
