:root {
--brand: #8662a7;
--brand-light: #a97fd4;
--brand-dark: #5e4278;
--brand-subtle: rgba(134, 98, 167, 0.12);
--bg: #0e0c12;
--bg2: #16121f;
--bg3: #1e1829;
--surface: #231d30;
--surface2: #2d2540;
--text: #f0eaf8;
--text-muted: #9b8db0;
--text-dim: #6b5f80;
--success: #4caf7d;
--warning: #e8a838;
--danger: #e05c5c;
--radius: 14px;
--transition: 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
font-family: 'DM Sans', sans-serif;
background: var(--bg);
color: var(--text);
min-height: 100vh;
display: flex;
flex-direction: column;
overflow-x: hidden;
}

/* Background subtle texture */
body::before {
content: '';
position: fixed;
inset: 0;
background:
  radial-gradient(ellipse 80% 50% at 20% 10%, rgba(134,98,167,0.08) 0%, transparent 60%),
  radial-gradient(ellipse 60% 40% at 80% 90%, rgba(134,98,167,0.05) 0%, transparent 60%);
pointer-events: none;
z-index: 0;
}

/* ───── PROGRESS BAR ───── */
#progress-bar-wrap {
position: fixed;
top: 0; left: 0; right: 0;
height: 3px;
background: var(--surface);
z-index: 100;
}
#progress-bar {
height: 100%;
background: linear-gradient(90deg, var(--brand), var(--brand-light));
width: 0%;
transition: width 0.5s ease;
box-shadow: 0 0 10px rgba(134,98,167,0.6);
}

/* ───── HEADER ───── */
header {
position: fixed;
top: 3px; left: 0; right: 0;
padding: 18px 40px;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 99;
background: linear-gradient(to bottom, rgba(14,12,18,0.95), transparent);
}

header img {
height: 36px;
width: auto;
opacity: 0.92;
}

#step-counter {
font-size: 13px;
color: var(--text-muted);
letter-spacing: 0.05em;
font-weight: 500;
}

/* ───── MAIN CONTAINER ───── */
#app {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
padding: 100px 24px 80px;
position: relative;
z-index: 1;
}

/* ───── SLIDES ───── */
.slide {
display: none;
width: 100%;
max-width: 680px;
animation: fadeSlideIn 0.45s ease forwards;
}

.slide.active { display: block; }
.slide.exit { animation: fadeSlideOut 0.3s ease forwards; }

@keyframes fadeSlideIn {
from { opacity: 0; transform: translateY(28px); }
to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideOut {
from { opacity: 1; transform: translateY(0); }
to   { opacity: 0; transform: translateY(-20px); }
}

/* ───── WELCOME SLIDE ───── */
.welcome-slide {
text-align: center;
max-width: 620px;
margin: 0 auto;
}

.welcome-slide .eyebrow {
display: inline-block;
font-size: 12px;
font-weight: 500;
letter-spacing: 0.15em;
text-transform: uppercase;
color: var(--brand-light);
background: var(--brand-subtle);
border: 1px solid rgba(134,98,167,0.25);
padding: 6px 16px;
border-radius: 100px;
margin-bottom: 28px;
}

.welcome-slide h1 {
font-family: 'Playfair Display', serif;
font-size: clamp(2rem, 5vw, 3rem);
font-weight: 700;
line-height: 1.2;
color: var(--text);
margin-bottom: 20px;
}

.welcome-slide h1 span { color: var(--brand-light); }

.welcome-slide p {
font-size: 17px;
line-height: 1.7;
color: var(--text-muted);
margin-bottom: 12px;
}

.welcome-stats {
display: flex;
gap: 20px;
justify-content: center;
margin: 32px 0;
flex-wrap: wrap;
}

.stat-pill {
background: var(--surface);
border: 1px solid var(--surface2);
border-radius: 100px;
padding: 10px 20px;
font-size: 14px;
color: var(--text-muted);
display: flex;
align-items: center;
gap: 8px;
}

.stat-pill span { color: var(--brand-light); font-weight: 600; }

.disclaimer-box {
background: rgba(134,98,167,0.07);
border: 1px solid rgba(134,98,167,0.2);
border-radius: var(--radius);
padding: 16px 20px;
margin: 28px 0;
text-align: left;
}

.disclaimer-box p {
font-size: 13px;
color: var(--text-dim);
line-height: 1.6;
margin: 0;
}

.disclaimer-box strong { color: var(--text-muted); }

/* ───── QUESTION SLIDE ───── */
.question-label {
font-size: 13px;
font-weight: 500;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--brand-light);
margin-bottom: 16px;
display: flex;
align-items: center;
gap: 8px;
}

