:root {
    /* Paleta Dark Mode Elegante */
    --primary: #F8FAFC; /* Branco/Gelo para títulos e destaques */
    --primary-deep: #060F1E; /* Azul super escuro da Sidebar original */
    --bg-light: #0B1320; /* Fundo principal escuro */
    --white: #152033; /* Fundo dos cards (substitui o branco antigo) */
    --gold: #D4AF37; /* Dourado vibrante para contraste no escuro */
    --gold-soft: rgba(212, 175, 55, 0.2);
    --gray: #CBD5E1; /* Texto principal legível */
    --gray-soft: #94A3B8; /* Texto secundário sutil */
    --line: #27354D; /* Bordas e divisórias */
    --success: #10B981; /* Verde esmeralda */
    --green-light: rgba(16, 185, 129, 0.1);
    --green-text: #34D399;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 17px;
    color: var(--gray);
    background: var(--bg-light);
    -webkit-font-smoothing: antialiased;
}

/* Tipografia */
h1, h2, h3, .hero-title, .verse-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
}

/* Layout Principal */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--primary-deep);
    color: var(--primary);
    display: flex;
    flex-direction: column;
    padding: 20px 22px;
    gap: 16px;
    border-right: 1px solid var(--primary-deep);
    box-shadow: 2px 0 15px rgba(0,0,0,0.3);
    z-index: 10;
}

.logo { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 2px; }
.logo-mark { width: 50px; height: 50px; color: var(--gold); }
.logo-text { text-align: center; display: flex; flex-direction: column; }
.logo-main { font-family: 'Cormorant Garamond', serif; font-size: 1.8rem; font-weight: 700; letter-spacing: 0.1em; color: var(--primary); }
.logo-sub { font-size: 0.7rem; color: var(--gold); letter-spacing: 0.15em; font-weight: 600; margin-top: 4px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 8px;
    color: var(--gray-soft); text-decoration: none; font-weight: 500; font-size: 0.95rem; transition: all 0.2s;
}
.sidebar-link.active, .sidebar-link:hover { background: rgba(255,255,255,0.05); color: var(--primary); }
.sidebar-link-icon { width: 18px; height: 18px; }

.sidebar-doacao {
    margin-top: auto; border: 1.5px solid var(--gold); border-radius: 12px;
    padding: 16px 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.15);
}
.heart-icon { width: 26px; height: 26px; margin-bottom: 5px; }
.sidebar-doacao p { font-size: 0.85rem; line-height: 1.55; color: var(--gray); font-weight: 500; }
.sidebar-doacao-pix { color: var(--gold) !important; font-weight: 700 !important; font-size: 0.78rem !important; word-break: break-word; }

.sidebar-versiculo { text-align: center; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.05); }
.quote-mark { color: var(--gold); font-size: 2rem; font-family: serif; line-height: 1; margin-bottom: 5px; }
.sidebar-versiculo p { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; color: var(--gray); line-height: 1.3; }
.sidebar-versiculo-ref { font-family: 'Inter', sans-serif !important; font-size: 0.75rem !important; color: var(--gold) !important; margin-top: 8px; }

/* Main Content */
.main-scroll { flex: 1; height: 100vh; overflow-y: auto; background: var(--bg-light); position: relative; }

/* ESTILOS DO HEADER / VERSÍCULO */
.top-header { display: flex; justify-content: flex-end; padding: 20px 40px 0; }
.header-verse {
    font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.1rem; color: var(--gray);
    font-style: italic; display: flex; align-items: center; gap: 8px;
}
.header-verse-ref {
    font-family: 'Inter', -apple-system, sans-serif; font-size: 0.85rem; font-weight: 600;
    color: var(--gold); font-style: normal;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 40px 60px; }

