:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --background: #0a0f1e;
    --surface: rgba(22, 32, 56, 0.75);
    --surface-hover: rgba(30, 41, 80, 0.9);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: rgba(255, 255, 255, 0.09);
    --success: #10b981;
    --gold: #f59e0b;
    --glass-blur: 16px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(99, 102, 241, 0.18) 0px, transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(236, 72, 153, 0.15) 0px, transparent 55%),
        radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.05) 0px, transparent 60%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    line-height: 1.65;
    padding: 40px 0;
}

.app-container {
    width: 100%;
    max-width: 640px;
    padding: 20px;
    position: relative;
}

/* ── VIEWS ──────────────────────────────────────────────────────────────────── */
.view { display: none; opacity: 0; transform: translateY(24px); transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.view.active { display: block; animation: slideUpFade 0.5s forwards; }
@keyframes slideUpFade { to { opacity: 1; transform: translateY(0); } }

/* ── GLASS CARD ─────────────────────────────────────────────────────────────── */
.glass-card {
    background: var(--surface);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 32px 64px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04) inset;
    margin-bottom: 16px;
}

.text-center { text-align: center; }

/* ── TYPOGRAPHY ─────────────────────────────────────────────────────────────── */
h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; }

.gradient-text {
    background: linear-gradient(135deg, #a78bfa, #ec4899, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    line-height: 1.2;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ── BADGE ──────────────────────────────────────────────────────────────────── */
.badge {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(99, 102, 241, 0.2));
    color: #fbcfe8;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    display: inline-block;
    border: 1px solid rgba(236, 72, 153, 0.25);
}

/* ── WELCOME ────────────────────────────────────────────────────────────────── */
#welcome-screen .glass-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
#welcome-screen h1.gradient-text { font-size: 2.8rem; margin: 12px 0 20px; }
.welcome-disclaimer { font-size: 0.8rem; color: var(--text-secondary); margin-top: 20px; opacity: 0.7; }

.features { display: flex; justify-content: center; gap: 12px; margin-bottom: 36px; flex-wrap: wrap; }
.feature-item {
    display: flex; align-items: center; gap: 8px;
    color: var(--text-secondary); font-size: 0.9rem;
    background: rgba(255,255,255,0.05); padding: 8px 16px;
    border-radius: 100px; border: 1px solid var(--border);
}

/* ── BUTTONS ────────────────────────────────────────────────────────────────── */
button { font-family: 'Outfit', sans-serif; border: none; cursor: pointer; border-radius: 16px; font-size: 1.05rem; font-weight: 600; transition: all 0.3s ease; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; padding: 17px 32px; width: 100%;
    display: flex; justify-content: center; align-items: center; gap: 12px;
    box-shadow: 0 12px 28px -6px rgba(99, 102, 241, 0.45);
    letter-spacing: 0.01em;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -6px rgba(99, 102, 241, 0.65); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: transparent; color: var(--text-secondary);
    padding: 16px 32px; width: 100%; margin-top: 14px;
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

/* ── ICON PULSE ─────────────────────────────────────────────────────────────── */
.icon-pulse {
    width: 88px; height: 88px; border-radius: 50%;
    background: rgba(99, 102, 241, 0.12);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px; color: var(--primary);
    animation: pulse 2.2s ease infinite;
    border: 1px solid rgba(99,102,241,0.25);
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(99,102,241,0.4); }
    70% { box-shadow: 0 0 0 22px rgba(99,102,241,0); }
    100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
}

/* ── PROGRESS ───────────────────────────────────────────────────────────────── */
.progress-container { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.progress-bar { flex: 1; height: 8px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); width: 0%; transition: width 0.5s cubic-bezier(0.4,0,0.2,1); border-radius: 4px; }
.progress-text { font-weight: 700; color: var(--text-secondary); min-width: 50px; text-align: right; font-size: 0.95rem; }

/* ── QUIZ CARD ──────────────────────────────────────────────────────────────── */
.quiz-card { padding: 36px; }
.question-text { font-size: 1.45rem; font-weight: 600; margin-bottom: 10px; line-height: 1.45; }
.instruction { color: var(--text-secondary); margin-bottom: 28px; font-size: 0.9rem; }
.options-container { display: flex; flex-direction: column; gap: 10px; }

.option-btn {
    background: rgba(255,255,255,0.03); border: 1px solid var(--border);
    padding: 16px 20px; color: var(--text-primary); text-align: left;
    display: flex; align-items: center; gap: 16px; border-radius: 14px;
}
.option-btn:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.25); transform: translateX(4px); }
.option-btn.selected { background: rgba(99,102,241,0.18); border-color: var(--primary); color: #c7d2fe; }
.option-num { font-weight: 800; font-size: 1.2rem; color: var(--primary); min-width: 24px; }
.option-label { font-size: 1rem; }

/* ── LOADING ────────────────────────────────────────────────────────────────── */
.loading-content { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 70px 20px; }
.spinner { width: 60px; height: 60px; border: 4px solid rgba(255,255,255,0.08); border-left-color: var(--secondary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 28px; }
@keyframes spin { 100% { transform: rotate(360deg); } }
#loading-text { color: var(--text-secondary); font-size: 1rem; margin-top: 8px; transition: opacity 0.3s; }

/* ── RESULT HEADER CARD ─────────────────────────────────────────────────────── */
.result-header-card { text-align: center; padding: 40px 36px 36px; }
.result-header { display: flex; flex-direction: column; align-items: center; }
.result-emoji { font-size: 3.5rem; margin-bottom: 16px; animation: floatEmoji 3s ease-in-out infinite; }
@keyframes floatEmoji { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-8px);} }
.result-label { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 8px; }
.result-highlight { font-size: 2.6rem; margin-bottom: 8px; }
.result-subtitle-chip {
    background: rgba(99,102,241,0.18); color: #a5b4fc;
    padding: 4px 14px; border-radius: 100px; font-size: 0.85rem;
    font-weight: 600; border: 1px solid rgba(99,102,241,0.3); margin-bottom: 20px; display: inline-block;
}
.result-tagline { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); line-height: 1.5; max-width: 480px; }

