/**
 * Testove — front-end styles.
 * Brand palette:
 *   --testove-blue  #053264  (dark blue)
 *   --testove-coral #fa4155  (coral red)
 *   --testove-cream #fafadc  (cream / pale yellow)
 *   --testove-teal  #82b4be  (muted cyan / teal)
 */

:root {
	--testove-blue: #053264;
	--testove-coral: #fa4155;
	--testove-cream: #fafadc;
	--testove-teal: #82b4be;
	--testove-blue-soft: rgba(5, 50, 100, 0.08);
	--testove-teal-soft: rgba(130, 180, 190, 0.18);
	--testove-coral-soft: rgba(250, 65, 85, 0.12);
	--testove-radius: 16px;
	--testove-shadow: 0 24px 60px rgba(5, 50, 100, 0.28);
	--testove-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Trigger button (shortcode) --------------------------------------- */
.testove-button {
	display: inline-block;
	font-family: var(--testove-font);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--testove-cream);
	background: var(--testove-coral);
	border: none;
	border-radius: 999px;
	padding: 14px 28px;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
	box-shadow: 0 8px 20px rgba(250, 65, 85, 0.28);
}

.testove-button:hover,
.testove-button:focus {
	transform: translateY(-2px);
	background: #e8394c;
	box-shadow: 0 12px 26px rgba(250, 65, 85, 0.36);
	color: var(--testove-cream);
}

/* ---- Scroll lock ------------------------------------------------------- */
body.testove-noscroll {
	overflow: hidden;
}

/* ---- Modal ------------------------------------------------------------- */
.testove-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	font-family: var(--testove-font);
	-webkit-font-smoothing: antialiased;
}

.testove-modal.is-open {
	display: flex;
}

.testove-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(5, 50, 100, 0.55);
	backdrop-filter: blur(3px);
	animation: testove-fade 0.25s ease;
}

.testove-modal__dialog {
	position: relative;
	width: min(560px, calc(100vw - 32px));
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	background: var(--testove-cream);
	border-radius: var(--testove-radius);
	box-shadow: var(--testove-shadow);
	padding: 36px 32px 32px;
	animation: testove-pop 0.32s cubic-bezier(0.22, 1, 0.36, 1);
	color: var(--testove-blue);
	box-sizing: border-box;
}

.testove-modal__close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 38px;
	height: 38px;
	border: none;
	background: transparent;
	color: var(--testove-blue);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	opacity: 0.6;
	transition: opacity 0.15s ease, background 0.15s ease;
}

.testove-modal__close:hover {
	opacity: 1;
	background: var(--testove-blue-soft);
}

/* ---- Screens ----------------------------------------------------------- */
.testove-screen {
	animation: testove-slide 0.3s ease;
}

.testove-screen--intro,
.testove-screen--result,
.testove-screen--loading,
.testove-screen--error {
	text-align: center;
}

.testove-title {
	font-size: 26px;
	font-weight: 800;
	margin: 0 0 10px;
	color: var(--testove-blue);
	line-height: 1.25;
}

.testove-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--testove-teal);
	color: #fff;
	font-size: 26px;
	font-weight: 800;
	margin: 0 auto 18px;
	box-shadow: 0 8px 18px rgba(130, 180, 190, 0.45);
}

.testove-intro-meta {
	color: var(--testove-blue);
	opacity: 0.75;
	font-size: 15px;
	margin: 0 0 26px;
}

.testove-dot {
	margin: 0 8px;
	opacity: 0.5;
}

/* ---- Buttons ----------------------------------------------------------- */
.testove-btn {
	font-family: var(--testove-font);
	font-size: 16px;
	font-weight: 700;
	border: none;
	border-radius: 999px;
	padding: 14px 30px;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.testove-btn--primary {
	background: var(--testove-coral);
	color: var(--testove-cream);
	box-shadow: 0 8px 20px rgba(250, 65, 85, 0.3);
}

.testove-btn--primary:hover:not(:disabled) {
	transform: translateY(-2px);
	background: #e8394c;
}

.testove-btn--primary:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.testove-btn--ghost {
	background: transparent;
	color: var(--testove-blue);
	border: 2px solid rgba(5, 50, 100, 0.25);
}

.testove-btn--ghost:hover {
	background: var(--testove-blue-soft);
}

/* ---- Progress bar ------------------------------------------------------ */
.testove-progress {
	margin-bottom: 22px;
}

.testove-progress__label {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--testove-blue);
	opacity: 0.7;
	margin-bottom: 8px;
}

.testove-progress__track {
	height: 10px;
	border-radius: 999px;
	background: rgba(5, 50, 100, 0.12);
	overflow: hidden;
}

.testove-progress__fill {
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--testove-teal), var(--testove-blue));
	width: 0;
	transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Question ---------------------------------------------------------- */
.testove-question-text {
	font-size: 21px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--testove-blue);
	margin: 0 0 20px;
}

.testove-answers-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

