/* =========================================================
   روان‌سنج هوشمند - استایل فرانت‌اند (لوکس/مدرن/گلس‌مورفیسم)
   ========================================================= */
.sp-app {
	--sp-primary: #10b981;
	--sp-secondary: #3b82f6;
	--sp-dark: #04070a;
	--sp-radius: 22px;
	font-family: 'Vazirmatn', Tahoma, sans-serif;
	position: relative;
	max-width: 780px;
	margin: 40px auto;
	min-height: 560px;
	border-radius: var(--sp-radius);
	overflow: hidden;
	background: radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--sp-primary) 35%, transparent), transparent 45%),
				radial-gradient(circle at 85% 85%, color-mix(in srgb, var(--sp-secondary) 25%, transparent), transparent 45%),
				linear-gradient(160deg, var(--sp-dark) 0%, #1a1530 100%);
	color: #f4f2ff;
	box-shadow: 0 30px 80px -20px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.06) inset;
	direction: rtl;
	isolation: isolate;
}
.sp-app *, .sp-app *::before, .sp-app *::after { box-sizing: border-box; }
.sp-app::before {
	content: "";
	position: absolute; inset: 0;
	background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
	background-size: 22px 22px;
	pointer-events: none;
	opacity: .5;
}

.sp-loading { display:flex; align-items:center; justify-content:center; min-height:560px; }
.sp-spinner {
	width: 46px; height: 46px; border-radius: 50%;
	border: 3px solid rgba(255,255,255,.15);
	border-top-color: var(--sp-secondary);
	animation: sp-spin 0.9s linear infinite;
}
@keyframes sp-spin { to { transform: rotate(360deg); } }

/* ---------- Header / progress ---------- */
.sp-header {
	position: relative; z-index: 2;
	padding: 28px 32px 18px;
}
.sp-brand {
	display: flex; align-items: center; justify-content: space-between;
	margin-bottom: 18px;
}
.sp-brand-title {
	font-weight: 800; font-size: 15px; letter-spacing: .5px;
	background: linear-gradient(90deg, var(--sp-secondary), #fff8e1);
	-webkit-background-clip: text; background-clip: text; color: transparent;
}
.sp-brand-count {
	font-size: 13px; color: rgba(244,242,255,.65);
	background: rgba(255,255,255,.06);
	padding: 4px 12px; border-radius: 999px;
	border: 1px solid rgba(255,255,255,.08);
}
.sp-progress-track {
	height: 8px; border-radius: 999px; background: rgba(255,255,255,.08);
	overflow: hidden; position: relative;
}
.sp-progress-fill {
	height: 100%; border-radius: 999px;
	background: linear-gradient(90deg, var(--sp-primary), var(--sp-secondary));
	transition: width .5s cubic-bezier(.65,0,.35,1);
	box-shadow: 0 0 14px color-mix(in srgb, var(--sp-secondary) 60%, transparent);
}

/* ---------- Question card ---------- */
.sp-body { position: relative; z-index: 2; padding: 10px 32px 32px; min-height: 400px; display:flex; flex-direction:column; }
.sp-question-wrap { flex: 1; display:flex; flex-direction:column; justify-content:center; }
.sp-q-num { color: var(--sp-secondary); font-weight: 700; font-size: 13px; margin-bottom: 10px; letter-spacing: .5px; }
.sp-q-text {
	font-size: 15px; color: rgba(244,242,255,.55);
	margin-bottom: 22px;
}
.sp-options { display: flex; flex-direction: column; gap: 14px; }
.sp-option {
	position: relative;
	text-align: right;
	padding: 20px 22px;
	border-radius: 16px;
	background: rgba(255,255,255,.045);
	border: 1.5px solid rgba(255,255,255,.09);
	color: #f4f2ff;
	font-size: 16px;
	line-height: 1.9;
	cursor: pointer;
	backdrop-filter: blur(6px);
	transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
	animation: sp-fade-up .45s ease both;
}
.sp-option:nth-child(2) { animation-delay: .08s; }
.sp-option:hover {
	transform: translateY(-3px);
	border-color: color-mix(in srgb, var(--sp-primary) 60%, transparent);
	background: rgba(255,255,255,.08);
	box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--sp-primary) 50%, transparent);
}
.sp-option.is-selected {
	border-color: var(--sp-secondary);
	background: linear-gradient(90deg, color-mix(in srgb, var(--sp-primary) 25%, transparent), color-mix(in srgb, var(--sp-secondary) 18%, transparent));
	box-shadow: 0 0 0 1px var(--sp-secondary) inset, 0 10px 30px -10px color-mix(in srgb, var(--sp-secondary) 55%, transparent);
}
.sp-option .sp-key {
	display: inline-flex; align-items:center; justify-content:center;
	width: 26px; height: 26px; border-radius: 8px;
	background: rgba(255,255,255,.08); font-size: 12px; font-weight: 700;
	margin-left: 12px; color: rgba(244,242,255,.7);
	border: 1px solid rgba(255,255,255,.1);
}

