/* ── Soul Element — Design System ── */
:root {
    /* Core palette */
    --bg-primary: #FAF8F5;
    --bg-card: #FFFFFF;
    --bg-accent: #F0EDE5;
    
    /* Brand colors */
    --green-deep: #2D5016;
    --green-mid: #4A7C2A;
    --green-light: #E8F0E0;
    --gold: #C8963E;
    --gold-light: #F5E6CC;
    --purple: #7B6B8A;
    --purple-light: #EDE8F2;
    
    /* Text */
    --text-primary: #1A1A1A;
    --text-secondary: #5C5C5C;
    --text-muted: #999999;
    
    /* UI */
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.08);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Georgia', 'Times New Roman', serif;
}

/* ── Reset ── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Navbar ── */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(250,248,245,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 0 2rem;
}
.nav-container {
    max-width: 1100px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 60px;
}
.nav-brand {
    display: flex; align-items: center; gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 1.3rem; font-weight: 700;
    color: var(--green-deep);
    cursor: pointer;
    text-decoration: none;
}
.nav-brand .icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid var(--green-deep);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.85rem; font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--green-deep); }
.nav-account { display: flex; align-items: center; gap: 0.8rem; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.6rem 1.4rem; border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    border: none; transition: all 0.2s; text-decoration: none;
}
.btn-primary {
    background: var(--green-deep); color: #fff;
}
.btn-primary:hover { background: var(--green-mid); transform: translateY(-1px); }
.btn-outline {
    background: transparent; color: var(--green-deep);
    border: 1.5px solid var(--green-deep);
}
.btn-outline:hover { background: var(--green-light); }
.btn-gold {
    background: var(--gold); color: #fff;
}
.btn-gold:hover { background: #b8842e; }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.8rem; }

/* ── Page structure ── */
.page { display: none; max-width: 1100px; margin: 0 auto; padding: 2rem; }
.page.active { display: block; }

/* ── Hero ── */
.hero {
    text-align: center; padding: 5rem 2rem 4rem;
}
.hero h1 {
    font-family: var(--font-display);
    font-size: 2.8rem; font-weight: 700;
    color: var(--green-deep); line-height: 1.2;
    margin-bottom: 1rem;
}
.hero p {
    font-size: 1.15rem; color: var(--text-secondary);
    max-width: 520px; margin: 0 auto 2rem;
    line-height: 1.7;
}
.hero-birth-form {
    display: flex; gap: 0.6rem; justify-content: center;
    flex-wrap: wrap; margin-top: 2rem;
}
.hero-birth-form input, .hero-birth-form select {
    padding: 0.7rem 1rem; border-radius: var(--radius-sm);
    border: 1.5px solid #D4D0C8; background: #fff;
    font-size: 0.9rem; font-family: var(--font);
    width: 100px;
}
.hero-birth-form input:focus, .hero-birth-form select:focus {
    outline: none; border-color: var(--green-deep);
}
.hero-birth-form .btn { height: 44px; }

/* ── Cards ── */
.card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 1.5rem; box-shadow: var(--shadow);
}
.card h3 {
    font-size: 1.1rem; color: var(--green-deep);
    margin-bottom: 0.5rem;
}
.card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

.feature-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem; margin: 3rem 0;
}
.feature-card {
    text-align: center; padding: 2rem 1.5rem;
    background: var(--bg-card); border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s;
    cursor: pointer;
}
.feature-card:hover { transform: translateY(-4px); }
.feature-card .icon {
    font-size: 2.5rem; margin-bottom: 1rem;
}
.feature-card h3 { font-size: 1.1rem; color: var(--green-deep); margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.85rem; color: var(--text-muted); }

/* ── Profile Report ── */
.profile-header {
    text-align: center; padding: 2rem 0;
}
.profile-type-badge {
    display: inline-block;
    background: var(--green-light); color: var(--green-deep);
    padding: 0.5rem 1.5rem; border-radius: 50px;
    font-size: 0.85rem; font-weight: 600;
    margin-bottom: 1rem;
}
.profile-type-name {
    font-family: var(--font-display);
    font-size: 2.2rem; color: var(--green-deep);
    margin-bottom: 0.5rem;
}
.profile-tagline {
    font-size: 1.05rem; color: var(--text-secondary);
    max-width: 500px; margin: 0 auto;
    font-style: italic; line-height: 1.6;
}

