/* =============================================
   KODILIFE — CSS Principal
   Moderno, emocional, limpo e acolhedor
   ============================================= */

:root {
    --primary:     #6c63ff;
    --primary-dark:#5a52e0;
    --accent:      #ff6584;
    --bg:          #0f0f1a;
    --bg-card:     #1a1a2e;
    --bg-input:    #16213e;
    --text:        #e8e8f0;
    --text-muted:  #9090b0;
    --border:      #2a2a4a;
    --success:     #43d9a2;
    --warning:     #ffd166;
    --radius:      14px;
    --shadow:      0 8px 32px rgba(108,99,255,0.15);
    --transition:  0.3s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ---- Layout ---- */
.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 480px; margin: 0 auto; padding: 0 20px; }

/* ---- Tipografia ---- */
h1, h2, h3 { font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p  { color: var(--text-muted); }

/* ---- Gradiente de texto ---- */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}

/* ---- Botões ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 20px rgba(108,99,255,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(108,99,255,0.5); }
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-full { width: 100%; }

/* ---- Formulários ---- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 6px; font-size: 0.9rem; color: var(--text-muted); }
.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color var(--transition);
    outline: none;
}
.form-input:focus { border-color: var(--primary); }
textarea.form-input { resize: vertical; min-height: 110px; }

/* ---- Navbar ---- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(26,26,46,0.95);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}
.navbar-brand {
    font-size: 1.4rem;
    font-weight: 800;
    text-decoration: none;
}
.navbar-user { font-size: 0.9rem; color: var(--text-muted); }
.navbar-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 6px;
    transition: color var(--transition);
}
.navbar-logout:hover { color: var(--accent); }

/* ---- Auth Page ---- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: radial-gradient(ellipse at 20% 50%, rgba(108,99,255,0.15) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, rgba(255,101,132,0.1) 0%, transparent 50%),
                var(--bg);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo h1 { font-size: 2.4rem; }
.auth-logo p { margin-top: 8px; }
.auth-tabs { display: flex; margin-bottom: 24px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.auth-tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all var(--transition);
}
.auth-tab.active { background: var(--primary); color: #fff; }

/* ---- Dashboard ---- */
.dashboard-header { padding: 32px 0 24px; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
@media (max-width: 640px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ---- Roda da Vida ---- */
.wheel-container { display: flex; flex-direction: column; align-items: center; }
.wheel-canvas { max-width: 280px; width: 100%; }
.wheel-legend { margin-top: 16px; width: 100%; }
.wheel-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    margin-bottom: 6px;
    color: var(--text-muted);
}
.wheel-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ---- Fidelidade ---- */
.fidelity-list { display: flex; flex-direction: column; gap: 12px; }
.fidelity-item {}
.fidelity-header { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 0.88rem; }
.fidelity-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.fidelity-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 1s ease; }

/* ---- Pergunta ---- */
.question-page { min-height: 100vh; padding: 20px; }
.question-card { max-width: 680px; margin: 40px auto; }
.question-category {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(108,99,255,0.2);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid rgba(108,99,255,0.3);
}
.question-text { font-size: 1.3rem; font-weight: 600; color: var(--text); margin-bottom: 28px; line-height: 1.5; }

/* ---- Score Selector ---- */
.score-selector { margin-bottom: 24px; }
.score-label { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 12px; display: block; }
.score-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.score-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.score-btn:hover { border-color: var(--primary); color: var(--primary); }
.score-btn.selected { background: var(--primary); border-color: var(--primary); color: #fff; transform: scale(1.1); }

/* ---- Resposta Emocional ---- */
.emotional-section { display: none; animation: fadeIn 0.4s ease; }
.emotional-section.visible { display: block; }
.char-counter { text-align: right; font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.char-counter.ok { color: var(--success); }
.char-counter.over { color: var(--accent); }

/* ---- Análise IA ---- */
.ai-analysis {
    background: linear-gradient(135deg, rgba(108,99,255,0.1), rgba(255,101,132,0.05));
    border: 1px solid rgba(108,99,255,0.25);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 20px;
    display: none;
    animation: fadeIn 0.5s ease;
}
.ai-analysis.visible { display: block; }
.ai-analysis-label { font-size: 0.8rem; color: var(--primary); font-weight: 600; margin-bottom: 8px; letter-spacing: 0.05em; text-transform: uppercase; }
.ai-analysis-text { color: var(--text); line-height: 1.7; }

/* ---- Progresso ---- */
.progress-bar-wrap { background: var(--border); border-radius: 4px; height: 4px; margin-bottom: 20px; }
.progress-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.5s ease; }

/* ---- Relatório ---- */
.report-section { max-width: 700px; margin: 0 auto; padding: 40px 20px; }
.report-card { margin-bottom: 24px; }
.report-text { color: var(--text); line-height: 1.8; font-size: 1.05rem; }

/* ---- Alertas ---- */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-error { background: rgba(255,101,132,0.15); border: 1px solid rgba(255,101,132,0.3); color: #ff8fa3; }
.alert-success { background: rgba(67,217,162,0.15); border: 1px solid rgba(67,217,162,0.3); color: var(--success); }

/* ---- Loading ---- */
.loading { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
.loading-overlay { display: none; position: fixed; inset: 0; background: rgba(15,15,26,0.8); z-index: 999; align-items: center; justify-content: center; flex-direction: column; gap: 16px; }
.loading-overlay.visible { display: flex; }

/* ---- Animações ---- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.fade-in { animation: fadeIn 0.5s ease; }

/* ---- Utilitários ---- */
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); font-size: 0.9rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.hidden { display: none !important; }

/* ---- Crossover Banner ---- */
.crossover-banner {
    background: linear-gradient(135deg, rgba(255,209,102,0.1), rgba(255,101,132,0.08));
    border: 1px solid rgba(255,209,102,0.25);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 20px;
    display: none;
    animation: fadeIn 0.5s ease;
}
.crossover-banner.visible { display: block; }
.crossover-label { font-size: 0.8rem; color: var(--warning); font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- Done State ---- */
.done-state { text-align: center; padding: 60px 20px; }
.done-icon { font-size: 4rem; margin-bottom: 16px; }