/* Hero */
.hero { text-align: center; padding: 40px 0; position: relative; }
.hero-title { font-size: 4.5rem; color: var(--primary); letter-spacing: 0.1em; font-weight: 600; margin-bottom: 10px; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.hero-subtitle { font-size: 2rem; color: var(--gray); font-weight: 500; line-height: 1.2; margin-bottom: 20px; }
.hero-sub { font-size: 1rem; color: var(--gray-soft); max-width: 500px; margin: 0 auto; line-height: 1.5; }

/* Pills / Tags */
.features-pills { display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; margin-bottom: 40px; }
.pill {
    background: var(--white); border: 1px solid var(--line); border-radius: 12px;
    padding: 12px 20px; font-weight: 600; font-size: 0.9rem; color: var(--primary);
    display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Grid System */
.main-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 24px; }
.grid-col-left, .grid-col-right { display: flex; flex-direction: column; gap: 24px; }

/* Cards */
.card {
    background: var(--white); border: 1.5px solid var(--gold); border-radius: 16px;
    padding: 30px; box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.card-title { display: flex; align-items: center; gap: 10px; font-size: 1.4rem; color: var(--primary); margin-bottom: 16px; font-weight: 600; }
.card-text { font-size: 0.95rem; color: var(--gray); line-height: 1.6; margin-bottom: 20px; }

/* Sobre Card specifics */
.btn-whatsapp {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--green-light); border: 1.5px solid var(--success); color: var(--green-text);
    padding: 10px 20px; border-radius: 50px; font-weight: 600; font-size: 0.9rem;
    text-decoration: none; margin-bottom: 20px; transition: 0.2s;
}
.btn-whatsapp:hover { background: rgba(16, 185, 129, 0.2); }
.wa-icon { width: 18px; height: 18px; }
.card-hint { font-size: 0.85rem; color: var(--gray-soft); line-height: 1.5; }

/* Upload Card specifics */
.upload-area {
    border: 2px dashed var(--gold-soft); border-radius: 16px; padding: 40px 20px;
    text-align: center; background: rgba(212, 175, 55, 0.03); transition: 0.2s;
}
.upload-area:hover { border-color: var(--gold); background: rgba(212, 175, 55, 0.08); }
.upload-icon-svg { width: 40px; height: 40px; margin-bottom: 15px; }

.btn-primary {
    background: var(--gold); color: var(--primary-deep); border: none; padding: 12px 24px;
    border-radius: 8px; font-weight: 700; font-size: 0.95rem; cursor: pointer;
    display: inline-block; margin: 15px 0; transition: all 0.2s; box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3); }

.upload-time { font-size: 0.8rem; color: var(--gray-soft); display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 10px;}

/* Letra Card specifics */
.textarea-letra {
    width: 100%; padding: 16px; border-radius: 8px; border: 1px solid var(--line);
    background: var(--bg-light); font-family: inherit; font-size: 0.95rem; 
    color: var(--primary); resize: vertical; margin-bottom: 10px;
}
.textarea-letra::placeholder { color: var(--gray-soft); }
.textarea-footer { display: flex; flex-direction: column; gap: 5px; margin-bottom: 20px; }
.char-count { font-size: 0.8rem; color: var(--gray-soft); font-weight: 600; }
.info-text { font-size: 0.8rem; color: var(--gray-soft); }

/* ESTILO DO BOTÃO ANALISAR */
.btn-analisar-full {
    width: 100%; background: var(--gold); color: var(--primary-deep); border: none;
    padding: 14px; border-radius: 8px; font-weight: 700; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em;
    display: flex; align-items: center; justify-content: center; cursor: pointer; 
    margin-bottom: 15px; transition: all 0.2s; box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}
.btn-analisar-full:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3); }

.secure-footer { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.8rem; color: var(--gray-soft); }
.secure-footer svg { width: 14px; height: 14px; }

/* Verse Card Right */
.verse-card { background: rgba(212, 175, 55, 0.03); border: 1px solid var(--gold-soft); text-align: center; position: relative; padding: 26px 24px; }
.verse-text { font-size: 1.02rem; color: var(--primary); line-height: 1.45; margin-bottom: 12px; font-style: italic; }
.verse-ref { font-family: 'Inter', sans-serif; font-size: 0.85rem; color: var(--gold); font-weight: 600; }
.quote-mark.large { font-size: 2.1rem; opacity: 0.5; margin-bottom: 4px; }

/* Responsive adjustments */
@media (max-width: 900px) {
    .main-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; justify-content: space-between; padding: 15px; border-right: none; border-bottom: 1px solid var(--line); }
    .sidebar-doacao, .sidebar-versiculo { display: none; }
    .container { padding: 0 20px 40px; }
    .hero-title { font-size: 3rem; }
    .hero-subtitle { font-size: 1.5rem; }
}

/* ===================================================================
   Estilos de RESULTADO (harmonia, forma, teologia, progresso) -
   reconstruídos pra restaurar o que o script.js precisa e que se perde
   toda vez que o CSS é regenerado do zero. Adaptado ao tema escuro.
   =================================================================== */

.result-header {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary);
    margin: 30px 0 16px;
}

.result-card {
    margin-bottom: 16px;
}

