/* ============================================= */
/* MÓDULO GERADOR DE PROPOSTAS (gerador.css)     */
/* ============================================= */

#gerador-de-propostas-section body { background-color:#003399; color:#fff; font-family:Arial,sans-serif; margin:0; padding:0; }
#gerador-de-propostas-section header { background-color:#002266; padding:15px; text-align:center; }
#gerador-de-propostas-section header h1 { font-size:24px; }
#gerador-de-propostas-section form { background-color:#f0f4f8; border-radius:10px; padding:20px; position: relative; z-index: 1; }
#gerador-de-propostas-section .container { padding:20px; max-width:600px; margin:auto; }

#gerador-de-propostas-section .form-group { margin-bottom:15px; }
#gerador-de-propostas-section #totaisProposta .form-group { margin-bottom: 0px; }
#gerador-de-propostas-section #grupo-extra .form-group { margin-bottom: 5px; }
#gerador-de-propostas-section .form-group label { display:block; font-weight:700; margin-bottom:5px; color:#05c; }
#gerador-de-propostas-section .form-group input, 
#gerador-de-propostas-section .form-group select, 
#gerador-de-propostas-section .form-group textarea { padding:10px; width:100%; max-width:100%; margin-bottom:5px; border:1px solid #003399; border-radius:5px; box-sizing:border-box; }
#gerador-de-propostas-section .form-group input[type=checkbox] { width:auto; }

#gerador-de-propostas-section .form-row { display:flex; justify-content:space-between; }
#gerador-de-propostas-section .form-row .form-group { flex:1; margin-right:10px; }
#gerador-de-propostas-section .form-row .form-group:last-child { margin-right:0; }
#gerador-de-propostas-section .form-row .form-group input { max-width:100%; }

#gerador-de-propostas-section button { background-color:#05c; color:#fff; padding:10px 20px; border:none; border-radius:5px; cursor:pointer; display:block; margin:0 auto; width: 100%; }
#gerador-de-propostas-section button:hover { background-color:#003399; }
#gerador-de-propostas-section .hidden { display:none !important; }
#gerador-de-propostas-section .result { margin-top: 20px; background-color:#fff; padding:10px; border-radius:10px; color:#05c; }
#gerador-de-propostas-section h2 { color:#05c; }

/* Botões do Gerador */
#gerador-de-propostas-section .add-seller-btn { background-color:#008000; color:#fff; border:none; border-radius:5px; cursor:pointer; padding:10px 20px; font-size:14px; width:100%; margin-top:0px; }
#gerador-de-propostas-section .add-seller-btn:hover { background-color:#006414; }
#gerador-de-propostas-section .add-seller-btn.delete { background-color:#e91c05; }
#gerador-de-propostas-section .add-seller-btn.delete:hover { background-color:#970700; }

#gerador-de-propostas-section .seller-list { background:#fff; color:#000; max-height:200px; overflow-y:auto; list-style-type:none; padding:0; }
#gerador-de-propostas-section .seller-list li { padding:10px; cursor:pointer; }
#gerador-de-propostas-section .seller-list li:hover { background:#eee; }

/* -------------------------------------------------------- */
/* ▼▼▼ MUDANÇA DE COR DOS BOTÕES (EDITAR / NOVA PROPOSTA) ▼▼▼ */
/* -------------------------------------------------------- */

/* Botão EDITAR (Fica Azul) */
#gerador-de-propostas-section button#editProposal {
    background-color: var(--azul) !important;
    color: #ffffff !important;
    border: none !important;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#gerador-de-propostas-section button#editProposal:hover {
    background-color: #002266 !important; 
}

/* Botão NOVA PROPOSTA e SALVAR ALTERAÇÕES (Ficam Amarelos com texto Azul) */
#gerador-de-propostas-section button#newProposal,
#gerador-de-propostas-section button#updateProposal,
.btn-new-proposal {
    background-color: var(--amarelo) !important; 
    color: var(--azul) !important; 
    border: none !important;
    font-weight: bold !important; 
}

#gerador-de-propostas-section button#newProposal:hover,
#gerador-de-propostas-section button#updateProposal:hover,
.btn-new-proposal:hover {
    background-color: #e6b800 !important; 
}


/* -------------------------------------------------------- */

#gerador-de-propostas-section #shareProposal { background-color:#27ae60; height: 40px; padding: 0 12px; font-size: 14px; display: flex; align-items: center; justify-content: center; font-weight: bold; } 
#gerador-de-propostas-section #shareProposal:hover { background-color:#006414; }

#gerador-de-propostas-section #downloadProposal { background-color: #f39c12; color:#fff; padding: 10px; width: 40px; height: 40px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
#gerador-de-propostas-section #downloadProposal:hover { background-color: #FF8E08; }
#gerador-de-propostas-section #downloadProposal img { width: 20px; height: 20px; }

/* Linha de botões */
#gerador-de-propostas-section .buttons-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
#gerador-de-propostas-section .buttons-row .form-group { flex: 1; margin: 0; }
#gerador-de-propostas-section .buttons-row .form-group button { width: 100%; padding: 10px; box-sizing: border-box; }

/* Obrigatórios */
#gerador-de-propostas-section label[for]:has(+ input:required)::after, 
#gerador-de-propostas-section label.required::after { content: ' *'; color: red; font-weight: bold; }