/* Element bar chart */
.element-bars {
    display: flex; gap: 1.5rem; justify-content: center;
    margin: 2rem 0; flex-wrap: wrap;
}
.element-bar {
    text-align: center; width: 100px;
}
.element-bar .bar {
    height: 160px; width: 24px; margin: 0 auto 0.5rem;
    background: var(--bg-accent); border-radius: 12px;
    position: relative; overflow: hidden;
}
.element-bar .bar .fill {
    position: absolute; bottom: 0; left: 0; right: 0;
    border-radius: 0 0 12px 12px;
    transition: height 0.8s ease;
}
.fill.wood { background: #4CAF50; }
.fill.fire { background: #F44336; }
.fill.earth { background: #FF9800; }
.fill.metal { background: #9E9E9E; }
.fill.water { background: #2196F3; }
.element-bar .label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.element-bar .pct { font-size: 0.75rem; color: var(--text-muted); }

/* Sections */
.report-section {
    margin: 2.5rem 0;
}
.report-section h4 {
    font-size: 1.05rem; color: var(--green-deep);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--green-light);
}
.gift-list, .shadow-list {
    list-style: none; padding: 0;
}
.gift-list li, .shadow-list li {
    padding: 0.6rem 0; font-size: 0.9rem;
    color: var(--text-secondary); line-height: 1.5;
}
.gift-list li::before { content: '✦ '; color: var(--gold); }
.shadow-list li::before { content: '~ '; color: var(--purple); }

.value-card {
    background: var(--green-light); border-radius: var(--radius-sm);
    padding: 1.2rem; margin-bottom: 0.8rem;
}
.value-card h5 { font-size: 0.85rem; color: var(--green-deep); margin-bottom: 0.3rem; }
.value-card p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; }

.growth-arc {
    background: linear-gradient(135deg, var(--purple-light), var(--gold-light));
    border-radius: var(--radius); padding: 1.5rem;
}
.growth-arc p { font-size: 0.9rem; color: var(--text-primary); line-height: 1.7; }

/* ── Chat ── */
.chat-container {
    max-width: 700px; margin: 0 auto;
}
.chat-messages {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 1.5rem; min-height: 400px; max-height: 500px;
    overflow-y: auto; margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.chat-msg {
    margin-bottom: 1rem; display: flex; gap: 0.6rem;
}
.chat-msg.guide { justify-content: flex-start; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg .bubble {
    max-width: 75%; padding: 0.8rem 1rem;
    border-radius: 16px; font-size: 0.9rem; line-height: 1.5;
}
.chat-msg.guide .bubble {
    background: var(--green-light); color: var(--text-primary);
    border-bottom-left-radius: 4px;
}
.chat-msg.user .bubble {
    background: var(--green-deep); color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-input-wrap {
    display: flex; gap: 0.6rem;
}
.chat-input-wrap input {
    flex: 1; padding: 0.8rem 1rem; border-radius: var(--radius-sm);
    border: 1.5px solid #D4D0C8; font-size: 0.9rem;
    font-family: var(--font);
}
.chat-input-wrap input:focus { outline: none; border-color: var(--green-deep); }

/* ── Footer ── */
.footer {
    text-align: center; padding: 2rem;
    color: var(--text-muted); font-size: 0.8rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* ── Loading ── */
.loading {
    text-align: center; padding: 3rem;
    color: var(--text-muted); font-size: 0.9rem;
}
.spinner {
    display: inline-block; width: 32px; height: 32px;
    border: 3px solid var(--green-light);
    border-top-color: var(--green-deep);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
.toast {
    position: fixed; bottom: 2rem; right: 2rem;
    background: var(--green-deep); color: #fff;
    padding: 0.8rem 1.5rem; border-radius: var(--radius-sm);
    font-size: 0.85rem; box-shadow: var(--shadow-lg);
    z-index: 1000; opacity: 0; transform: translateY(20px);
    transition: all 0.3s;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Mood Buttons ── */
.mood-btn {
    padding: 0.8rem 1.2rem; border-radius: var(--radius-sm);
    border: 1.5px solid #D4D0C8; background: #fff;
    font-size: 0.9rem; cursor: pointer; transition: all 0.2s;
}
.mood-btn:hover { border-color: var(--green-deep); background: var(--green-light); transform: translateY(-2px); }

/* ── Auth Modal ── */
.auth-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 999; display: none; align-items: center; justify-content: center;
}
.auth-overlay.show { display: flex; }
.auth-modal {
    background: #fff; border-radius: 16px; padding: 2.5rem 2rem;
    max-width: 400px; width: 90%; position: relative;
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}
.auth-modal h3 { color: var(--green-deep); font-size: 1.3rem; margin-bottom: 0.3rem; }
.auth-close {
    position: absolute; top: 1rem; right: 1rem;
    background: none; border: none; font-size: 1.2rem;
    color: var(--text-muted); cursor: pointer;
}
.auth-modal input {
    font-family: var(--font);
}
.auth-modal input:focus { outline: none; border-color: var(--green-deep); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .feature-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .hero h1 { font-size: 2rem; }
    .hero-birth-form { flex-direction: column; align-items: center; }
    .hero-birth-form input { width: 100%; }
}