.question-label::before {
content: '';
width: 24px; height: 2px;
background: var(--brand);
display: inline-block;
border-radius: 2px;
}

.question-text {
font-family: 'Playfair Display', serif;
font-size: clamp(1.4rem, 3.5vw, 2rem);
font-weight: 600;
line-height: 1.35;
color: var(--text);
margin-bottom: 36px;
}

/* ───── OPTIONS ───── */
.options-list {
display: flex;
flex-direction: column;
gap: 12px;
}

.option-btn {
background: var(--surface);
border: 1.5px solid var(--surface2);
border-radius: var(--radius);
padding: 18px 22px;
cursor: pointer;
transition: all var(--transition);
text-align: left;
display: flex;
align-items: center;
gap: 16px;
color: var(--text);
font-family: 'DM Sans', sans-serif;
font-size: 16px;
font-weight: 400;
line-height: 1.4;
width: 100%;
position: relative;
overflow: hidden;
}

.option-btn::before {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(135deg, var(--brand-subtle), transparent);
opacity: 0;
transition: opacity var(--transition);
}

.option-key {
width: 32px; height: 32px;
border-radius: 8px;
background: var(--surface2);
border: 1px solid var(--text-dim);
display: flex;
align-items: center;
justify-content: center;
font-size: 13px;
font-weight: 600;
color: var(--text-muted);
flex-shrink: 0;
transition: all var(--transition);
position: relative;
z-index: 1;
}

.option-text { position: relative; z-index: 1; flex: 1; }

.option-btn:hover {
border-color: var(--brand);
transform: translateX(4px);
box-shadow: 0 4px 20px rgba(134,98,167,0.15);
}

.option-btn:hover::before { opacity: 1; }

.option-btn:hover .option-key {
background: var(--brand);
border-color: var(--brand);
color: white;
}

.option-btn.selected {
border-color: var(--brand);
background: var(--bg3);
box-shadow: 0 0 0 1px var(--brand), 0 4px 24px rgba(134,98,167,0.2);
}

.option-btn.selected::before { opacity: 1; }

.option-btn.selected .option-key {
background: var(--brand);
border-color: var(--brand);
color: white;
}

/* ───── CONTACT FORM ───── */
.contact-form {
display: flex;
flex-direction: column;
gap: 16px;
}

.form-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
}

.field-group {
display: flex;
flex-direction: column;
gap: 8px;
}

.field-group label {
font-size: 13px;
font-weight: 500;
color: var(--text-muted);
letter-spacing: 0.04em;
}

.field-group input {
background: var(--surface);
border: 1.5px solid var(--surface2);
border-radius: var(--radius);
padding: 14px 18px;
font-family: 'DM Sans', sans-serif;
font-size: 15px;
color: var(--text);
transition: all var(--transition);
outline: none;
width: 100%;
}

.field-group input::placeholder { color: var(--text-dim); }

.field-group input:focus {
border-color: var(--brand);
background: var(--bg3);
box-shadow: 0 0 0 3px rgba(134,98,167,0.15);
}

.field-group input.error { border-color: var(--danger); }
.error-msg { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ───── BUTTONS ───── */
.btn-primary {
background: linear-gradient(135deg, var(--brand), var(--brand-dark));
color: white;
border: none;
border-radius: var(--radius);
padding: 16px 36px;
font-family: 'DM Sans', sans-serif;
font-size: 16px;
font-weight: 500;
cursor: pointer;
transition: all var(--transition);
display: inline-flex;
align-items: center;
gap: 10px;
letter-spacing: 0.02em;
position: relative;
overflow: hidden;
}

.btn-primary::after {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
opacity: 0;
transition: opacity var(--transition);
}

.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 8px 28px rgba(134,98,167,0.4);
}

.btn-primary:hover::after { opacity: 1; }
.btn-primary:active { transform: translateY(0); }

.btn-back {
background: transparent;
border: 1px solid var(--surface2);
color: var(--text-muted);
border-radius: var(--radius);
padding: 12px 24px;
font-family: 'DM Sans', sans-serif;
font-size: 14px;
cursor: pointer;
transition: all var(--transition);
}

.btn-back:hover {
border-color: var(--text-dim);
color: var(--text);
}

.nav-btns {
display: flex;
align-items: center;
gap: 12px;
margin-top: 32px;
}

/* ───── RESULT SLIDE ───── */
.result-slide { text-align: center; }

