/* Importa a fonte do Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* --- Variáveis de Cor para Fácil Customização --- */
:root {
    --primary-color: #27ae60;      /* Verde Principal */
    --secondary-color: #2c3e50;    /* Azul Escuro/Grafite */
    --background-color: #f4f6f9;  /* Cinza Claro de Fundo */
    --form-bg-color: #ffffff;      /* Branco do Formulário */
    --text-color: #333;           /* Cor do Texto Principal */
    --label-color: #555;          /* Cor das Labels */
    --border-color: #ddd;          /* Cor das Bordas */
    --success-color: #2ecc71;      /* Verde Sucesso */
    --error-color: #e74c3c;        /* Vermelho Erro */
}

/* --- Reset Global e Estilo do Body --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* No seu simulacao.css */
.hidden {
    display: none !important;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    
    /* Centraliza o formulário na tela inteira */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px 10px; /* Espaçamento para telas pequenas */
}

/* --- Container Principal do Formulário --- */
.form-container {
    background-color: var(--form-bg-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px; /* Largura máxima em desktops */
    overflow: hidden;
}

.form-header {
    background-color: var(--secondary-color);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

.form-header .logo {
    font-size: 1.5em;
    font-weight: 700;
    color: white;
    text-decoration: none;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 15px;
}

#simulation-wrapper {
    padding: 30px 35px;
}

/* --- Barra de Progresso --- */
.progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 25px;
    height: 10px;
    margin-bottom: 30px;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #3498db, var(--primary-color));
    border-radius: 25px;
    transition: width 0.4s ease-in-out;
}

/* --- Etapas do Formulário --- */
.form-step { display: none; }
.form-step.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-title {
    font-size: 1.6em;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 25px;
    text-align: center;
}

/* --- Estilos Gerais de Campos e Inputs --- */
.form-group { margin-bottom: 22px; }
.form-group label {
    display: block;
    font-weight: 500;
    color: var(--label-color);
    margin-bottom: 8px;
}

.input-wrapper { position: relative; }
.input-wrapper .input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

/* REGRA UNIFICADA PARA TODOS OS INPUTS */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"] {
    width: 100%;
    padding: 12px 45px 12px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.15);
}

/* --- Estilos da Senha (Ícone e Medidor) --- */
.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
    font-size: 1.2em;
    color: #888;
}

.password-strength-meter {
    display: flex;
    gap: 5px;
    height: 6px;
    margin-top: 8px;
    border-radius: 3px;
    overflow: hidden;
}

.strength-bar {
    flex-grow: 1;
    background-color: #e0e0e0;
    transition: background-color 0.3s ease-in-out;
}

/* Cores de Força */
.strength-very-weak .strength-bar:nth-child(1) { background-color: #e74c3c; }
.strength-weak .strength-bar:nth-child(-n+2) { background-color: #f39c12; }
.strength-medium .strength-bar:nth-child(-n+3) { background-color: #f1c40f; }
.strength-strong .strength-bar:nth-child(-n+4) { background-color: #2ecc71; }

/* --- Validação e Mensagens de Feedback --- */
.feedback-message {
    color: var(--error-color);
    font-size: 0.875em;
    margin-top: 5px;
    min-height: 1.2em;
}
input.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}
#password-strength-text.strength-very-weak { color: #e74c3c; }
#password-strength-text.strength-weak { color: #f39c12; }
#password-strength-text.strength-medium { color: #f1c40f; }
#password-strength-text.strength-strong { color: #2ecc71; }

/* --- Sliders (Valor e Prazo) --- */
.slider-group .label-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
#loan-amount-value, #loan-installments-value {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1em;
}
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 5px;
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* --- Botões --- */
.form-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}
.btn-next, .btn-prev, .btn-submit {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-next:disabled, .btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.btn-next, .btn-submit {
    background-color: var(--primary-color);
    color: white;
    flex-grow: 1; /* Faz os botões ocuparem espaço */
}
.btn-prev {
    background-color: #bdc3c7;
    color: var(--secondary-color);
}
.btn-next:hover, .btn-submit:hover {
    background-color: #219d55;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
}
.btn-prev:hover {
    background-color: #a5aeb5;
}
.form-buttons button:first-child:last-child {
    width: 100%;
}
/* --- Cartão de Resumo e Tela de Sucesso --- */

.step-subtitle {
    text-align: center;
    margin: -15px 0 20px 0;
    color: var(--label-color);
}

.summary-card {
    background-color: #f9f9f9;
    border: 1px solid #e9e9e9;
    border-radius: 8px;
    padding: 25px;
}

.summary-card h4 {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 5px;
    font-size: 1em;
    border-bottom: 1px solid #f0f0f0;
}

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

.summary-label {
    color: var(--label-color);
}

.summary-value {
    font-weight: 500;
    color: var(--text-color);
    text-align: right;
}

.summary-divider {
    display: none; /* Não precisamos mais do <hr> com este estilo */
}

.summary-item--highlight {
    background-color: rgba(39, 174, 96, 0.07);
    margin: 15px -25px -25px -25px; /* Faz o destaque ocupar a largura toda */
    padding: 20px 30px;
    border-top: 1px solid #e9e9e9;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.summary-item--highlight .summary-label {
    font-weight: 600;
    font-size: 1.1em;
}

.summary-item--highlight .summary-value {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--primary-color);
}

/* --- Tela de Sucesso --- */

#success-view {
    padding: 50px 30px;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

#success-title {
    font-size: 2em;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

#success-text {
    font-size: 1.1em;
    color: var(--label-color);
    line-height: 1.6;
}

/* Animação do Ícone de Sucesso */
.success-icon {
    width: 80px;
    height: 80px;
    display: block;
    margin: 0 auto 25px auto;
}

.success-icon--circle {
    stroke-dasharray: 240;
    stroke-dashoffset: 240;
    stroke-width: 4;
    stroke-miterlimit: 10;
    stroke: var(--success-color);
    animation: success-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) 0.3s forwards;
}

.success-icon--check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 4;
    stroke: var(--success-color);
    animation: success-stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes success-stroke {
    100% {
        stroke-dashoffset: 0;
    }
}
