/* ARQUIVO: style.css (VERSÃO MASTER CORRIGIDA) */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Lato:wght@400;700&display=swap');

:root {
    --primary: #a855f7;  /* Roxo Neon */
    --secondary: #db2777; /* Rosa Neon */
    --bg-deep: #0f0718;   /* Fundo App */
    --glass: rgba(30, 20, 50, 0.9);
    --border: #4c1d95;
    --text-main: #e0d4fc;
}

* { box-sizing: border-box; }

body {
    background: radial-gradient(circle at center, #1e0b36 0%, #000000 100%);
    color: var(--text-main);
    font-family: 'Lato', sans-serif;
    margin: 0;
    min-height: 100vh;
    /* Centraliza login, mas deixa o portal livre */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* --- CLASSE MÁGICA PARA O PORTAL (BODY) --- */
/* Isso garante que o portal ocupe a tela toda e não fique centralizado no meio */
body.portal-body {
    display: block !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    background-color: var(--bg-deep);
    padding-bottom: 80px; /* Espaço para menu inferior */
}

/* --- CONTAINER GERAL (LOGIN/FORM) --- */
.container {
    background: rgba(20, 10, 40, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 2rem;
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 0 50px rgba(139, 92, 246, 0.15);
    margin: 20px auto;
    position: relative;
}

/* TIPOGRAFIA */
h1, h2, h3, h4 {
    font-family: 'Cinzel', serif;
    background: linear-gradient(to right, #d8b4fe, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #d8b4fe;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- INPUTS, SELECTS E BOTÕES PEQUENOS (CORREÇÃO DA IMAGEM 2) --- */
input, select, .btn-small {
    width: 100%;
    height: 50px; /* Altura padronizada */
    padding: 0 15px;
    background: rgba(0, 0, 0, 0.6) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px;
    color: white !important;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    transition: 0.3s;
    
    /* Remove estilo padrão feio */
    -webkit-appearance: none;
    appearance: none;
}

/* Select com Seta Roxa */
select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a855f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
    cursor: pointer;
}

/* Botão "Não Sei" / "Sei a data" */
button.btn-small {
    background: rgba(139, 92, 246, 0.15) !important;
    color: #d8b4fe !important;
    cursor: pointer;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
button.btn-small:hover {
    background: var(--primary) !important;
    color: white !important;
    border-color: #d8b4fe !important;
}

.input-row {
    display: flex;
    gap: 10px;
}

/* --- ESTILOS DO PORTAL (CORREÇÃO DA IMAGEM 3) --- */

/* Header do App */
.app-header {
    background: rgba(20, 10, 40, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.avatar {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; color: white;
    border: 2px solid rgba(255,255,255,0.2);
}

.app-content {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* Hero Card (Destaque) */
.hero-card {
    background: linear-gradient(135deg, #4c1d95 0%, #be185d 100%);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}
.hero-card h3 { color: white; -webkit-text-fill-color: white; margin: 5px 0; font-size: 1.4rem; }
.hero-card p { color: rgba(255,255,255,0.8); font-size: 0.9rem; margin-bottom: 15px; }

.btn-hero {
    background: white; color: #be185d;
    padding: 8px 16px; border-radius: 20px;
    text-decoration: none; font-weight: bold; font-size: 0.85rem;
    display: inline-flex; align-items: center; gap: 5px;
}

/* GRID DE SERVIÇOS (AQUI ESTAVA O ERRO) */
.services-grid {
    display: grid !important; /* Força o grid */
    grid-template-columns: 1fr 1fr; /* 2 Colunas */
    gap: 15px;
    width: 100%;
}

.service-card {
    background: rgba(30, 20, 50, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    padding: 15px;
    position: relative;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-card:hover {
    background: rgba(50, 30, 80, 0.9);
    transform: translateY(-3px);
    border-color: #a855f7;
}

.icon-box {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.05);
}

.card-info h4 { font-size: 0.9rem; color: white; -webkit-text-fill-color: white; margin: 0; font-family: 'Lato', sans-serif; font-weight: bold; }
.card-info p { font-size: 0.7rem; color: #a78bfa; margin: 0; }

.lock-icon {
    position: absolute; top: 10px; right: 10px;
    width: 14px; height: 14px; opacity: 0.5;
}

/* Navegação Inferior (Mobile) */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(15, 7, 24, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; justify-content: space-around;
    padding: 12px 0 20px 0;
    z-index: 200;
}

.bottom-nav a {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.7rem;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.bottom-nav a.active { color: #d8b4fe; }

/* Botão Mágico (Geral) */
.btn-magic {
    width: 100%; padding: 15px;
    background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
    border: none; border-radius: 12px;
    color: white; font-weight: bold; text-transform: uppercase;
    cursor: pointer; margin-top: 15px;
    font-family: 'Cinzel', serif;
}

/* Cores dos Ícones */
.color-pink { background: rgba(219, 39, 119, 0.2); }
.color-purple { background: rgba(147, 51, 234, 0.2); }
.color-blue { background: rgba(37, 99, 235, 0.2); }
.color-gold { background: rgba(217, 119, 6, 0.2); }

/* Utilitários */
.hidden { display: none !important; }
.row { display: flex; gap: 10px; }
.col { flex: 1; }

/* --- OTIMIZAÇÃO PARA TELAS PEQUENAS (iPhone SE, Mini, Antigos) --- */
@media (max-height: 800px) {

    /* 1. LOGIN: Encolhe o ícone e margens */
    body.login-body {
        justify-content: center; /* Centraliza melhor */
        gap: 10px; /* Menos espaço entre card e rodapé */
        padding: 10px;
    }

    /* Reduz o cartão de login */
    .container {
        padding: 1.5rem !important; /* Menos borda interna */
        margin: 10px auto !important;
    }

    /* Reduz o ícone da chave no login */
    .container div[style*="width: 70px"] {
        width: 50px !important;
        height: 50px !important;
        margin-bottom: 10px !important;
    }
    .container div[style*="width: 70px"] svg {
        width: 24px !important;
        height: 24px !important;
    }

    /* Títulos menores */
    h2 { font-size: 1.4rem !important; margin-bottom: 5px !important; }
    p { font-size: 0.85rem !important; }

    /* Inputs menores */
    input, select, .btn-small { height: 40px !important; font-size: 0.9rem !important; }
    label { margin-bottom: 4px !important; font-size: 0.7rem !important; }
    .btn-magic { padding: 10px !important; font-size: 0.9rem !important; }

    /* 2. PORTAL: Header mais fino */
    .app-header {
        padding: 10px 15px !important;
    }
    .app-header h2 { font-size: 1.1rem !important; }
    
    /* Widget da Lua menor */
    .moon-widget { padding: 2px 8px !important; gap: 5px !important; }
    .moon-icon { font-size: 1.1rem !important; }
    .moon-label { font-size: 0.6rem !important; }
    
    /* Card de Destaque (Hero) mais baixo */
    .hero-card {
        padding: 15px !important;
        margin-bottom: 20px !important; /* Menos espaço embaixo */
    }
    .hero-card h3 { font-size: 1.2rem !important; margin-top: 5px !important; }
    
    /* Grid de Apps mais apertada */
    .services-grid {
        gap: 10px !important;
    }
    
    .service-card {
        padding: 12px !important;
        min-height: auto !important; /* Remove altura forçada */
        gap: 8px !important;
    }
    
    .icon-box { width: 35px !important; height: 35px !important; }
    .icon-box svg { width: 18px !important; height: 18px !important; }
    
    .card-info h4 { font-size: 0.8rem !important; }
    .card-info p { font-size: 0.65rem !important; }

    /* 3. BÚSSOLA: Reduz o círculo gigante */
    .compass-container {
        width: 180px !important;
        height: 180px !important;
        margin: 15px auto !important;
    }
    
    .compass-icon svg {
        width: 100px !important;
        height: 100px !important;
    }
    
    .answer-text { font-size: 1.3rem !important; }
    .answer-box { min-height: 80px !important; margin-top: 10px !important; }
    
    /* 4. PERFIL: Reduz padding */
    .profile-card { padding: 20px 15px !important; margin-top: 10px !important; }
    .avatar-large { width: 60px !important; height: 60px !important; font-size: 1.8rem !important; margin-bottom: 10px !important; }
    .user-name { font-size: 1.2rem !important; }
    .menu-item { padding: 10px !important; }
    
    /* Esconde rodapé legal no login se a tela for MUITO pequena (tipo iPhone 5) para não quebrar */
    @media (max-height: 600px) {
        .legal-footer { margin-top: 10px !important; }
    }
}