.result-badge {
display: inline-flex;
align-items: center;
gap: 10px;
padding: 12px 24px;
border-radius: 100px;
font-size: 14px;
font-weight: 600;
letter-spacing: 0.05em;
text-transform: uppercase;
margin-bottom: 28px;
}

.result-badge.critical {
background: rgba(224,92,92,0.12);
border: 1px solid rgba(224,92,92,0.3);
color: var(--danger);
}

.result-badge.warning {
background: rgba(232,168,56,0.12);
border: 1px solid rgba(232,168,56,0.3);
color: var(--warning);
}

.result-badge.success {
background: rgba(76,175,125,0.12);
border: 1px solid rgba(76,175,125,0.3);
color: var(--success);
}

.result-title {
font-family: 'Playfair Display', serif;
font-size: clamp(1.6rem, 4vw, 2.4rem);
font-weight: 700;
color: var(--text);
margin-bottom: 16px;
line-height: 1.25;
}

.result-score {
display: inline-flex;
align-items: baseline;
gap: 4px;
background: var(--surface);
border: 1px solid var(--surface2);
border-radius: 100px;
padding: 8px 20px;
margin-bottom: 28px;
}

.score-number {
font-family: 'Playfair Display', serif;
font-size: 28px;
font-weight: 700;
color: var(--brand-light);
}

.score-label { font-size: 14px; color: var(--text-muted); }

.result-body {
background: var(--surface);
border: 1px solid var(--surface2);
border-radius: 20px;
padding: 32px;
text-align: left;
margin-bottom: 28px;
}

.result-body h3 {
font-family: 'Playfair Display', serif;
font-size: 18px;
color: var(--text);
margin-bottom: 16px;
}

.result-body p {
font-size: 15px;
line-height: 1.75;
color: var(--text-muted);
margin-bottom: 14px;
}

.result-body p:last-child { margin-bottom: 0; }

.risk-items {
display: flex;
flex-direction: column;
gap: 12px;
margin: 16px 0;
}

.risk-item {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 14px 16px;
background: var(--bg3);
border-radius: 10px;
border-left: 3px solid var(--brand);
}

.risk-item.red { border-color: var(--danger); }
.risk-item.yellow { border-color: var(--warning); }
.risk-item.green { border-color: var(--success); }

.risk-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

.risk-text { font-size: 14px; line-height: 1.6; color: var(--text-muted); }
.risk-text strong { color: var(--text); display: block; margin-bottom: 2px; }

.cta-section {
margin-top: 8px;
display: flex;
flex-direction: column;
align-items: center;
gap: 0;
}

.cta-section p {
font-size: 14px;
color: var(--text-muted);
margin-bottom: 16px;
text-align: center;
}

.cta-section a.btn-primary {
width: 100%;
justify-content: center;
font-size: 17px;
padding: 18px 36px;
background: linear-gradient(135deg, #25d366, #128c4e);
box-shadow: 0 6px 24px rgba(37,211,102,0.25);
}

.cta-section a.btn-primary:hover {
box-shadow: 0 10px 32px rgba(37,211,102,0.38);
}

.cta-section button.btn-primary {
width: auto;
font-size: 13px;
padding: 10px 24px;
margin-top: 14px;
}

/* ───── LOADING ───── */
.loading-overlay {
display: none;
position: fixed;
inset: 0;
background: rgba(14,12,18,0.9);
z-index: 200;
align-items: center;
justify-content: center;
flex-direction: column;
gap: 20px;
}

.loading-overlay.active { display: flex; }

.spinner {
width: 48px; height: 48px;
border: 3px solid var(--surface2);
border-top-color: var(--brand);
border-radius: 50%;
animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
font-size: 15px;
color: var(--text-muted);
}

/* ───── FOOTER ───── */
footer {
position: relative;
z-index: 1;
text-align: center;
padding: 20px 24px;
border-top: 1px solid var(--surface);
background: var(--bg2);
}

footer p {
font-size: 12px;
color: var(--text-dim);
letter-spacing: 0.03em;
}

footer p a {
color: var(--text-muted);
text-decoration: none;
transition: color 0.2s;
}

footer p a:hover { color: var(--brand-light); }

/* ───── RESPONSIVE ───── */
@media (max-width: 600px) {
header { padding: 16px 20px; }
header img { height: 28px; }
#app { padding: 80px 16px 60px; }

.form-row { grid-template-columns: 1fr; }

.welcome-stats { gap: 10px; }

.result-body { padding: 22px 18px; }

.btn-primary { width: 100%; justify-content: center; }

.nav-btns { flex-direction: column-reverse; }
.btn-back { width: 100%; text-align: center; }
}