/* Definição de variáveis de cores e estilos para fácil manutenção */
:root {
    --primary-color: #CC0000; /* Vermelho inspirado na identidade da Lenovo */
    --secondary-color: #007bff;
    --light-gray: #f4f5f7;
    --medium-gray: #e1e4e8;
    --dark-gray: #586069;
    --text-color: #24292e;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Estilos globais do corpo da página */
body {
    font-family: 'Poppins', sans-serif; 
    background-color: #ffffff;
    color: var(--text-color);
    margin: 0;
    padding: 2rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container principal que centraliza o conteúdo */
.main-container {
    max-width: 1100px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    border: 1px solid var(--medium-gray);
}

/* Estilos do cabeçalho */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid var(--medium-gray);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 24px;
    width: auto;
}

header h1 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

/* Estilos da navegação por abas */
.tabs {
    display: flex;
    padding: 0 2.5rem;
    border-bottom: 1px solid var(--medium-gray);
}

.tab-button {
    padding: 1rem 0.5rem;
    margin-right: 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--dark-gray);
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease-in-out;
}

.tab-button.active {
    color: var(--text-color);
    font-weight: 600;
    border-bottom-color: var(--primary-color);
}

main {
    padding: 2.5rem;
    background-color: var(--light-gray);
}
.tab-content { display: none; }
.tab-content.active { display: block; }
.card { background-color: #fff; padding: 2rem 2.5rem; border-radius: var(--border-radius); margin-bottom: 1.5rem; border: 1px solid var(--medium-gray); }
.card h2, .card h3 { font-size: 1.2rem; margin-top: 0; margin-bottom: 1.5rem; font-weight: 600; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.card-header h2, .card-header h3 { margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 2rem; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 0.5rem; }
.form-group input { width: 100%; padding: 0.85rem; border: 1px solid var(--medium-gray); border-radius: 6px; font-size: 1rem; box-sizing: border-box; transition: all 0.2s ease-in-out; }
.form-group input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.15); }
.form-group input.invalid { border-color: #CC0000; box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.15); }
.checkbox-group { display: flex; gap: 2rem; flex-wrap: wrap; align-items: center; }
.checkbox-group label { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; }
.checkbox-group input[type="checkbox"] { width: 1.3em; height: 1.3em; accent-color: var(--primary-color); cursor: pointer; }
#equipment-list { display: flex; flex-direction: column; gap: 1rem; }
.equipment-header { display: grid; grid-template-columns: 3fr 1fr 1.5fr 1.5fr 0.5fr; gap: 1rem; font-size: 0.75rem; font-weight: 600; color: var(--dark-gray); padding: 0 0.5rem; border-bottom: 2px solid var(--medium-gray); padding-bottom: 0.5rem; margin-bottom: 0.5rem; }
.equipment-header span:nth-child(2), .equipment-header span:nth-child(3), .equipment-header span:nth-child(4) { text-align: right; }
.equipment-row { display: grid; grid-template-columns: 3fr 1fr 1.5fr 1.5fr 0.5fr; gap: 1rem; align-items: center; }
.equipment-row input, .equipment-row select { width: 100%; padding: 0.6rem; border: 1px solid var(--medium-gray); border-radius: 6px; font-size: 0.9rem; box-sizing: border-box; text-align: right; }
.equipment-row select { text-align: left; }
.equipment-row .price { font-weight: 600; text-align: right; padding-right: 0.5rem; }
.delete-btn { background-color: transparent; border: 1px solid var(--medium-gray); color: var(--dark-gray); border-radius: 6px; padding: 0.5rem; cursor: pointer; font-size: 1rem; line-height: 1; transition: all 0.2s ease-in-out; }
.delete-btn:hover { background-color: var(--primary-color); color: white; border-color: var(--primary-color); }
.add-button { margin-top: 1.5rem; background: none; border: 1px solid var(--dark-gray); padding: 0.75rem 1rem; border-radius: 6px; cursor: pointer; font-weight: 500; transition: all 0.2s ease-in-out; }
.add-button:hover { background-color: var(--dark-gray); color: white; }
.total-price-container { margin-top: 2rem; text-align: right; font-size: 1.25rem; font-weight: bold; }

.simulation-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.simulation-header h2 { margin: 0; }
.secondary-button { background-color: var(--dark-gray); color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 6px; font-weight: 500; cursor: pointer; transition: all 0.2s ease-in-out; }
.secondary-button:hover { background-color: var(--text-color); }
.summary-grid, .values-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.values-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; text-align: center; }
.values-grid div { background-color: var(--light-gray); padding: 1rem; border-radius: 6px; }
.values-grid span { display: block; font-size: 0.9rem; margin-bottom: 0.5rem; }
.values-grid strong { font-size: 1.2rem; }
.leasing-results { display: flex; flex-direction: column; gap: 0.5rem; }
.leasing-results-row { display: flex; justify-content: space-between; padding: 0.75rem 0; border-bottom: 1px solid var(--medium-gray); }
.leasing-results-row:last-child { border-bottom: none; }
.email-output { background-color: #f8f9fa; border: 1px solid var(--medium-gray); border-radius: 6px; padding: 1.5rem; margin-top: 1rem; white-space: pre-wrap; line-height: 1.6; color: var(--dark-gray); font-family: monospace, sans-serif; font-size: 0.9rem; }
.email-output p { margin-top: 0; color: var(--dark-gray); font-family: 'Poppins', sans-serif; }
.loader-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(255, 255, 255, 0.85); display: none; justify-content: center; align-items: center; z-index: 3000; flex-direction: column; gap: 1rem; }
.loader-overlay p { font-weight: 500; color: var(--dark-gray); }
.loader { border: 6px solid var(--light-gray); border-top: 6px solid var(--secondary-color); border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Substitua a regra .submit-button por esta */
.submit-button {
    /* Propriedades para alinhamento e tamanho */
    display: inline-flex; /* Garante alinhamento dentro de um grupo */
    align-items: center; /* Centraliza o texto verticalmente */
    justify-content: center;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    box-sizing: border-box; /* Garante que padding e borda não somem à altura */
    border: 1px solid transparent; /* Adiciona uma borda transparente para alinhar com o outro botão */

    /* Estilo de cor */
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.submit-button:hover {
    background-color: #a60000;
}

/* ESTILOS DA TELA DE LOGIN */
.login-container { display: flex; justify-content: center; align-items: center; width: 100%; min-height: 100vh; background-color: var(--light-gray); position: absolute; top: 0; left: 0; z-index: 2000; }
.login-box { background-color: #fff; padding: 2.5rem 3rem; border-radius: var(--border-radius); box-shadow: var(--box-shadow); width: 100%; max-width: 400px; text-align: center; }
.login-logo { height: 32px; margin-bottom: 1rem; }
.login-box h2 { margin-top: 0; margin-bottom: 0.5rem; }
.login-box p { margin-bottom: 2rem; color: var(--dark-gray); }
.login-box .form-group { text-align: left; margin-bottom: 1.5rem; }
.login-box .submit-button { width: 100%; margin-top: 1rem; }
.error-message { color: var(--primary-color); font-size: 0.9rem; height: 1.2rem; margin-top: -1rem; margin-bottom: 1rem; }

/* INFORMAÇÕES DO USUÁRIO NO HEADER */
.header-user-info { display: flex; align-items: center; gap: 1rem; text-align: right; }
#logged-in-user { font-size: 0.9rem; font-weight: 500; }
.logout-button { background: none; border: 1px solid var(--medium-gray); color: var(--dark-gray); padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-weight: 500; transition: all 0.2s ease-in-out; }
.logout-button:hover { background-color: var(--primary-color); border-color: var(--primary-color); color: white; }

/* Adicionar ao final de style.css */
#simulations-grid-container { display: flex; flex-direction: column; margin-top: 1.5rem; }
.simulations-grid-header, .simulation-grid-row { display: grid; grid-template-columns: 1.5fr 1fr 0.5fr 1.5fr 1fr 1fr 1fr 0.5fr; gap: 1rem; align-items: center; padding: 0.8rem 1rem; border-bottom: 1px solid var(--medium-gray); }
.simulations-grid-header { font-weight: 600; font-size: 0.8rem; color: var(--dark-gray); border-bottom-width: 2px; }
.simulation-grid-row { font-size: 0.9rem; }
.simulation-grid-row:hover { background-color: var(--light-gray); }

.view-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.view-button svg {
    width: 20px;
    height: 20px;
    fill: #8b949e; /* Tom de cinza claro */
    transition: fill 0.2s ease-in-out;
}

.view-button:hover svg {
    fill: var(--primary-color); /* Fica vermelho ao passar o mouse */
}

#edit-mode-controls {
    background-color: var(--light-gray);
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

#edit-mode-controls p {
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 500;
}

#edit-mode-controls .button-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Substitua a regra .secondary-button por esta */
.secondary-button {
    /* Propriedades para alinhamento e tamanho */
    display: inline-flex; /* Garante alinhamento dentro de um grupo */
    align-items: center; /* Centraliza o texto verticalmente */
    justify-content: center;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    box-sizing: border-box; /* Garante que padding e borda não somem à altura */
    
    /* Estilo de cor */
    background-color: #fff;
    color: var(--dark-gray);
    border: 1px solid var(--medium-gray);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.secondary-button:hover {
    background-color: var(--light-gray);
    border-color: var(--dark-gray);
    color: var(--text-color);
}

/* Adicionar ao final de style.css */

.controls-instructions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--medium-gray);
    text-align: left;
}

.controls-instructions p {
    font-size: 0.85rem;
    color: var(--dark-gray);
    margin: 0.5rem 0;
    line-height: 1.5;
}

.controls-instructions p strong {
    color: var(--text-color);
}

/* ================================================= */
/* ESTILOS COMPLETOS E FINAIS PARA GERAÇÃO DO PDF    */
/* ================================================= */

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

/* ================================================= */
/* ESTILOS COMPLETOS E FINAIS PARA GERAÇÃO DO PDF    */
/* ================================================= */

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

/* Regra principal do container do PDF, definindo as margens */
#pdf-content {
    font-family: 'Inter', sans-serif;
    background-color: #ffffff;
    color: #121212;
    padding: 15mm 20mm 20mm 20mm; /* Margem superior reduzida */
    box-sizing: border-box;
}