@keyframes sp-fade-up { from { opacity:0; transform: translateY(14px); } to { opacity:1; transform:none; } }
@keyframes sp-fade-in { from { opacity:0; } to { opacity:1; } }

.sp-question-wrap.sp-anim-out { animation: sp-fade-out-left .28s ease forwards; }
.sp-question-wrap.sp-anim-in { animation: sp-fade-in-right .38s ease both; }
@keyframes sp-fade-out-left { to { opacity:0; transform: translateX(-24px); } }
@keyframes sp-fade-in-right { from { opacity:0; transform: translateX(24px); } to { opacity:1; transform:none; } }

/* ---------- Footer nav ---------- */
.sp-footer-nav { display:flex; justify-content: space-between; align-items:center; margin-top: 26px; }
.sp-btn-ghost {
	background: transparent; border: 1px solid rgba(255,255,255,.15);
	color: rgba(244,242,255,.75); padding: 10px 18px; border-radius: 12px;
	cursor: pointer; font-family: inherit; font-size: 14px; transition: all .2s;
}
.sp-btn-ghost:hover { background: rgba(255,255,255,.06); }
.sp-btn-ghost:disabled { opacity: .35; cursor: not-allowed; }
.sp-hint { font-size: 12px; color: rgba(244,242,255,.4); }

