/* css/portal.css - O TRONO SOLAR (CORREÇÃO DE LAYOUTS) */

:root {
    --ouro-solar: #ffaa00;     
    --dourado-antigo: #d4af37; 
    --chama-viva: #ff4500;     
    --azul-profundo: #050510;  
    --luz-liquida: rgba(255, 220, 100, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Lato', sans-serif;
    background: var(--azul-profundo);
    color: #f0f0ff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; 
}

/* Fundo Astral Global */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('../assets/PortalElluminar/Portal_Principal.png') no-repeat center center fixed;
    background-size: cover;
    box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.6);
    z-index: -2;
}

/* ==========================================================================
   1. CABEÇALHO E HERO
   ========================================================================== */
.portal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 40px; background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    position: sticky; top: 0; z-index: 100; backdrop-filter: blur(5px);
}
.logo-area { display: flex; align-items: center; gap: 15px; }
.simbolo-img { height: 50px; width: auto; filter: drop-shadow(0 0 5px var(--ouro-solar)); }
.portal-header h1 { font-family: 'Cinzel', serif; color: var(--dourado-antigo); font-size: 1.4rem; text-transform: uppercase; }
.chave-ativacao { font-family: monospace; color: var(--ouro-solar); border: 1px solid var(--ouro-solar); padding: 5px 10px; border-radius: 5px; }