/* ── ADVERTORIAL CARD ───────────────────────────────────────────────────────── */
.advertorial-card { padding: 36px; }
.advertorial-label {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.5px; color: #a78bfa;
    margin-bottom: 24px; background: rgba(167,139,250,0.1);
    padding: 6px 12px; border-radius: 100px; border: 1px solid rgba(167,139,250,0.2);
}
.advertorial-body { display: flex; flex-direction: column; gap: 18px; }
.advertorial-body p { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.8; }
.advertorial-body strong { color: var(--text-primary); font-weight: 700; }
.advertorial-body em { color: #c7d2fe; font-style: italic; }

/* ── BELIEF CARD ────────────────────────────────────────────────────────────── */
.belief-card { padding: 32px; border-left: 4px solid var(--gold); }
.belief-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.belief-header h3 { font-size: 1rem; color: #fde68a; }
.belief-text { color: var(--text-secondary); font-style: italic; font-size: 1rem; line-height: 1.7; margin-bottom: 20px; }
.reframe-box {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(16,185,129,0.08));
    border: 1px solid rgba(99,102,241,0.2); border-radius: 14px; padding: 20px;
}
.reframe-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: #6ee7b7; margin-bottom: 8px; }
.reframe-text { color: #d1fae5; font-weight: 600; font-size: 1rem; line-height: 1.6; }

/* ── TRANSFORMATION CARD ────────────────────────────────────────────────────── */
.transformation-card { padding: 28px 32px; border-left: 4px solid var(--success); }
.transformation-title { display: flex; align-items: center; gap: 10px; font-size: 1rem; color: #6ee7b7; margin-bottom: 12px; }
.transformation-text { color: var(--text-secondary); font-size: 1rem; line-height: 1.75; }

/* ── CTA BLOCK ──────────────────────────────────────────────────────────────── */
.cta-block {
    background: linear-gradient(160deg, rgba(99,102,241,0.15) 0%, rgba(236,72,153,0.12) 60%, rgba(245,158,11,0.08) 100%);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 24px; padding: 44px 40px;
    text-align: center; position: relative; overflow: hidden;
    box-shadow: 0 20px 60px -20px rgba(99,102,241,0.3);
}
.cta-block::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% -20%, rgba(99,102,241,0.15), transparent 70%);
    pointer-events: none;
}
.cta-eyebrow { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: #a78bfa; margin-bottom: 14px; }
.cta-title { font-size: 2rem; font-weight: 800; background: linear-gradient(135deg, #f8fafc, #c7d2fe); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 18px; line-height: 1.25; }
.cta-subtitle { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.75; max-width: 480px; margin: 0 auto 28px; }

.cta-bullets { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 36px; text-align: left; max-width: 420px; margin-left: auto; margin-right: auto; }
.cta-bullets li { display: flex; align-items: center; gap: 12px; font-size: 0.98rem; color: var(--text-primary); }
.cta-bullets li svg { flex-shrink: 0; color: #6ee7b7; }

.cta-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: white; text-decoration: none;
    padding: 20px 36px; border-radius: 16px;
    font-family: 'Outfit', sans-serif; font-size: 1.05rem; font-weight: 700;
    width: 100%; letter-spacing: 0.01em;
    box-shadow: 0 16px 40px -10px rgba(99,102,241,0.6);
    transition: all 0.3s ease; position: relative; z-index: 1;
}
.cta-button:hover { transform: translateY(-4px); box-shadow: 0 24px 52px -10px rgba(99,102,241,0.8); }
.cta-button:active { transform: translateY(-1px); }

.cta-guarantee { font-size: 0.8rem; color: var(--text-secondary); margin-top: 16px; }

/* ── PDF FOOTER ─────────────────────────────────────────────────────────────── */
.pdf-footer { text-align: center; margin-top: 8px; padding: 20px; font-size: 0.82rem; color: var(--text-secondary); border-top: 1px solid var(--border); }

/* ── ACTIONS ────────────────────────────────────────────────────────────────── */
.actions { margin-top: 24px; }
.action-hint { text-align: center; font-size: 0.85rem; color: var(--text-secondary); margin-top: 12px; }

/* ── PDF EXPORT STYLES ──────────────────────────────────────────────────────── */
body.pdf-rendering { height: auto !important; min-height: auto !important; display: block !important; }
body.pdf-rendering .app-container { overflow: visible !important; max-width: none !important; }

.pdf-export-mode { background: white !important; color: #1e293b !important; font-family: 'Outfit', sans-serif; }
.pdf-export-mode .glass-card { background: #f8fafc !important; border: 1px solid #e2e8f0 !important; box-shadow: none !important; }
.pdf-export-mode .gradient-text { background: none !important; color: #4f46e5 !important; -webkit-text-fill-color: #4f46e5 !important; }
.pdf-export-mode .result-subtitle-chip { background: #ede9fe !important; color: #5b21b6 !important; border-color: #ddd6fe !important; }
.pdf-export-mode .badge { background: #fce7f3 !important; color: #db2777 !important; }
.pdf-export-mode .result-tagline { color: #1e293b !important; }
.pdf-export-mode .advertorial-label { background: #ede9fe !important; color: #6d28d9 !important; border-color: #ddd6fe !important; }
.pdf-export-mode .advertorial-body p { color: #475569 !important; }
.pdf-export-mode .advertorial-body strong { color: #1e293b !important; }
.pdf-export-mode .advertorial-body em { color: #4338ca !important; }
.pdf-export-mode .belief-card { border-left-color: #f59e0b !important; background: #fffbeb !important; }
.pdf-export-mode .belief-header h3 { color: #92400e !important; }
.pdf-export-mode .belief-text { color: #475569 !important; }
.pdf-export-mode .reframe-box { background: #ecfdf5 !important; border-color: #6ee7b7 !important; }
.pdf-export-mode .reframe-label { color: #065f46 !important; }
.pdf-export-mode .reframe-text { color: #064e3b !important; }
.pdf-export-mode .transformation-card { border-left-color: #10b981 !important; background: #f0fdf4 !important; }
.pdf-export-mode .transformation-title { color: #065f46 !important; }
.pdf-export-mode .transformation-text { color: #475569 !important; }
.pdf-export-mode .cta-block { background: #ede9fe !important; border-color: #c4b5fd !important; }
.pdf-export-mode .cta-title { background: none !important; color: #4f46e5 !important; -webkit-text-fill-color: #4f46e5 !important; }
.pdf-export-mode .cta-subtitle { color: #475569 !important; }
.pdf-export-mode .cta-bullets li { color: #1e293b !important; }
.pdf-export-mode .cta-button { background: linear-gradient(135deg, #4f46e5, #db2777) !important; }
.pdf-export-mode .pdf-footer { color: #94a3b8 !important; border-top-color: #e2e8f0 !important; }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    body { padding: 16px 0; }
    .glass-card, .advertorial-card, .cta-block { padding: 28px 22px; }
    #welcome-screen h1.gradient-text { font-size: 2.2rem; }
    .result-highlight { font-size: 2rem; }
    .cta-title { font-size: 1.6rem; }
    .features { flex-direction: column; gap: 10px; }
    .option-btn { padding: 14px 16px; }
    .question-text { font-size: 1.25rem; }
}
