/* ============================================================
   1. VARIÁVEIS E CONFIGURAÇÕES GERAIS
   ============================================================ */
:root {
    --primary: #d63031;
    --secondary: #2d3436;
    --accent: #fab1a0;
    --bg: #f5f6fa;
    --white: #ffffff;
    --success: #25d366;
    --info: #2196f3;
    --warning: #ff9800;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

#churras-app {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    padding: 20px;
    border-radius: var(--radius);
    max-width: 800px;
    margin: 20px auto;
    color: var(--secondary);
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   2. HEADER E ÁREA DE CONTA (AJUSTE DE ALINHAMENTO MOBILE)
   ============================================================ */
.user-auth-area {
    background: var(--white);
    padding: 15px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    border-top: 4px solid var(--info);
    display: flex;
    justify-content: space-between;
    align-items: center; /* ALINHAMENTO VERTICAL CORRIGIDO */
    flex-wrap: wrap;
    gap: 15px;
}

#auth-logged-out {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

#auth-logged-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
}

#user-name {
    color: var(--info);
    font-weight: 700;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-nuvem-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ============================================================
   3. NAVEGAÇÃO E TABS
   ============================================================ */
.nav-principal {
    display: flex;
    flex-wrap: wrap; /* Permite quebra se a tela for muito pequena */
    justify-content: center;
    gap: 8px;
    background: #e9ecef;
    padding: 8px;
    border-radius: var(--radius);
    margin-bottom: 25px;
}

.nav-link {
    flex: 1 1 auto;
    min-width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px; /* Aumentado para melhor toque */
    font-size: 1.05rem;   /* FONTE MAIOR: De ~0.85rem para 1.05rem */
    font-weight: 700;    /* Mais peso para facilitar a leitura */
    color: #495057;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.nav-link.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow);
}

/* Ajuste Mobile */
@media (max-width: 480px) {
    .nav-link {
        font-size: 0.95rem; /* No celular reduzimos só um pouco para não quebrar tanto */
        padding: 12px 10px;
        flex: 1 1 45%; /* Tenta manter 2 botões por linha se o espaço acabar */
    }
}
.modo-selector {
    display: flex;
    background: #eee;
    padding: 5px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    font-weight: bold;
    color: #666;
}

.tab-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow);
}
/* Ajuste da área de boas-vindas */
#user-welcome-area {
    display: flex !important;
    flex-direction: column;
    align-items: flex-end; /* Alinha na direita */
    margin-bottom: 25px;
    width: 100%;
}

.user-greeting {
    font-size: 1rem; /* Nome do usuário maior */
    color: #4a5568;
    line-height: 1.2;
}

#user-display-name {
    font-size: 1.1rem; /* Destaque no nome */
}

.logout-link-sub {
    font-size: 0.85rem; /* Link de sair um pouco maior também */
    color: var(--primary) !important;
    font-weight: 700;
    text-decoration: none;
    margin-top: 5px;
    display: inline-block;
}

/* Responsividade: No celular muito pequeno, centraliza para não ficar estranho */
@media (max-width: 400px) {
    #user-welcome-area {
        align-items: center;
        text-align: center;
    }
}

/* ============================================================
   4. FORMULÁRIOS E INPUTS
   ============================================================ */