.pdf-header {
    display: block;
    border-bottom: none; /* <-- CORREÇÃO: Remove a borda herdada */
    padding-bottom: 0;   /* Garante que não há preenchimento extra */
    margin-bottom: 0;    /* Garante que não há margem extra */
}

/* Bloco 1 do Cabeçalho: Logo e Nome do Serviço */
.pdf-logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pdf-logo {
    height: 24px;
}

.pdf-service-title {
    font-size: 20px;
    font-weight: 600;
    color: #24292e;
}

/* Linha Separadora Vermelha */
.pdf-separator-red {
    height: 2px;
    background-color: #E2231A;
    width: 100%;
    margin: 8mm 0;
}

/* Bloco 2 do Cabeçalho: Título Principal da Cotação */
.pdf-main-title {
    font-size: 20px;
    font-weight: bold;
    color: #121212;
    text-align: center;
    margin: 0 0 8mm 0;
}

/* Linha Separadora Cinza */
.pdf-separator-gray {
    height: 1px;
    background-color: #DCDCDC;
    width: 100%;
    margin-bottom: 10mm;
}

/* --- SEÇÃO DE INFORMAÇÕES DO CLIENTE --- */
.pdf-infoblock {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10mm;
    font-size: 12px;
}

.pdf-infocolumn {
    width: 48%;
}