.action-buttons {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secundario {
    background: transparent;
    color: var(--gold);
    border: 1.5px solid var(--gold);
    padding: 12px 26px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn-secundario:hover {
    background: var(--gold);
    color: var(--primary-deep);
}

/* Progresso simulado durante a análise */

.progresso-etapas {
    margin-top: 18px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.progresso-barra {
    width: 100%;
    height: 5px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
}

.progresso-barra-preenchimento {
    height: 100%;
    width: 8%;
    background: var(--gold);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.progresso-etapa-texto {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--gray-soft);
    font-style: italic;
}

/* Destaque breve ao chegar automaticamente no resultado */

.resultado-destaque {
    animation: resultado-pulso 1.6s ease;
}

@keyframes resultado-pulso {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.55); }
    30% { box-shadow: 0 0 0 10px rgba(212, 175, 55, 0.22); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

/* Análise Harmônica - com divisórias douradas entre colunas */

.harmonia-legenda {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-size: 0.82rem;
    color: var(--gray-soft);
    margin-bottom: 10px;
    align-items: center;
}

.harmonia-legenda span[class^="funcao-"] {
    font-size: 1rem;
    margin-right: -2px;
}

.harmonia-tabela-container {
    max-height: 340px;
    overflow-y: auto;
    margin-top: 12px;
    border: 1px solid var(--gold-soft);
    border-radius: 8px;
}

#harmoniaTabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

#harmoniaTabela thead th {
    position: sticky;
    top: 0;
    background: var(--primary-deep);
    color: var(--gold);
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid var(--gold);
    border-right: 1px solid rgba(212, 175, 55, 0.35);
}

#harmoniaTabela thead th:last-child {
    border-right: none;
}

#harmoniaTabela tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    border-right: 1px solid rgba(212, 175, 55, 0.22);
    color: var(--gray);
}

#harmoniaTabela tbody td:last-child {
    border-right: none;
}

#harmoniaTabela tbody tr:nth-child(even) {
    background: rgba(212, 175, 55, 0.045);
}

#harmoniaTabela tbody tr:hover {
    background: rgba(212, 175, 55, 0.1);
}

