/**
 * Teste antes da compra — visual.
 * Usa as variáveis do tema quando existem; senão, cai nos azuis do padrão.
 */

.tm-quiz {
	--tm-accent: var(--lu-accent, #2b7f9b);
	--tm-deep: var(--lu-blue-deep, #1d6479);
	--tm-soft: var(--lu-blue-soft, #d3e8ee);
	--tm-red: var(--lu-red, #c4272c);
	--tm-ink: var(--lu-ink, #14232a);
	--tm-ink-soft: var(--lu-ink-soft, #3d4f57);
	--tm-muted: var(--lu-muted, #74848b);
	--tm-line: var(--lu-line, #d3e0e5);
	--tm-surface: var(--lu-surface, #fff);
	--tm-bg: var(--lu-bg-blue, #edf5f7);
	--tm-serif: var(--lu-serif, Georgia, "Times New Roman", serif);
	--tm-sans: var(--lu-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif);

	max-width: 680px;
	margin-inline: auto;
	font-family: var(--tm-sans);
	color: var(--tm-ink);
}

.tm-card {
	background: var(--tm-surface);
	border: 1px solid var(--tm-line);
	border-radius: 12px;
	padding: clamp(1.4rem, 4vw, 2.4rem);
	box-shadow: 0 1px 2px rgba(20, 35, 42, .04), 0 14px 32px -20px rgba(29, 100, 121, .35);
}

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

.tm-card h2 {
	font-family: var(--tm-serif);
	font-size: clamp(1.4rem, 3vw, 1.9rem);
	font-weight: 600;
	line-height: 1.2;
	margin: 0 0 .6rem;
	color: var(--tm-ink);
}

.tm-lead {
	color: var(--tm-ink-soft);
	font-size: 1rem;
	line-height: 1.6;
	margin: 0 0 1.4rem;
}

/* ---- selo oficial + texto de apresentação ---- */

.tm-official {
	display: flex;
	align-items: flex-start;
	gap: .7rem;
	padding: .8rem 1rem;
	margin: 0 0 1.4rem;
	border: 1px solid var(--tm-line);
	border-left: 3px solid var(--tm-red);
	border-radius: 6px;
	background: var(--tm-bg);
	font-size: .82rem;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: .01em;
	color: var(--tm-ink-soft);
	text-transform: uppercase;
}
.tm-official__seal { flex: none; color: var(--tm-red); }
.tm-official svg { width: 20px; height: 20px; }

.tm-prose { color: var(--tm-ink-soft); font-size: 1rem; line-height: 1.65; }
.tm-prose p { margin: 0 0 1em; }
.tm-prose p:last-child { margin-bottom: 0; }

.tm-subtitle {
	font-family: var(--tm-serif);
	font-size: 1.15rem;
	font-weight: 600;
	margin: 1.8rem 0 1rem;
	padding-top: 1.4rem;
	border-top: 1px solid var(--tm-line);
	color: var(--tm-ink);
}

.tm-disclaimer {
	margin: 1.2rem 0 0;
	font-size: .78rem;
	line-height: 1.5;
	color: var(--tm-muted);
	text-align: center;
}

/* ---- regras do topo ---- */

.tm-rules {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem 1.4rem;
	padding-bottom: 1.1rem;
	margin-bottom: 1.2rem;
	border-bottom: 1px solid var(--tm-line);
	font-size: .86rem;
	color: var(--tm-muted);
}
.tm-rules strong { color: var(--tm-deep); font-size: 1rem; }

/* ---- formulário ---- */

.tm-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.tm-field { display: flex; flex-direction: column; align-content: start; }
.tm-field--full { grid-column: 1 / -1; }
.tm-req { color: var(--tm-red); }

.tm-form textarea,
.tm-form input[type="text"],
.tm-form input[type="number"],
.tm-form input[type="file"] {
	width: 100%;
	font-family: inherit;
	font-size: 1rem;
	color: var(--tm-ink);
	background: var(--lu-bg, #f5f8f9);
	border: 1px solid var(--tm-line);
	border-radius: 6px;
	padding: .85rem .95rem;
	-webkit-appearance: none;
	appearance: none;
}
.tm-form textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.tm-form textarea:focus,
.tm-form input[type="text"]:focus,
.tm-form input[type="number"]:focus,
.tm-form input[type="file"]:focus {
	outline: none;
	border-color: var(--tm-accent);
	box-shadow: 0 0 0 3px rgba(43, 127, 155, .12);
	background: #fff;
}

.tm-form input[type="file"] {
	padding: .7rem .8rem;
	font-size: .9rem;
	cursor: pointer;
	border-style: dashed;
}
.tm-form input[type="file"]::file-selector-button {
	font-family: inherit;
	font-size: .82rem;
	font-weight: 600;
	color: #fff;
	background: var(--tm-accent);
	border: 0;
	border-radius: 999px;
	padding: .5rem 1rem;
	margin-right: .9rem;
	cursor: pointer;
}

.tm-form .is-missing { border-color: var(--tm-red); background: rgba(196, 39, 44, .04); }

.tm-form label {
	display: block;
	font-size: .82rem;
	font-weight: 600;
	margin-bottom: .4rem;
	color: var(--tm-ink-soft);
}

.tm-form input[type="email"] {
	width: 100%;
	font-family: inherit;
	font-size: 1rem;
	color: var(--tm-ink);
	background: var(--lu-bg, #f5f8f9);
	border: 1px solid var(--tm-line);
	border-radius: 6px;
	padding: .85rem .95rem;
	-webkit-appearance: none;
	appearance: none;
}
.tm-form input[type="email"]:focus {
	outline: none;
	border-color: var(--tm-accent);
	box-shadow: 0 0 0 3px rgba(43, 127, 155, .12);
	background: #fff;
}

.tm-form input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.tm-hint { font-size: .78rem; line-height: 1.45; color: var(--tm-muted); margin: .4rem 0 0; }

/* ---- botões ---- */

.tm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .6rem;
	font-family: inherit;
	font-size: .95rem;
	font-weight: 600;
	line-height: 1;
	padding: 1rem 1.9rem;
	border: 1px solid var(--tm-accent);
	border-radius: 999px;
	background: var(--tm-accent);
	color: #fff;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s, transform .2s, box-shadow .2s;
	box-shadow: 0 12px 26px -16px rgba(29, 100, 121, .9);
}
.tm-btn:hover { background: var(--tm-deep); border-color: var(--tm-deep); color: #fff; transform: translateY(-1px); }
.tm-btn[disabled] { opacity: .6; cursor: default; transform: none; }
.tm-btn--block { width: 100%; }
.tm-btn--ghost { background: transparent; color: var(--tm-deep); }
.tm-btn--ghost:hover { background: var(--tm-deep); color: #fff; }

.tm-spinner {
	display: none;
	width: 15px;
	height: 15px;
	border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: tm-spin .7s linear infinite;
}
.tm-btn.is-loading .tm-spinner { display: block; }
@keyframes tm-spin { to { transform: rotate(360deg); } }

/* ---- avisos ---- */

.tm-alert {
	display: none;
	padding: .85rem 1rem;
	border-radius: 6px;
	font-size: .92rem;
	margin-bottom: 1rem;
	border: 1px solid transparent;
}
.tm-alert.is-visible { display: block; }
.tm-alert--err { background: rgba(196, 39, 44, .07); border-color: rgba(196, 39, 44, .3); color: #8e1f23; }
.tm-alert--err a { color: inherit; }

.tm-badge {
	display: inline-block;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	padding: .45rem .9rem;
	border-radius: 999px;
	margin-bottom: 1rem;
}
.tm-badge--ok { background: var(--tm-deep); color: #fff; }
.tm-badge--no { background: var(--tm-red); color: #fff; }

/* ---- progresso ---- */

.tm-progress {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: .82rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--tm-muted);
	margin-bottom: .6rem;
}

.tm-progress__timer {
	font-variant-numeric: tabular-nums;
	color: var(--tm-deep);
	font-size: 1rem;
}
.tm-progress__timer.is-low { color: var(--tm-red); }

.tm-bar {
	height: 4px;
	background: var(--tm-soft);
	border-radius: 999px;
	overflow: hidden;
	margin-bottom: 1.6rem;
}
.tm-bar__fill {
	height: 100%;
	width: 100%;
	background: var(--tm-accent);
	border-radius: 999px;
}

.tm-question {
	font-family: var(--tm-serif);
	font-size: clamp(1.25rem, 3vw, 1.65rem);
	line-height: 1.3;
	margin: 0 0 1.4rem;
	text-wrap: balance;
}

/* ---- alternativas ---- */

.tm-options { display: grid; gap: .6rem; }

.tm-option {
	display: flex;
	align-items: center;
	gap: .9rem;
	width: 100%;
	text-align: left;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.4;
	color: var(--tm-ink);
	background: var(--lu-bg, #f5f8f9);
	border: 1px solid var(--tm-line);
	border-radius: 10px;
	padding: .95rem 1.1rem;
	cursor: pointer;
	transition: border-color .15s, background-color .15s, transform .15s;
}
.tm-option:hover:not([disabled]) { border-color: var(--tm-accent); background: #fff; transform: translateX(2px); }
.tm-option[disabled] { cursor: default; }

.tm-option__letter {
	flex: none;
	width: 28px;
	height: 28px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--tm-soft);
	color: var(--tm-deep);
	font-size: .8rem;
	font-weight: 700;
}

.tm-option.is-chosen { border-color: var(--tm-accent); }
.tm-option.is-right { border-color: #2f6b4f; background: rgba(47, 107, 79, .09); }
.tm-option.is-right .tm-option__letter { background: #2f6b4f; color: #fff; }
.tm-option.is-wrong { border-color: var(--tm-red); background: rgba(196, 39, 44, .07); }
.tm-option.is-wrong .tm-option__letter { background: var(--tm-red); color: #fff; }

.tm-score {
	margin: 1.2rem 0 0;
	text-align: right;
	font-size: .85rem;
	font-weight: 600;
	color: var(--tm-deep);
	min-height: 1.2em;
}

.tm-number {
	display: inline-block;
	margin: .2rem 0 1rem;
	padding: .7rem 1.4rem;
	border: 1px solid var(--tm-line);
	border-radius: 8px;
	background: var(--tm-bg);
	text-align: center;
}
.tm-number span {
	display: block;
	font-size: .66rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--tm-red);
	margin-bottom: .2rem;
}
.tm-number strong {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 1.3rem;
	letter-spacing: .04em;
	color: var(--tm-deep);
}

#tm-result-actions { margin-top: 1.6rem; }

@media (max-width: 560px) {
	.tm-grid { grid-template-columns: 1fr; }
	.tm-official { font-size: .76rem; }
	.tm-rules { gap: .35rem 1rem; font-size: .8rem; }
	.tm-option { font-size: .95rem; padding: .85rem .9rem; }
	.tm-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.tm-option, .tm-btn, .tm-bar__fill { transition: none !important; }
}