.grid-rapido, .input-group, .extra-configs {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.grid-rapido {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

input[type="number"], input[type="text"], select {
    padding: 12px;
    border: 1.5px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    background: #fdfdfd;
}

input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(214, 48, 49, 0.1); }

.main-label {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #636e72;
}

/* ============================================================
   5. VISUAL PAPEL DE PÃO E RESULTADOS
   ============================================================ */
.checklist-papel {
    background: #fffbe6 !important;
    border: 2px dashed #d4a017 !important;
    padding: 25px !important;
    transform: rotate(-1deg);
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.05) !important;
    margin: 40px auto !important;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.result-item {
    background: var(--white);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
}

.result-item span { display: block; font-size: 1.3rem; font-weight: 800; color: var(--primary); }

.divisao-box {
    background: var(--secondary);
    color: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    text-align: center;
}

.result-grid {
    margin-bottom: 20px; 
}
.divisao-box strong { color: #00d2d3; font-size: 1.6rem; display: block; }

/* ============================================================
   6. BOTÕES DE AÇÃO
   ============================================================ */
.btn-whatsapp {
    width: 100%;
    background: var(--success);
    color: white !important;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-print {
    background: #4A5568;
    color: white;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 15px;
}

/* ============================================================
   7. REGRAS DE IMPRESSÃO (RESTAURADO)
   ============================================================ */
@media screen, print {
    .print-body { font-family: Arial, sans-serif; margin: 10px; color: #000; line-height: 1.1; }
    .print-header-titulo { text-align: center; margin: 0; font-size: 16px; border-bottom: 1px solid #000; }
    .coluna-dupla { display: flex; gap: 15px; margin-top: 10px; }
    .coluna { flex: 1; }
    .print-tabela { width: 100%; border-collapse: collapse; }
    .print-tabela th { text-align: left; border-bottom: 1px solid #000; background: #f2f2f2; padding: 2px 4px; font-size: 10px; }
    .print-tabela td { padding: 2px 4px; border-bottom: 1px solid #eee; font-size: 11px; }
    .item-valor { text-align: right; font-weight: bold; }
    .box-rateio { border: 1px solid #000; padding: 5px; text-align: center; margin: 8px 0; font-size: 11px; font-weight: bold; }
    .container-nomes { column-count: var(--colunas, 2); column-gap: 10px; margin-top: 5px; }
    .nome-item { font-size: var(--font-size-nomes, 11px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ============================================================
   8. LOGIN E CADASTRO (PERSONALIZAÇÃO MANTIDA)
   ============================================================ */
#churras-app-login, #churras-app-cadastro {
    min-height: 90vh;
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#churras-app-login .card-calculadora, #churras-app-cadastro .card-calculadora {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

/* ============================================================
   9. MEUS CHURRASCOS (GALERIA)
   ============================================================ */
#container-cards-churrasco {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.card-churrasco {
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.card-title-churras { font-size: 1.1rem; font-weight: 800; color: #1a202c; text-transform: uppercase; }

.card-actions-churras { display: flex; gap: 10px; margin-top: auto; }

.btn-card-abrir { flex: 3; background: #fff; color: var(--primary); border: 1px solid var(--primary); border-radius: 10px; font-weight: 700; height: 42px; cursor: pointer; }
.btn-card-excluir { flex: 1; background: #f1f5f9; color: #e53e3e; border: none; border-radius: 10px; cursor: pointer; }

/* ============================================================
   10. TOASTS E AUXILIARES
   ============================================================ */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }
.toast { background: #333; color: #fff; padding: 12px 25px; border-radius: 8px; margin-top: 10px; animation: slideIn 0.3s ease-out; }
.toast.success { border-left: 5px solid #2ecc71; }
.toast.error { border-left: 5px solid #e74c3c; }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Ajustes Mobile */
@media (max-width: 480px) {
    .user-auth-area { flex-direction: column; text-align: center; padding: 15px 10px; }
    #auth-logged-in { flex-direction: column; gap: 10px; }
    .btn-nuvem-container { width: 100%; justify-content: center; }
}

/* ============================================================
   AJUSTE EXCLUSIVO: BOTÕES DE LOGIN E CADASTRO
   ============================================================ */

/* Alvos: Botão de Login e Botão de Cadastro */
#form-login-custom button[type="submit"],
#form-cadastro-custom button[type="submit"],
.btn-principal-acesso {
    width: 100% !important;
    padding: 16px !important;
    background-color: var(--info) !important; /* Azul de destaque */
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2) !important;
    display: block !important;
    margin-top: 10px !important;
}

#form-login-custom button[type="submit"]:hover,
#form-cadastro-custom button[type="submit"]:hover {
    background-color: #1976d2 !important; /* Azul levemente mais escuro */
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(33, 150, 243, 0.3) !important;
}

#form-login-custom button[type="submit"]:disabled {
    background-color: #b0bec5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Espaçamento extra para os campos de input nestas telas */
#form-login-custom .input-group,
#form-cadastro-custom .input-group {
    margin-bottom: 20px !important;
}

.login-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
    align-items: center;
}

.login-footer a {
    text-decoration: none;
    font-size: 0.9rem;
    color: #4a5568;
    transition: 0.2s;
}

.login-footer .link-destaque-cadastro {
    color: var(--primary);
    font-weight: 800;
    font-size: 1rem;
    border: 1px solid var(--primary);
    padding: 8px 20px;
    border-radius: 20px;
}

.login-footer .link-destaque-cadastro:hover {
    background: var(--primary);
    color: white !important;
}
/* Links Secundários (Esqueci senha / Visitante) */
.link-secundario {
    color: #718096;
    font-size: 0.9rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.link-secundario:hover {
    color: var(--info);
}

/* ============================================================
  PÁGINA SOBRE O PROJETO
   ============================================================ */

.secao-sobre {
    animation: slideIn 0.4s ease-out;
    padding: 10px 5px;
}

/* Grid de artigos (Colunas) */
.sobre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

/* Estilo dos Cards de Texto */
.sobre-grid article {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--primary); /* Detalhe em vermelho no topo */
    transition: transform 0.3s ease;
}

.sobre-grid article:hover {
    transform: translateY(-5px);
}

/* Títulos e Textos Internos */
.secao-conteudo-texto h3 {
    color: var(--secondary);
    margin-bottom: 15px;
    font-size: 1.25rem;
    font-weight: 800;
    border-bottom: 2px solid #f1f3f5;
    padding-bottom: 10px;
}

.secao-conteudo-texto p {
    line-height: 1.8;
    color: #4a5568;
    font-size: 1rem;
    margin-bottom: 15px;
}

/* Responsividade específica para a página Sobre */
@media (max-width: 600px) {
    .sobre-grid {
        grid-template-columns: 1fr; /* Uma coluna no celular */
    }
    
    .sobre-grid article {
        padding: 20px;
    }
}

/* ============================================================
   ESTILO DA SEÇÃO DE POLÍTICA DE PRIVACIDADE
   ============================================================ */

/* Container Principal (Aproveitando sua classe card-calculadora) */
#view-politica .card-calculadora {
    max-width: 750px;
    margin: 20px auto;
    padding: 35px;
    border-top: 5px solid var(--secondary); /* Cor cinza escuro para sobriedade */
}

/* Título dentro do Header */
#view-politica header h2 {
    color: var(--secondary);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Estilo dos parágrafos e corpo do texto */
.texto-legal {
    line-height: 1.7;
    color: #4a5568;
}

.texto-legal p {
    margin-bottom: 15px;
    font-size: 1rem;
}

/* Títulos das Cláusulas (1, 2, 3...) */
.texto-legal h3 {
    color: var(--primary); /* Vermelho para destacar os pontos */
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 25px;
    margin-bottom: 10px;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 5px;
}

/* Área do Botão de Voltar */
.sobre-cta {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.sobre-cta .btn-print {
    max-width: 250px;
    background-color: var(--secondary);
    transition: all 0.3s ease;
}

.sobre-cta .btn-print:hover {
    background-color: var(--primary);
    transform: translateY(-2px);
}

/* Ajuste para Mobile */
@media (max-width: 480px) {
    #view-politica .card-calculadora {
        padding: 20px;
    }
    .texto-legal h3 {
        font-size: 1.05rem;
    }
}