.funcao-T { color: #34D399; font-weight: 700; }
.funcao-S { color: #FBBF24; font-weight: 700; }
.funcao-D { color: #F87171; font-weight: 700; }
.funcao-secundaria { color: #C084FC; font-weight: 700; }
.funcao-emprestimo { color: #67E8F9; font-weight: 700; }
.funcao-indisponivel { color: var(--gray-soft); font-style: italic; }

.harmonia-aviso {
    background: rgba(212, 175, 55, 0.1);
    border-left: 4px solid var(--gold);
    padding: 10px 14px;
    margin-top: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--gray);
}

/* Forma Musical */

.forma-lista {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.forma-secao {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(212, 175, 55, 0.05);
    border-left: 3px solid var(--gold);
    border-radius: 6px;
    font-size: 0.92rem;
}

.forma-letra {
    background: var(--gold);
    color: var(--primary-deep);
    font-weight: 700;
    font-size: 0.82rem;
    min-width: 26px;
    text-align: center;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.forma-letra.forma-letra-vazia {
    background: var(--gray-soft);
    color: var(--primary-deep);
}

.forma-compassos {
    color: var(--gray-soft);
    font-size: 0.82rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.forma-rotulo {
    font-weight: 600;
    color: var(--primary);
}

.forma-inferida-aviso {
    background: rgba(255, 255, 255, 0.04);
    border-left: 4px solid var(--gray-soft);
    padding: 8px 14px;
    margin-bottom: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--gray-soft);
}

/* Teologia */

.teologia-aviso {
    font-size: 0.85rem;
    color: var(--gray-soft);
    margin-bottom: 12px;
}

/* Aviso de "confira a letra" - propositalmente mais chamativo que os
   avisos informativos comuns (harmonia-aviso, forma-inferida-aviso),
   porque é um convite a uma AÇÃO do usuário antes de prosseguir, não só
   uma informação de contexto (Ric, 07/08/2026). Fundo mais saturado,
   borda completa (não só lateral), ícone maior e título em negrito na
   cor de destaque - sem animação em loop pra não incomodar, já que fica
   visível o tempo todo enquanto a seção estiver na tela. */

.teologia-aviso-revisar {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(212, 175, 55, 0.16);
    border: 2px solid var(--gold);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
    font-size: 0.92rem;
    color: var(--primary);
    line-height: 1.5;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.18);
}

.teologia-aviso-revisar-icone {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.teologia-aviso-revisar strong {
    display: block;
    color: var(--gold);
    font-size: 1.02rem;
    margin-bottom: 3px;
}

.teologia-criterio {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.teologia-criterio-nome {
    font-weight: 600;
    color: var(--primary);
}

.teologia-criterio-score {
    font-weight: 700;
    color: var(--gold);
    white-space: nowrap;
    margin-left: 12px;
}

.teologia-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    border: none;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
    font-size: 0.72rem;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
    transition: background 0.15s ease;
}

.teologia-info-btn:hover {
    background: rgba(212, 175, 55, 0.3);
}

.teologia-criterio-definicao {
    display: none;
    font-size: 0.82rem;
    color: var(--gray-soft);
    font-style: italic;
    margin: 6px 0 4px;
    padding-left: 18px;
}

.teologia-criterio-definicao.aberta {
    display: block;
}

.teologia-criterio-definicao li {
    margin-bottom: 1px;
}

.teologia-criterio-analise {
    font-size: 0.88rem;
    color: var(--gray);
    margin: 2px 0 0;
}

.teologia-indice {
    text-align: center;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--gold);
    margin: 16px 0 4px;
}

.teologia-indice-legenda {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gold);
    font-style: normal;
    background: rgba(212, 175, 55, 0.08);
    border-left: 4px solid var(--gold);
    padding: 10px 14px;
    border-radius: 6px;
    margin: 0 0 14px;
}
}

.teologia-parecer {
    background: rgba(255, 255, 255, 0.04);
    border-left: 4px solid var(--gold);
    padding: 10px 14px;
    margin-top: 12px;
    border-radius: 6px;
    font-size: 0.92rem;
    color: var(--gray);
}

.teologia-doacao {
    background: rgba(212, 175, 55, 0.08);
    border-left: 4px solid var(--gold);
    padding: 12px 14px;
    margin: 4px 0 14px;
    border-radius: 6px;
    font-size: 0.88rem;
    color: var(--gray);
    line-height: 1.5;
}

/* ===== Banner de doação em destaque (logo no início da página) ===== */

.doacao-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(212, 175, 55, 0.08);
    border: 1.5px solid var(--gold);
    border-radius: 14px;
    padding: 18px 24px;
    margin-bottom: 32px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.doacao-banner-icone {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.doacao-banner p {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--gray);
}

.doacao-banner-pix {
    color: var(--gold);
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .doacao-banner {
        flex-direction: column;
        text-align: center;
    }
}

/* Spinner de carregamento - a div existia no HTML desde o início, mas
   nunca teve regra CSS nenhuma (Ric, 07/08/2026: por isso parecia que
   nada estava rodando durante a análise). */
.spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto 16px;
    border: 4px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spinner-girar 0.9s linear infinite;
}

@keyframes spinner-girar {
    to { transform: rotate(360deg); }
}

.loading-state {
    text-align: center;
    padding: 30px 20px;
}

.loading-state p {
    color: var(--gray);
    font-size: 0.95rem;
}

   Antes era uma seção cheia na página principal; movida pra dentro da
   sidebar, expandindo/recolhendo ao clicar no link "Baixar Partituras" -
   deixa a página principal mais limpa. Reaproveita as mesmas classes de
   busca/lista/item de antes, com ajustes de espaçamento pra caber na
   largura estreita da barra lateral (260px). */

.sidebar-partituras-conteudo {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 2px 8px;
    margin-top: -6px;
}

.partituras-busca-sidebar {
    padding: 9px 12px;
    font-size: 0.85rem;
    margin-bottom: 0;
}

.partituras-lista-sidebar {
    max-height: 260px;
    gap: 3px;
    margin-bottom: 0;
    padding-right: 2px;
}

.partituras-lista-sidebar .partituras-item {
    padding: 8px 10px;
    gap: 8px;
}

.partituras-lista-sidebar .partituras-nome {
    font-size: 0.8rem;
    line-height: 1.3;
}

.partituras-lista-sidebar .partituras-download {
    width: 26px;
    height: 26px;
}

.partituras-lista-sidebar .partituras-download svg {
    width: 13px;
    height: 13px;
}

.partituras-busca {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--bg-light);
    color: var(--primary);
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 14px;
}

.partituras-busca::placeholder {
    color: var(--gray-soft);
}

.partituras-busca:focus {
    outline: none;
    border-color: var(--gold);
}

.partituras-lista {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.partituras-vazio {
    font-size: 0.9rem;
    color: var(--gray-soft);
    padding: 12px 4px;
    text-align: center;
}

.partituras-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.partituras-nome {
    font-size: 0.95rem;
    color: var(--gray);
    font-weight: 500;
}

.partituras-download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--gold);
    color: var(--primary-deep);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.partituras-download svg {
    width: 17px;
    height: 17px;
}

.partituras-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px -4px rgba(212, 175, 55, 0.5);
}

.sidebar-versao {
    text-align: center;
    font-size: 0.68rem;
    color: var(--gray-soft);
    opacity: 0.6;
    margin-top: 2px;
}