/* ---------- Intro screen ---------- */
.sp-intro { text-align:center; padding: 60px 40px; position:relative; z-index:2; }
.sp-intro-badge {
	display:inline-block; padding: 6px 16px; border-radius: 999px; font-size: 12px;
	background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
	color: var(--sp-secondary); margin-bottom: 22px; letter-spacing: .5px;
}
.sp-intro h2 {
	font-size: 30px; margin: 0 0 14px; font-weight: 800;
	background: linear-gradient(90deg, #fff, var(--sp-secondary));
	-webkit-background-clip: text; background-clip: text; color: transparent;
}
.sp-intro p { color: rgba(244,242,255,.65); font-size: 15px; line-height: 2; max-width: 480px; margin: 0 auto 34px; }
.sp-btn-primary {
	display:inline-flex; align-items:center; gap:10px;
	background: linear-gradient(90deg, var(--sp-primary), var(--sp-secondary));
	color: #ffffff; font-weight: 800; border: none; padding: 15px 34px;
	border-radius: 14px; font-size: 15px; cursor: pointer; font-family: inherit;
	box-shadow: 0 14px 34px -10px color-mix(in srgb, var(--sp-primary) 60%, transparent);
	transition: transform .2s ease, box-shadow .2s ease;
	text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.sp-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -8px color-mix(in srgb, var(--sp-secondary) 65%, transparent); }
.sp-intro-stats { display:flex; justify-content:center; gap: 30px; margin-top: 36px; }
.sp-intro-stat { text-align:center; }
.sp-intro-stat b { display:block; font-size: 20px; color: #fff; }
.sp-intro-stat span { font-size: 12px; color: rgba(244,242,255,.5); }

/* ---------- Lead form ---------- */
.sp-lead { padding: 50px 40px; text-align:center; position:relative; z-index:2; }
.sp-lead h3 { font-size: 22px; margin-bottom: 8px; }
.sp-lead p { color: rgba(244,242,255,.6); margin-bottom: 26px; font-size: 14px; }
.sp-field { text-align:right; margin-bottom: 16px; max-width: 360px; margin-inline: auto; }
.sp-field label { display:block; font-size: 13px; margin-bottom: 6px; color: rgba(244,242,255,.7); }
.sp-field input {
	width: 100%; padding: 13px 16px; border-radius: 12px;
	border: 1.5px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05);
	color: #fff; font-family: inherit; font-size: 14px; outline: none;
	transition: border-color .2s;
}
.sp-field input:focus { border-color: var(--sp-secondary); }

/* ---------- Result screen ---------- */
.sp-result { padding: 40px 34px 34px; position:relative; z-index:2; animation: sp-fade-in .5s ease; }
.sp-result-top { text-align:center; margin-bottom: 30px; }
.sp-result-type {
	font-size: 54px; font-weight: 900; letter-spacing: 4px;
	background: linear-gradient(90deg, var(--sp-primary), var(--sp-secondary));
	-webkit-background-clip: text; background-clip: text; color: transparent;
	line-height: 1.2;
}
.sp-result-title { font-size: 20px; font-weight: 700; margin-top: 4px; color: #fff; }
.sp-result-desc { color: rgba(244,242,255,.7); font-size: 14.5px; line-height: 2; margin-top: 14px; max-width: 520px; margin-inline:auto; }

.sp-chart { display:flex; flex-direction:column; gap: 16px; margin: 30px 0; }
.sp-chart-row { display:flex; align-items:center; gap: 12px; }
.sp-chart-label { width: 130px; font-size: 13px; color: rgba(244,242,255,.75); display:flex; justify-content:space-between; }
.sp-chart-bar-track { flex:1; height: 12px; border-radius: 999px; background: rgba(255,255,255,.07); overflow:hidden; position:relative; }
.sp-chart-bar-fill { height:100%; border-radius: 999px; background: linear-gradient(90deg, var(--sp-primary), var(--sp-secondary)); width:0; transition: width 1s cubic-bezier(.65,0,.35,1); }
.sp-chart-pct { width: 42px; font-size: 12px; color: rgba(244,242,255,.55); text-align:left; }

.sp-result-actions { display:flex; gap: 12px; justify-content:center; margin-top: 30px; flex-wrap: wrap; }
.sp-btn-outline {
	background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.15);
	color: #fff; padding: 12px 22px; border-radius: 12px; cursor:pointer;
	font-family: inherit; font-size: 13.5px; transition: all .2s;
}
.sp-btn-outline:hover { background: rgba(255,255,255,.1); }

/* ---------- Result: tagline ---------- */
.sp-result-tagline {
	display:inline-block; margin-top: 6px; font-size: 13px; color: var(--sp-secondary);
	background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
	padding: 5px 14px; border-radius: 999px;
}

/* ---------- Result: section headers ---------- */
.sp-section { margin-top: 34px; }
.sp-section-title {
	font-size: 14px; font-weight: 800; color: #fff; margin-bottom: 16px;
	display:flex; align-items:center; gap: 8px;
}
.sp-section-title::before {
	content:""; width: 4px; height: 16px; border-radius: 3px;
	background: linear-gradient(180deg, var(--sp-primary), var(--sp-secondary));
	display:inline-block;
}

/* ---------- Stat list (8 dimensions) ---------- */
.sp-stat-list { display:grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.sp-stat-item {
	display:flex; align-items:center; justify-content:space-between;
	background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07);
	border-radius: 12px; padding: 11px 16px; font-size: 13.5px;
}
.sp-stat-item b { color: var(--sp-primary); font-size: 14px; }

/* ---------- Radar chart ---------- */
.sp-radar-wrap { display:flex; justify-content:center; margin: 22px 0 10px; }
.sp-radar-wrap svg { max-width: 340px; width: 100%; height: auto; }
.sp-radar-label { font-size: 10.5px; fill: rgba(244,242,255,.65); }
.sp-radar-poly { fill: color-mix(in srgb, var(--sp-primary) 28%, transparent); stroke: var(--sp-secondary); stroke-width: 2; }
.sp-radar-grid { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 1; }
.sp-radar-axis { stroke: rgba(255,255,255,.12); stroke-width: 1; }
.sp-radar-dot { fill: var(--sp-primary); }

/* ---------- Strengths / Weaknesses ---------- */
.sp-sw-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sp-sw-card { border-radius: 14px; padding: 16px 18px; border: 1px solid rgba(255,255,255,.08); }
.sp-sw-card.strengths { background: color-mix(in srgb, var(--sp-primary) 10%, transparent); }
.sp-sw-card.weaknesses { background: rgba(239,68,68,.08); }
.sp-sw-card h4 { margin: 0 0 10px; font-size: 13px; color: #fff; }
.sp-sw-card ul { margin: 0; padding: 0; list-style: none; display:flex; flex-direction:column; gap: 8px; }
.sp-sw-card li { font-size: 13px; color: rgba(244,242,255,.8); display:flex; gap: 8px; align-items:flex-start; line-height: 1.7; }
.sp-sw-card.strengths li::before { content:"✓"; color: var(--sp-primary); font-weight: 800; }
.sp-sw-card.weaknesses li::before { content:"✕"; color: #f87171; font-weight: 800; }

/* ---------- Chips (careers / avoid / famous) ---------- */
.sp-chip-list { display:flex; flex-wrap: wrap; gap: 9px; }
.sp-chip {
	font-size: 12.5px; padding: 8px 15px; border-radius: 999px;
	background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); color: #f4f2ff;
}
.sp-chip.good { border-color: color-mix(in srgb, var(--sp-primary) 55%, transparent); color: #d1fae5; }
.sp-chip.bad { border-color: rgba(248,113,113,.4); color: #fecaca; }
.sp-chip.famous { display:flex; flex-direction:column; align-items:center; gap:2px; padding: 10px 16px; }
.sp-chip.famous b { font-size: 12.5px; color:#fff; }
.sp-chip.famous span { font-size: 10.5px; color: rgba(244,242,255,.55); }

.sp-result-desc { white-space: pre-line; }

@media (max-width: 640px) {
	.sp-stat-list { grid-template-columns: 1fr; }
	.sp-sw-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
	.sp-app { margin: 0; border-radius: 0; }
	.sp-header, .sp-body, .sp-intro, .sp-lead, .sp-result { padding-left: 18px; padding-right: 18px; }
	.sp-result-type { font-size: 42px; }
	.sp-intro h2 { font-size: 24px; }
}