.testove-answer {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	text-align: left;
	background: #fff;
	border: 2px solid rgba(5, 50, 100, 0.14);
	border-radius: 14px;
	padding: 15px 18px;
	font-family: var(--testove-font);
	font-size: 16px;
	color: var(--testove-blue);
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.testove-answer:hover:not(.is-locked) {
	border-color: var(--testove-teal);
	background: var(--testove-teal-soft);
}

.testove-answer__marker {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 2px solid rgba(5, 50, 100, 0.3);
	transition: all 0.15s ease;
	position: relative;
}

.testove-answer.is-selected {
	border-color: var(--testove-blue);
	background: var(--testove-teal-soft);
}

.testove-answer.is-selected .testove-answer__marker {
	border-color: var(--testove-blue);
	background: var(--testove-blue);
	box-shadow: inset 0 0 0 4px #fff;
}

.testove-answer__text {
	flex: 1;
}

.testove-answer.is-locked {
	cursor: default;
}

.testove-answer.is-correct {
	border-color: var(--testove-teal);
	background: var(--testove-teal-soft);
}

.testove-answer.is-correct .testove-answer__marker {
	border-color: var(--testove-teal);
	background: var(--testove-teal);
	box-shadow: inset 0 0 0 3px #fff;
}

.testove-answer.is-correct .testove-answer__marker::after {
	content: "✓";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 13px;
	font-weight: 800;
}

.testove-answer.is-wrong {
	border-color: var(--testove-coral);
	background: var(--testove-coral-soft);
}

.testove-answer.is-wrong .testove-answer__marker {
	border-color: var(--testove-coral);
	background: var(--testove-coral);
}

.testove-answer.is-wrong .testove-answer__marker::after {
	content: "✕";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 12px;
	font-weight: 800;
}

/* ---- Feedback ---------------------------------------------------------- */
.testove-feedback {
	display: none;
}

.testove-feedback.is-visible {
	display: block;
	border-radius: 14px;
	padding: 16px 18px;
	margin-bottom: 20px;
	animation: testove-slide 0.3s ease;
}

.testove-feedback.is-correct {
	background: var(--testove-teal-soft);
	border-left: 5px solid var(--testove-teal);
}

.testove-feedback.is-wrong {
	background: var(--testove-coral-soft);
	border-left: 5px solid var(--testove-coral);
}

.testove-feedback__head {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 800;
	font-size: 16px;
	margin-bottom: 6px;
}

.testove-feedback__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	color: #fff;
	font-size: 13px;
}

.testove-feedback.is-correct .testove-feedback__icon {
	background: var(--testove-teal);
}

.testove-feedback.is-correct .testove-feedback__label {
	color: #3c7d88;
}

.testove-feedback.is-wrong .testove-feedback__icon {
	background: var(--testove-coral);
}

.testove-feedback.is-wrong .testove-feedback__label {
	color: var(--testove-coral);
}

.testove-feedback__text {
	color: var(--testove-blue);
	font-size: 15px;
	line-height: 1.5;
}

/* ---- Actions ----------------------------------------------------------- */
.testove-actions {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	flex-wrap: wrap;
}

.testove-actions--center {
	justify-content: center;
	margin-top: 26px;
}

/* ---- Result ------------------------------------------------------------ */
.testove-result-title {
	font-size: 26px;
	font-weight: 800;
	margin: 0 0 20px;
}

.testove-screen--result.is-pass .testove-result-title {
	color: #3c7d88;
}

.testove-screen--result.is-fail .testove-result-title {
	color: var(--testove-coral);
}

.testove-ring {
	position: relative;
	width: 180px;
	height: 180px;
	margin: 0 auto 18px;
}

.testove-ring__svg {
	transform: rotate(-90deg);
}

.testove-ring__track {
	stroke: rgba(5, 50, 100, 0.12);
}

.testove-ring__progress.is-pass {
	stroke: var(--testove-teal);
}

.testove-ring__progress.is-fail {
	stroke: var(--testove-coral);
}

.testove-ring__value {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	color: var(--testove-blue);
}

.testove-ring__number {
	font-size: 46px;
	line-height: 1;
}

.testove-ring__unit {
	font-size: 22px;
	margin-left: 2px;
	opacity: 0.7;
}

.testove-result-sub {
	font-size: 17px;
	font-weight: 700;
	color: var(--testove-blue);
	margin: 0 0 14px;
}

.testove-result-message {
	font-size: 15px;
	line-height: 1.55;
	color: var(--testove-blue);
	opacity: 0.85;
	max-width: 420px;
	margin: 0 auto;
}

.testove-celebrate .testove-ring {
	animation: testove-bounce 0.7s ease;
}

/* ---- Loading / error --------------------------------------------------- */
.testove-spinner {
	width: 44px;
	height: 44px;
	border: 4px solid rgba(5, 50, 100, 0.15);
	border-top-color: var(--testove-teal);
	border-radius: 50%;
	margin: 20px auto 16px;
	animation: testove-spin 0.8s linear infinite;
}

.testove-loading-text,
.testove-error-text {
	color: var(--testove-blue);
	font-size: 16px;
	margin-bottom: 18px;
}

/* ---- Animations -------------------------------------------------------- */
@keyframes testove-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes testove-pop {
	from { opacity: 0; transform: translateY(24px) scale(0.96); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes testove-slide {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

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

@keyframes testove-bounce {
	0% { transform: scale(0.7); opacity: 0; }
	60% { transform: scale(1.08); opacity: 1; }
	100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.testove-modal__overlay,
	.testove-modal__dialog,
	.testove-screen,
	.testove-feedback.is-visible,
	.testove-celebrate .testove-ring {
		animation: none !important;
	}
	.testove-ring__progress {
		transition: none !important;
	}
}

/* ---- Small screens ----------------------------------------------------- */
@media (max-width: 480px) {
	.testove-modal__dialog {
		padding: 30px 20px 24px;
	}
	.testove-title,
	.testove-result-title {
		font-size: 22px;
	}
	.testove-question-text {
		font-size: 19px;
	}
	.testove-actions {
		justify-content: stretch;
	}
	.testove-actions .testove-btn {
		flex: 1;
	}
}