.pdf-infocolumn div {
    margin-bottom: 4mm;
}

.pdf-infocolumn span {
    display: block;
    color: #586069;
}

.pdf-infocolumn strong {
    font-weight: normal;
    color: #121212;
}


/* --- SEÇÃO DE VALORES TOTAIS --- */
.pdf-valuesblock {
    display: flex;
    justify-content: space-between;
    gap: 10mm;
    margin-bottom: 10mm;
}

.pdf-valuebox {
    background-color: #F4F4F4;
    width: 55mm;
    padding: 5mm;
    box-sizing: border-box;
    text-align: center;
    border-radius: 4px;
}

.pdf-valuebox span {
    font-size: 11px;
    display: block;
    margin-bottom: 2mm;
    color: #586069;
}

.pdf-valuebox strong {
    font-size: 16px;
    font-weight: bold;
    color: #121212;
}


/* --- SEÇÃO DOS RESULTADOS DA SIMULAÇÃO --- */
.pdf-results-section {
    margin-bottom: 10mm;
    border: 1px solid #DCDCDC;
    border-radius: 4px;
    overflow: hidden;
}

.pdf-results-title {
    font-size: 14px;
    font-weight: bold;
    background-color: #F4F4F4;
    padding: 4mm 5mm;
    margin: 0;
}

.pdf-results-row {
    display: flex;
    justify-content: space-between;
    padding: 4mm 5mm;
    font-size: 12px;
    border-top: 1px solid #DCDCDC;
}

.pdf-results-row strong {
    font-weight: bold;
}