/**
 * Quiz Miqueias — tela pública.
 *
 * As cores saem de variáveis: a cor de destaque vem das configurações e é
 * escrita na própria página, logo abaixo deste arquivo.
 */

:root {
	--bg: #0b141a;
	--surface: #141f27;
	--surface-2: #1b2b34;
	--line: #243642;
	--text: #e9edef;
	--muted: #93a4ad;
	--accent: #25d366;
	--accent-ink: #04231a;
	--accent-soft: rgba(37, 211, 102, .1);
	--accent-glow: rgba(37, 211, 102, .22);
	--foot: #5d6e78;
	--maxw: 520px;
}

body.qm-light {
	--bg: #f2f5f7;
	--surface: #fff;
	--surface-2: #e9eef2;
	--line: #dde4e9;
	--text: #10212b;
	--muted: #5f7480;
	--foot: #8595a0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
	background: var(--bg);
	color: var(--text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.5;
	font-size: 17px;
	-webkit-font-smoothing: antialiased;
}

.app {
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	max-width: var(--maxw);
	margin: 0 auto;
	padding: calc(12px + env(safe-area-inset-top, 0px)) 18px calc(20px + env(safe-area-inset-bottom, 0px));
}

/* Cabeçalho */
.hdr { display: flex; align-items: center; gap: 12px; min-height: 34px; }
.back {
	width: 32px;
	height: 32px;
	flex: 0 0 auto;
	display: none;
	align-items: center;
	justify-content: center;
	background: none;
	border: 0;
	color: var(--muted);
	cursor: pointer;
	margin-left: -8px;
	-webkit-tap-highlight-color: transparent;
}
.back.on { display: flex; }
.hdr .name { font-size: 13.5px; font-weight: 700; letter-spacing: -.1px; flex: 1; }
.hdr .name span { color: var(--accent); }
.hdr .count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Barras de progresso, uma por pergunta */
.track { display: flex; gap: 6px; margin-top: 12px; }
.track i {
	flex: 1;
	height: 4px;
	border-radius: 2px;
	background: var(--line);
	transition: background .3s ease;
}
.track i.on { background: var(--accent); }

.view { margin: auto 0; padding: 22px 0 8px; }
.view.fade { animation: qm-in .28s ease; }
@keyframes qm-in {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

.kicker {
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: .8px;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 9px;
}
h1 {
	font-size: clamp(23px, 6.6vw, 31px);
	line-height: 1.15;
	font-weight: 800;
	letter-spacing: -.5px;
	margin-bottom: 8px;
}
h1 em { font-style: normal; color: var(--accent); }
.say { color: var(--muted); font-size: clamp(14.5px, 3.9vw, 16px); margin-bottom: 20px; }

/* Opções */
.opts { display: grid; gap: 10px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opt {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 15px 16px;
	text-align: left;
	color: var(--text);
	font-family: inherit;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 12px;
	transition: border-color .15s, background .15s, transform .09s;
	-webkit-tap-highlight-color: transparent;
}
.opts.two .opt { flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; }
.opt:active { transform: scale(.985); }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.opt .em { font-size: 21px; line-height: 1; flex: 0 0 auto; }
.opt .tx { flex: 1; }
.opt .t { display: block; font-size: 15.5px; font-weight: 650; line-height: 1.3; }
.opt .d { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }

/* Tela de análise */
.load h1 { margin-bottom: 22px; }
.bars { display: grid; gap: 14px; }
.row {
	display: flex;
	align-items: center;
	gap: 11px;
	font-size: 15px;
	color: var(--muted);
	opacity: .35;
	transition: opacity .3s, color .3s;
}
.row.on { opacity: 1; color: var(--text); }
.row .mk {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	border-radius: 50%;
	border: 2px solid var(--line);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color .3s, background .3s;
}
.row.on .mk { border-color: var(--accent); background: var(--accent); }
.row .mk svg { opacity: 0; stroke: var(--accent-ink); transition: opacity .3s; }
.row.on .mk svg { opacity: 1; }
.pct { margin-top: 22px; font-size: 13px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }

/* Saída: o botão que chama o anúncio */
.exit { display: none; margin-top: 26px; animation: qm-in .3s ease; }
.exit.on { display: block; }
.cta {
	display: block;
	width: 100%;
	background: var(--accent);
	color: var(--accent-ink);
	border: 0;
	border-radius: 14px;
	font-family: inherit;
	font-size: 17px;
	font-weight: 750;
	padding: 17px 18px;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 6px 22px var(--accent-glow);
	-webkit-tap-highlight-color: transparent;
}
.cta:active { transform: translateY(1px); filter: brightness(.94); }
.cta[disabled],
.cta[aria-disabled="true"] { opacity: .65; pointer-events: none; box-shadow: none; }
.note { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 11px; }

.foot { margin-top: auto; padding-top: 20px; text-align: center; color: var(--foot); font-size: 11.5px; line-height: 1.5; }

/* Espaço para o HTML colado nas configurações */
.slot { margin: 14px 0; text-align: center; }
.slot:empty { display: none; }
.slot img, .slot iframe { max-width: 100%; }

@media (max-height: 670px) {
	.opt { padding: 12px 13px; }
	.opts.two .opt { padding: 11px 12px; }
	.opt .d { display: none; }
	.say { margin-bottom: 15px; }
	.view { padding: 14px 0 4px; }
	.exit { margin-top: 20px; }
}