.hero-section { text-align: center; padding: 80px 20px; max-width: 900px; margin: 0 auto; }
.hero-section h2 { font-family: 'Cinzel', serif; font-size: 3rem; background: linear-gradient(to right, var(--dourado-antigo), #fff, var(--dourado-antigo)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 20px; }
.canalizacao-portal { background: rgba(255, 170, 0, 0.05); border-left: 3px solid var(--ouro-solar); padding: 20px; font-style: italic; font-size: 1.1rem; color: #fceecb; margin: 30px auto; max-width: 700px; }
.btn-scroll { display: inline-block; margin-top: 30px; color: var(--dourado-antigo); border: 1px solid var(--dourado-antigo); padding: 10px 20px; border-radius: 30px; text-decoration: none; transition: 0.3s; }
.btn-scroll:hover { background: var(--dourado-antigo); color: #000; }

.modulos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; padding: 60px 20px; max-width: 1200px; margin: 0 auto; }
.card-modulo { background: rgba(10, 10, 20, 0.8); border: 1px solid rgba(212, 175, 55, 0.3); padding: 40px; border-radius: 20px; text-align: center; text-decoration: none; color: #fff; transition: 0.4s; display: flex; flex-direction: column; align-items: center; }
.card-modulo:hover { transform: translateY(-10px); border-color: var(--ouro-solar); }
.icon-modulo { font-size: 3rem; margin-bottom: 20px; }
.btn-acessar { margin-top: auto; padding: 10px 25px; background: var(--dourado-antigo); color: #000; font-weight: bold; border-radius: 30px; }

/* Carrossel */
.carrossel-section { padding: 40px 0; background: rgba(0, 0, 0, 0.4); overflow: hidden; text-align: center; border-top: 1px solid rgba(212, 175, 55, 0.1); border-bottom: 1px solid rgba(212, 175, 55, 0.1); }
.titulo-carrossel { font-family: 'Cinzel', serif; color: var(--dourado-antigo); margin-bottom: 30px; font-size: 1.5rem; text-transform: uppercase; }
.carrossel-container { width: 100%; overflow: hidden; display: flex; padding: 10px 0; }
.carrossel-trilho { display: flex; gap: 40px; animation: rolarInfinito 40s linear infinite; width: max-content; padding-left: 50px; }
.carrossel-trilho:hover { animation-play-state: paused; }
.item-carrossel { display: flex; flex-direction: column; align-items: center; width: 200px; height: 320px; text-decoration: none; transition: transform 0.3s ease; }
.item-carrossel:hover { transform: scale(1.05); }
.item-carrossel img { width: 100%; height: 280px; object-fit: contain; filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.5)); }
.legenda { color: #e0e0e0; margin-top: 10px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; }
@keyframes rolarInfinito { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ==========================================================================
   2. O APP DE TARÔ
   ========================================================================== */
.tela { display: none; opacity: 0; transition: opacity 0.5s ease; width: 100%; max-width: 1200px; margin: 0 auto; padding-top: 20px; }
.tela.ativa { display: block; opacity: 1; animation: surgimento 0.8s ease-out; }
@keyframes surgimento { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.conteudo-central { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70vh; text-align: center; padding: 20px; }

/* INPUTS E BOTÕES */
.formulario { background: rgba(0,0,0,0.6); padding: 30px; border-radius: 15px; border: 1px solid var(--dourado-antigo); width: 100%; max-width: 400px; }
.label-luz { display: block; color: var(--ouro-solar); margin-bottom: 5px; text-align: left; }
.campo-input input { width: 100%; padding: 12px; background: #fff; color: #000; border: 1px solid #ccc; border-radius: 5px; margin-bottom: 15px; }
.btn-luz { background: linear-gradient(45deg, var(--dourado-antigo), #b8860b); border: none; padding: 12px 30px; color: #000; font-weight: bold; font-family: 'Cinzel', serif; border-radius: 30px; cursor: pointer; box-shadow: 0 0 15px rgba(212, 175, 55, 0.4); transition: 0.3s; margin-top: 10px; }
.btn-luz:hover { transform: scale(1.05); }

/* LOADER / SINTONIA */
.loader-egregora { position: relative; width: 150px; height: 150px; margin: 0 auto 30px auto; display: flex; justify-content: center; align-items: center; }
.loader-egregora::before { content: ""; position: absolute; width: 100%; height: 100%; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--ouro-solar); border-left-color: var(--dourado-antigo); animation: giroDivino 1.5s linear infinite; }
.loader-egregora::after { content: ""; position: absolute; width: 70%; height: 70%; border-radius: 50%; border: 3px solid transparent; border-bottom-color: var(--chama-viva); border-right-color: orangered; animation: giroDivino 2s linear infinite reverse; }
.texto-sintonia { font-family: 'Cinzel'; color: var(--ouro-solar); animation: pulsoLuz 2s infinite; }
@keyframes giroDivino { to { transform: rotate(360deg); } }
@keyframes pulsoLuz { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* TEXTO MEDITAÇÃO */
.texto-meditacao-box { background: rgba(0, 0, 0, 0.6); border: 1px solid var(--dourado-antigo); padding: 40px; border-radius: 20px; max-width: 800px; margin-bottom: 30px; }
.texto-sagrado { font-family: 'Cinzel', serif; font-size: 1.5rem; color: #fff; line-height: 1.8; text-shadow: 0 2px 4px #000; }

/* SELEÇÃO DE LEITURA (CARDS COM IMAGENS) */
.opcoes-grid { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; margin-top: 40px; }
.card-opcao-visual { width: 280px; height: 380px; border-radius: 15px; border: 2px solid var(--dourado-antigo); cursor: pointer; transition: 0.4s; position: relative; overflow: hidden; background-size: cover; background-position: center; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.bg-unica { background-image: url('../assets/interface/tiragem_unica.png'); }
.bg-triade { background-image: url('../assets/interface/tiragem_triade.png'); }
.bg-cruz { background-image: url('../assets/interface/tiragem_cruz.png'); }
.card-overlay { background: rgba(0, 0, 0, 0.6); width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 20px; transition: 0.4s; }
.card-opcao-visual:hover { transform: translateY(-10px); border-color: var(--ouro-solar); }
.card-opcao-visual:hover .card-overlay { background: rgba(0, 0, 0, 0.3); }
.card-opcao-visual.selecionado { border: 4px solid var(--ouro-solar); transform: scale(1.05); }
.card-opcao-visual h3 { color: #fff; font-size: 1.4rem; margin: 10px 0; text-shadow: 0 2px 5px #000; }
.card-opcao-visual p { color: #ddd; font-size: 0.9rem; }

/* ÁREA DA PERGUNTA */
.container-pergunta { margin-top: 60px !important; display: flex; flex-direction: column; align-items: center; width: 100%; animation: surgimento 0.8s ease-out; }
.icone-foco { font-size: 3rem; margin-bottom: 20px; color: var(--ouro-solar); animation: pulsoLuz 2s infinite; }
.input-pergunta { width: 90%; max-width: 700px; height: 120px; background: #fff; color: #000; border: 2px solid var(--dourado-antigo); padding: 20px; border-radius: 15px; font-size: 1.1rem; margin-bottom: 30px !important; text-align: center; }
.input-pergunta:focus { outline: none; border-color: var(--ouro-solar); box-shadow: 0 0 20px rgba(255, 170, 0, 0.2); }

/* ==========================================================================
   3. MESA DE CARTAS (LAYOUTS CORRIGIDOS)
   ========================================================================== */
.mesa-cartas-grid {
    display: grid;
    justify-content: center;
    gap: 30px;
    padding: 40px 0;
    width: 100%;
}

/* ÚNICA: Centralizada */
.layout-unica { 
    grid-template-columns: minmax(200px, 250px); 
}

/* TRÍADE: Força 3 Colunas (Horizontal) */
.layout-triade { 
    grid-template-columns: repeat(3, 1fr); 
    max-width: 900px; 
    margin: 0 auto;
}

/* =========================================
   LAYOUT CRUZ ESTELAR (FORMATO REAL DE CRUZ)
   ========================================= */

.layout-cruz {
    display: grid;
    /* Define o grid de 3 colunas e 3 linhas */
    grid-template-columns: repeat(3, 160px); 
    grid-template-rows: repeat(3, 240px);
    gap: 20px;
    justify-content: center;
    
    /* DESENHO DA CRUZ: Define as áreas nomeadas */
    grid-template-areas:
        ".      top    ."
        "left   center right"
        ".      bottom .";
    
    max-width: 1000px;
    margin: 0 auto;
}

/* Agora, mandamos cada carta (pela ordem de sorteio) para sua casa */

/* Carta 1: O Coração (Você) -> VAI NO CENTRO */
.layout-cruz .slot-carta:nth-child(1) { 
    grid-area: center; 
    z-index: 2; /* Fica levemente acima se houver sobreposição */
}

/* Carta 2: O Desafio -> VAI NA ESQUERDA (Cruzando o caminho) */
.layout-cruz .slot-carta:nth-child(2) { 
    grid-area: left; 
}

/* Carta 3: A Raiz -> VAI EMBAIXO (Base) */
.layout-cruz .slot-carta:nth-child(3) { 
    grid-area: bottom; 
}

/* Carta 4: A Coroa -> VAI NO TOPO (Consciência) */
.layout-cruz .slot-carta:nth-child(4) { 
    grid-area: top; 
}

/* Carta 5: O Destino -> VAI NA DIREITA (Futuro) */
.layout-cruz .slot-carta:nth-child(5) { 
    grid-area: right; 
}


/* --- ADAPTAÇÃO MOBILE --- */
/* No celular, a cruz fica muito pequena, então empilhamos numa coluna bonita */
@media (max-width: 768px) {
    .layout-cruz {
        display: flex;
        flex-direction: column;
        align-items: center;
        height: auto; /* Remove altura fixa */
    }
    
    /* Removemos as áreas de grid no mobile */
    .layout-cruz .slot-carta:nth-child(n) {
        grid-area: auto;
        margin-bottom: 20px;
        width: 100%;
        max-width: 200px; /* Tamanho confortável no celular */
    }
}

/* Responsividade Mobile para a Tríade e Cruz */
@media (max-width: 768px) {
    .layout-triade, .layout-cruz {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

/* ESTILO DA CARTA */
.slot-carta { width: 100%; aspect-ratio: 2/3; perspective: 1000px; cursor: pointer; }
.carta-inner { position: relative; width: 100%; height: 100%; text-align: center; transition: transform 0.8s; transform-style: preserve-3d; }
.slot-carta.revelada .carta-inner { transform: rotateY(180deg); }
.carta-frente, .carta-verso { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.5); }
.carta-verso { background-image: url('../assets/cartas/verso.png'); background-size: cover; border: 2px solid var(--dourado-antigo); background-color: #111; }
.carta-frente { transform: rotateY(180deg); background: #000; }
.carta-frente img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }

/* INPUTS FINAIS */
.painel-integracao { background: rgba(20, 20, 40, 0.8); border: 1px solid var(--dourado-antigo); padding: 25px; border-radius: 15px; margin-top: 30px; text-align: left; }
.input-area-larga { width: 100%; height: 150px; background: #fff; color: #000; padding: 15px; border-radius: 10px; margin-top: 10px; border: 1px solid #ccc; font-family: 'Lato', sans-serif; }

/* MESTRES & FOOTER */
.mestres-section { padding: 60px 20px 100px; max-width: 1000px; margin: 0 auto; text-align: center; }
.titulo-mestres { font-family: 'Cinzel', serif; font-size: 2.2rem; color: var(--dourado-antigo); margin-bottom: 50px; }
.mestres-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; justify-content: center; }
.card-mestre { display: flex; flex-direction: column; align-items: center; text-decoration: none; cursor: default; }
.moldura-foto { width: 100%; max-width: 180px; aspect-ratio: 3/4; border: 1px solid rgba(212, 175, 55, 0.4); padding: 5px; border-radius: 10px; background: rgba(0, 0, 0, 0.3); transition: 0.4s; }
.card-mestre:hover .moldura-foto { border-color: var(--ouro-solar); transform: scale(1.05); }
.moldura-foto img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; filter: brightness(0.9) sepia(0.2); }
.card-mestre:hover img { filter: brightness(1.1) sepia(0); }
.card-mestre h3 { font-family: 'Cinzel', serif; color: #ccc; margin-top: 15px; font-size: 1.1rem; }

.portal-footer { text-align: center; padding: 40px 20px; background: linear-gradient(to top, #000000, rgba(10, 26, 60, 0.9)); border-top: 1px solid rgba(212, 175, 55, 0.3); margin-top: auto; }
.afirmacao-final { font-family: 'Cinzel', serif; font-size: 1.3rem; color: var(--ouro-solar); margin-bottom: 20px; background: rgba(212, 175, 55, 0.1); display: inline-block; padding: 15px 30px; border-radius: 50px; border: 1px solid rgba(212, 175, 55, 0.3); }
.copyright { font-size: 0.8rem; color: #666; }

/* ==========================================================================
   IMPRESSÃO PDF (CAPA DE LUXO + NATIVO)
   ========================================================================== */
#container-pdf-oculto { display: none; }

@media print {
    body::before { display: none !important; background: none !important; }
    body { background-color: white !important; background-image: none !important; }
    body * { visibility: hidden; }
    
    #container-pdf-oculto, #container-pdf-oculto * { visibility: visible; }
    
    #container-pdf-oculto {
        display: block !important; position: absolute; left: 0; top: 0; width: 100%;
        background-color: white !important;
    }
    @page { size: A4 portrait; margin: 10mm; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    
    .capa-pdf { width: 100% !important; height: 100vh; display: flex; justify-content: center; align-items: center; page-break-after: always; text-align: center; border: 5px double #d4af37 !important; padding: 40px !important; }
    .logo-capa { width: 120px; margin-bottom: 30px; }
    .titulo-capa { font-family: 'Cinzel', serif; font-size: 3rem !important; color: #b8860b !important; margin-bottom: 10px; text-transform: uppercase; }
    .subtitulo-capa { font-family: 'Cinzel', serif; font-size: 1.5rem !important; color: #666 !important; margin-bottom: 60px; text-transform: uppercase; }
    .dados-capa { text-align: left; display: inline-block; margin: 0 auto; font-size: 1.1rem; line-height: 2; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; padding: 30px 0; width: 80%; }
    .footer-capa { margin-top: 80px; font-style: italic; color: #888 !important; font-size: 0.9rem; }

    .pagina-pdf { width: 100% !important; border: none !important; page-break-after: always; padding: 20px 0 !important; }
    img, .carta-pdf-item { break-inside: avoid; }
    h1, h2, h3, h4, strong { color: #b8860b !important; }
    p, span, div { color: #000000 !important; }
    .essencia-pdf-box { background-color: #fffbf0 !important; border: 2px solid #d4af37 !important; }
    
    .assinatura-box { margin-top: 60px; text-align: center; page-break-inside: avoid; }
    .linha-assinatura { width: 300px; border-top: 1px solid #000; margin: 0 auto 10px auto; }
    .texto-assinatura { font-family: 'Cinzel', serif; color: #b8860b !important; font-weight: bold; }
}