/* Grupos do Consórcio */
#gerador-de-propostas-section #addGroupBtn { background-color: #008000; color: white; border: none; border-radius: 5px; padding: 10px 16px; font-size: 14px; font-weight: bold; cursor: pointer; margin: 10px 0; width: 100%; text-align: center; display: block; margin-left: 0; }
#gerador-de-propostas-section #addGroupBtn:hover { background-color: #006414; }
#gerador-de-propostas-section .remove-group-container { display: flex; justify-content: flex-end; margin-top: 15px; padding-top: 10px; border-top: 1px solid #eee; }
#gerador-de-propostas-section .remove-group-btn { background-color: #e74c3c; color: white; border: none; border-radius: 4px; padding: 8px 20px; font-weight: bold; cursor: pointer; font-size: 14px; transition: background 0.3s; }
#gerador-de-propostas-section .remove-group-btn:hover { background-color: #c0392b; }
#gerador-de-propostas-section .form-row.parcela-com-botao .form-group { flex: 0 0 38%; margin-bottom: 0px; }
#gerador-de-propostas-section .form-row.parcela-com-botao .form-group.botao-excluir { flex: 0 0 24%; display: flex; align-items: flex-end; justify-content: flex-end; }

/* Preview e PDF */
#gerador-de-propostas-section .page-break { display: block; height: 1px; width: 100%; margin: 0; padding: 0; border: none; page-break-before: always; break-before: page; }
#gerador-de-propostas-section #proposalResult { font-size: 14px; line-height: 1.5; background: none; }
#gerador-de-propostas-section #proposalResult p, #gerador-de-propostas-section #proposaltoPDF p, #gerador-de-propostas-section #proposalResult h4, #gerador-de-propostas-section #proposaltoPDF h4, #gerador-de-propostas-section #proposalResult div, #gerador-de-propostas-section #proposaltoPDF div { display: block; margin: 0; padding: 0; margin-bottom: 10px; line-height: 1.4; }
#gerador-de-propostas-section #proposalResult h4, #gerador-de-propostas-section #proposaltoPDF h4 { font-size: 1.1em; font-weight: bold; text-align: center; margin-top: 15px; margin-bottom: 15px; }
#gerador-de-propostas-section #proposalResult hr, #gerador-de-propostas-section #proposaltoPDF hr { display: block; height: 1px; margin: 15px 0; border: 0; border-top: 1px solid #ccc; background-color: transparent; }
#gerador-de-propostas-section #proposalResult > div:first-child, #gerador-de-propostas-section #proposaltoPDF > div > div:first-child { margin-bottom: 0; }
#gerador-de-propostas-section #proposalResult > h4:first-of-type, #gerador-de-propostas-section #proposaltoPDF h4:first-of-type { margin-top: 5px; }
#gerador-de-propostas-section #proposalResult > p:last-of-type, #gerador-de-propostas-section #proposaltoPDF p:last-of-type { margin-bottom: 0; }
#gerador-de-propostas-section #proposaltoPDF div { margin-bottom: 0; }

/* Rodapé Fixo no Preview */
#gerador-de-propostas-section #result { padding-bottom: 80px; }
#gerador-de-propostas-section #result .buttons-row { position: fixed; bottom: 0; left: 0; width: 100%; background-color: #ffffff; padding: 15px 20px; box-shadow: 0 -4px 10px rgba(0,0,0,0.1); z-index: 9999; display: flex; justify-content: center; gap: 15px; margin: 0 !important; box-sizing: border-box; }

/* Dropdown Cliente/Vendedor */
#gerador-de-propostas-section .search-results-dropdown { display: none; }
#gerador-de-propostas-section .search-results-dropdown:not(.hidden) { display: block; }

/* Checkbox Switch (Gerador) */
#gerador-de-propostas-section .form-group-switch { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
#gerador-de-propostas-section .form-group-switch .switch { flex-shrink: 0; margin-bottom: 0; }
#gerador-de-propostas-section .form-group-switch .switch-label { flex: 1; display: block; margin-bottom: 0; font-weight: 700; color: #05c; cursor: pointer; word-wrap: break-word; line-height: 1.2; }
#gerador-de-propostas-section .form-group-switch .switch input[type=checkbox] { opacity: 0; width: 0; height: 0; margin-bottom: 0; padding: 0; border: none; }

/* Cabeçalho da Proposta Pública */
.public-proposal-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; background-color: var(--azul); border-bottom: 1px solid var(--amarelo); box-shadow: 0 2px 4px rgba(0,0,0,0.05); margin: -20px -20px 20px -20px; }
.public-proposal-header .public-logo { height: 40px; width: auto; content: url('../Imagens/Logos JPDigital.png'); }
.public-proposal-header .public-login-btn { background-color: var(--amarelo); color: var(--azul); padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 16px; font-weight: bold; text-decoration: none; transition: background-color 0.3s; }
.public-proposal-header .public-login-btn:hover { background-color: #f7e04f; }

/* Estilos dos Botões de Ação da Proposta */
.btn-action-proposal { flex: 1; padding: 12px 10px; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 5px; cursor: pointer; font-size: 15px; transition: filter 0.3s ease, transform 0.1s ease; min-width: 130px; }
.btn-action-proposal:hover { filter: brightness(0.99); }
.btn-action-proposal:active { transform: scale(0.98); }
.btn-share-proposal { background-color: #27ae60; color: white; }
.btn-download-proposal { background-color: #f39c12; color: white; }

@media (min-width: 769px) {
    .btn-only-mobile { display: none !important; }
    
}
@media (max-width: 768px) {
    #gerador-de-propostas-section #result .buttons-row { flex-direction: row; flex-wrap: wrap; }

    /* --- CORREÇÃO DO BURACO NO TOPO (MOBILE) --- */
    .public-proposal-header {
        margin-top: -72px !important; /* Puxa o cabeçalho 60px pra cima, engolindo o espaço vazio */
        margin-left: -10px !important; /* Estica para as bordas do celular */
        margin-right: -10px !important; 
        width: calc(100% + 20px); /* Compensa as margens laterais */
    }
}