/* Quiz Score Mailer - frontend */

.qsm-quiz {
	max-width: 720px;
	margin: 0 auto;
	padding: 24px;
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 12px;
	box-shadow: 0 4px 24px rgba(0,0,0,0.04);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #222;
}

.qsm-intro { margin-bottom: 16px; color: #444; }

.qsm-progress {
	height: 8px;
	background: #eee;
	border-radius: 99px;
	overflow: hidden;
	margin-bottom: 6px;
}
.qsm-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #4f46e5, #06b6d4);
	transition: width 250ms ease;
}
.qsm-step-counter { font-size: 12px; color: #777; margin-bottom: 16px; text-align: right; }

.qsm-timer { font-size: 13px; color: #b91c1c; margin-bottom: 8px; font-weight: 600; }

.qsm-step {
	border: 0;
	padding: 0;
	margin: 0 0 16px 0;
}
.qsm-step legend {
	font-weight: 700;
	font-size: 18px;
	margin-bottom: 8px;
	padding: 0;
}
.qsm-q-text { margin: 4px 0 14px; color: #333; }
.qsm-q-help { font-size: 13px; color: #777; margin-bottom: 10px; }

.qsm-field { margin-bottom: 12px; }
.qsm-field > label { display:block; font-weight:600; font-size: 14px; margin-bottom:4px; }
.qsm-field input[type="text"],
.qsm-field input[type="email"],
.qsm-field input[type="tel"],
.qsm-field input[type="url"],
.qsm-field input[type="number"],
.qsm-field textarea,
.qsm-field select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 15px;
	box-sizing: border-box;
	transition: border-color 150ms;
}
.qsm-field input:focus, .qsm-field textarea:focus, .qsm-field select:focus {
	outline: none;
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}
.qsm-field.qsm-error input,
.qsm-field.qsm-error textarea,
.qsm-field.qsm-error select { border-color: #dc2626; }

.qsm-required { color: #dc2626; }

.qsm-gdpr label { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; font-size: 14px; }
.qsm-gdpr input { margin-top: 4px; }

.qsm-options { display: flex; flex-direction: column; gap: 8px; }
.qsm-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	cursor: pointer;
	transition: all 150ms;
	font-size: 15px;
}
.qsm-option:hover { border-color: #4f46e5; background: #f8fafc; }
.qsm-option input[type="radio"] { accent-color: #4f46e5; }
.qsm-option input[type="radio"]:checked + span { font-weight: 600; }
.qsm-option:has(input:checked) { border-color: #4f46e5; background: #eef2ff; }

.qsm-truefalse { flex-direction: row; gap: 12px; }
.qsm-truefalse .qsm-option { flex: 1; justify-content: center; }

.qsm-rating { display:flex; align-items:center; gap: 12px; flex-wrap: wrap; }
.qsm-rating-lbl { color:#666; font-size: 13px; }
.qsm-rating-buttons { display:flex; gap: 6px; flex-wrap: wrap; }
.qsm-rating-btn {
	display:inline-flex; align-items:center; justify-content:center;
	width: 42px; height: 42px;
	border:1px solid #e5e7eb; border-radius: 8px;
	cursor:pointer; transition: all 150ms; font-weight: 600;
}
.qsm-rating-btn input { display:none; }
.qsm-rating-btn:hover { border-color: #4f46e5; }
.qsm-rating-btn:has(input:checked) { background: #4f46e5; color:#fff; border-color: #4f46e5; }

.qsm-controls { display: flex; gap: 8px; justify-content: space-between; margin-top: 18px; }
.qsm-btn {
	padding: 10px 18px;
	border: 0; border-radius: 8px;
	background: #4f46e5; color: #fff;
	font-size: 15px; font-weight: 600;
	cursor: pointer; transition: background 150ms, transform 100ms;
}
.qsm-btn:hover { background: #4338ca; }
.qsm-btn:active { transform: translateY(1px); }
.qsm-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.qsm-btn-prev { background: #6b7280; }
.qsm-btn-prev:hover { background: #4b5563; }
.qsm-btn-submit { background: #059669; }
.qsm-btn-submit:hover { background: #047857; }

.qsm-error { color: #b91c1c; background: #fee2e2; border: 1px solid #fecaca; padding: 8px 12px; border-radius: 8px; margin-top: 12px; font-size: 14px; }

.qsm-result {
	padding: 24px;
	background: linear-gradient(135deg, #eef2ff, #ecfeff);
	border-radius: 12px;
	margin-top: 16px;
	text-align: center;
}
.qsm-result h3 { margin: 0 0 8px; }
.qsm-result .qsm-final-score { font-size: 32px; font-weight: 800; color: #4f46e5; margin: 8px 0; }
.qsm-redirect-countdown {
	margin-top: 16px;
	padding: 10px 14px;
	background: #fff;
	border: 1px solid #c7d2fe;
	border-radius: 8px;
	color: #4338ca;
	font-size: 14px;
}
.qsm-redirect-countdown a { color: #4338ca; font-weight: 600; text-decoration: underline; }

@media (max-width: 600px) {
	.qsm-quiz { padding: 16px; border-radius: 8px; }
	.qsm-truefalse { flex-direction: column; }
}
