/* ============================================================
   APET Votação — página pública
   Tokens de marca (--apet-vermelho, --apet-preto, --apet-cinza-bg,
   --apet-fonte-titulo, --apet-fonte-corpo) são injetados inline pelo
   PHP a partir da aba Aparência. O que está aqui é estrutural.
   ============================================================ */

:root {
	--apet-branco: #ffffff;
	--apet-texto: #1a1a1a;
	--apet-texto-sec: #6b6b6b;
	--apet-borda: #e3e3e3;
	--apet-raio: 4px;
	--apet-max: 1180px;
	--apet-esp-1: 8px;
	--apet-esp-2: 16px;
	--apet-esp-3: 24px;
	--apet-esp-4: 40px;
	--apet-esp-5: 64px;
	--apet-esp-6: 96px;
	--apet-barra-altura: 88px;
}

/* ------------------------------------------------------------ base */

.apet-pagina {
	margin: 0;
	padding: 0;
	background: var(--apet-branco);
	color: var(--apet-texto);
	font-family: var(--apet-fonte-corpo);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

.apet-pagina *,
.apet-pagina *::before,
.apet-pagina *::after {
	box-sizing: border-box;
}

.apet-pagina img {
	max-width: 100%;
	height: auto;
	display: block;
}

.apet-container {
	width: 100%;
	max-width: var(--apet-max);
	margin: 0 auto;
	padding: 0 var(--apet-esp-3);
}

.apet-container--estreito {
	max-width: 720px;
}

.apet-visualmente-oculto {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.apet-pagina :focus-visible {
	outline: 3px solid var(--apet-vermelho);
	outline-offset: 3px;
}

/* ------------------------------------------------- tipografia comum */

.apet-rotulo {
	display: flex;
	align-items: center;
	gap: var(--apet-esp-1);
	margin: 0 0 var(--apet-esp-2);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--apet-vermelho);
}

.apet-rotulo::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
	flex: 0 0 auto;
}

.apet-rotulo--claro {
	color: var(--apet-branco);
}

.apet-titulo-secao {
	margin: 0 0 var(--apet-esp-2);
	font-family: var(--apet-fonte-titulo);
	font-size: clamp(24px, 3.2vw, 34px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--apet-texto);
}

.apet-secao__ajuda {
	margin: 0 0 var(--apet-esp-4);
	color: var(--apet-texto-sec);
	font-size: 15px;
}

/* -------------------------------------------------------- botão pill */

.apet-pill {
	display: inline-flex;
	align-items: center;
	gap: var(--apet-esp-2);
	padding: 6px 6px 6px var(--apet-esp-3);
	border: 1px solid transparent;
	border-radius: 999px;
	font-family: var(--apet-fonte-corpo);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.apet-pill__seta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	font-size: 15px;
	flex: 0 0 auto;
	transition: transform 0.18s ease;
}

.apet-pill:hover .apet-pill__seta {
	transform: translateX(3px);
}

.apet-pill--vermelho {
	background: var(--apet-vermelho);
	color: var(--apet-branco);
}

.apet-pill--vermelho .apet-pill__seta {
	background: var(--apet-branco);
	color: var(--apet-vermelho);
}

.apet-pill--vermelho:hover {
	background: var(--apet-preto);
}

.apet-pill--contorno {
	border-color: var(--apet-vermelho);
	color: var(--apet-vermelho);
}

.apet-pill--contorno .apet-pill__seta {
	background: var(--apet-vermelho);
	color: var(--apet-branco);
}

.apet-pill--contorno:hover {
	background: var(--apet-vermelho);
	color: var(--apet-branco);
}

.apet-pill--contorno-claro {
	border-color: rgba(255, 255, 255, 0.35);
	color: var(--apet-branco);
}

.apet-pill--contorno-claro .apet-pill__seta {
	background: var(--apet-vermelho);
	color: var(--apet-branco);
}

.apet-pill--grande {
	padding: 8px 8px 8px var(--apet-esp-4);
	font-size: 16px;
}

.apet-pill--grande .apet-pill__seta {
	width: 40px;
	height: 40px;
}

.apet-pill[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
}

.apet-pill[disabled]:hover {
	background: var(--apet-vermelho);
}

/* ------------------------------------------------------------ header */

/*
 * Header claro: a marca da APET é preta com vermelho, então sobre fundo escuro
 * ela sumiria. O site institucional também usa cabeçalho branco.
 */
.apet-header {
	background: var(--apet-branco);
	color: var(--apet-texto);
	border-bottom: 1px solid var(--apet-borda);
}

/* Três colunas iguais nas pontas: a logo fica opticamente centrada mesmo com o
   botão de regulamento presente de um lado só. */
.apet-header__interno {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: var(--apet-esp-3);
	min-height: 96px;
}

.apet-header__lado {
	display: flex;
	align-items: center;
	min-width: 0;
}

.apet-header__lado--fim {
	justify-content: flex-end;
}

.apet-header__logo {
	display: flex;
	justify-content: center;
}

.apet-header__logo img {
	max-height: 56px;
	width: auto;
}

/* -------------------------------------------------------------- hero */

.apet-hero {
	background: var(--apet-vermelho);
	color: var(--apet-branco);
	position: relative;
	overflow: hidden;
}

.apet-hero::after {
	content: "";
	position: absolute;
	right: -120px;
	top: -80px;
	width: 420px;
	height: 420px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.06);
	pointer-events: none;
}

.apet-hero__interno {
	position: relative;
	z-index: 1;
	padding-top: var(--apet-esp-5);
	padding-bottom: var(--apet-esp-5);
	max-width: 860px;
	margin-inline: auto;
}

.apet-hero__titulo {
	margin: 0;
	font-family: var(--apet-fonte-titulo);
	font-size: clamp(32px, 6vw, 60px);
	font-weight: 700;
	line-height: 1.04;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.apet-hero__anos {
	margin: var(--apet-esp-2) 0 0;
	font-family: var(--apet-fonte-titulo);
	font-size: clamp(20px, 3vw, 28px);
	font-weight: 600;
	letter-spacing: 0.14em;
	opacity: 0.92;
}

.apet-hero__intro {
	margin-top: var(--apet-esp-3);
	font-size: 17px;
	line-height: 1.65;
	opacity: 0.94;
}

.apet-hero__intro p {
	margin: 0 0 var(--apet-esp-2);
}

.apet-hero__prazo {
	margin: var(--apet-esp-3) 0 0;
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
}

/* ------------------------------------------------------------ seções */

.apet-main {
	padding-bottom: var(--apet-barra-altura);
}

.apet-secao {
	padding: var(--apet-esp-6) 0;
}

.apet-secao--livro,
.apet-secao--form,
.apet-secao--ranking:nth-of-type(even) {
	background: var(--apet-cinza-bg);
}

.apet-secao--aviso,
.apet-secao--total {
	padding: var(--apet-esp-5) 0;
	text-align: center;
}

/* -------------------------------------------------------------- grid */

.apet-grid {
	display: grid;
	gap: var(--apet-esp-3);
}

.apet-grid--pessoa {
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.apet-grid--livro {
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* ------------------------------------------------------------- cards */

.apet-card {
	display: block;
	cursor: pointer;
	position: relative;
}

.apet-card__corpo {
	display: flex;
	gap: var(--apet-esp-3);
	height: 100%;
	padding: var(--apet-esp-3);
	background: var(--apet-branco);
	border: 1px solid var(--apet-borda);
	border-radius: var(--apet-raio);
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.apet-card:hover .apet-card__corpo {
	border-color: var(--apet-texto-sec);
	transform: translateY(-2px);
}

.apet-card__input:checked + .apet-card__corpo {
	border-color: var(--apet-vermelho);
	box-shadow: inset 0 0 0 2px var(--apet-vermelho);
}

.apet-card__input:focus-visible + .apet-card__corpo {
	outline: 3px solid var(--apet-vermelho);
	outline-offset: 3px;
}

.apet-card__midia {
	flex: 0 0 auto;
	display: block;
	overflow: hidden;
	background: var(--apet-cinza-bg);
}

.apet-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-family: var(--apet-fonte-titulo);
	font-size: 28px;
	font-weight: 700;
	color: var(--apet-texto-sec);
	text-transform: uppercase;
}

.apet-card__texto {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.apet-card__nome {
	font-family: var(--apet-fonte-titulo);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0.01em;
	color: var(--apet-texto);
}

.apet-card__extra {
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--apet-texto-sec);
}

.apet-card__extra--editora {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.apet-card__marca {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 22px;
	height: 22px;
	border: 2px solid var(--apet-borda);
	border-radius: 50%;
	background: var(--apet-branco);
	transition: background-color 0.18s ease, border-color 0.18s ease;
}

.apet-card__input:checked + .apet-card__corpo .apet-card__marca {
	border-color: var(--apet-vermelho);
	background: var(--apet-vermelho);
}

.apet-card__input:checked + .apet-card__corpo .apet-card__marca::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 5px;
	height: 10px;
	border: solid var(--apet-branco);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* card de pessoa: foto redonda à esquerda */

.apet-card--pessoa .apet-card__midia {
	width: 88px;
	height: 88px;
	border-radius: 50%;
}

.apet-card--pessoa .apet-card__midia img {
	width: 88px;
	height: 88px;
	object-fit: cover;
}

/* card de livro: capa em cima */

.apet-card--livro .apet-card__corpo {
	flex-direction: column;
	gap: var(--apet-esp-2);
	padding: var(--apet-esp-2);
}

.apet-card--livro .apet-card__midia {
	width: 100%;
	aspect-ratio: 3 / 4;
	border-radius: 2px;
}

.apet-card--livro .apet-card__midia img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

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

.apet-campos {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--apet-esp-3);
}

.apet-campo {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.apet-campo label {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--apet-texto-sec);
}

.apet-campo input {
	width: 100%;
	padding: 13px 16px;
	border: 1px solid var(--apet-borda);
	border-radius: var(--apet-raio);
	background: var(--apet-branco);
	font-family: inherit;
	font-size: 16px;
	color: var(--apet-texto);
	transition: border-color 0.18s ease;
}

.apet-campo input:focus {
	border-color: var(--apet-vermelho);
	outline: none;
}

.apet-consentimento {
	margin: var(--apet-esp-3) 0 0;
}

.apet-consentimento label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--apet-texto-sec);
	cursor: pointer;
}

.apet-consentimento input {
	margin-top: 3px;
	width: 18px;
	height: 18px;
	accent-color: var(--apet-vermelho);
	flex: 0 0 auto;
}

.apet-mensagem {
	margin: var(--apet-esp-3) 0 0;
	padding: 14px 18px;
	border-left: 3px solid var(--apet-vermelho);
	background: rgba(225, 29, 38, 0.07);
	font-size: 15px;
	color: var(--apet-texto);
}

.apet-mensagem[hidden] {
	display: none;
}

.apet-acoes {
	margin: var(--apet-esp-4) 0 0;
}

/* --------------------------------------------------------- barra fixa */

.apet-barra-selecao {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 40;
	background: var(--apet-branco);
	border-top: 1px solid var(--apet-borda);
	box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.07);
}

.apet-barra-selecao[hidden] {
	display: none;
}

.apet-barra-selecao__interno {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--apet-esp-3);
	min-height: var(--apet-barra-altura);
}

.apet-barra-selecao__escolhas {
	display: flex;
	gap: var(--apet-esp-4);
	min-width: 0;
	overflow: hidden;
}

.apet-barra-selecao__item {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.apet-barra-selecao__rotulo {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--apet-texto-sec);
}

.apet-barra-selecao__item strong {
	font-size: 15px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 260px;
}

/* --------------------------------------------------------- obrigado */

.apet-obrigado[hidden] {
	display: none;
}

.apet-obrigado__texto {
	font-size: 18px;
	color: var(--apet-texto);
}

.apet-obrigado__resumo {
	list-style: none;
	margin: var(--apet-esp-4) 0;
	padding: 0;
	display: grid;
	gap: var(--apet-esp-2);
}

.apet-obrigado__resumo li {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: var(--apet-esp-3);
	background: var(--apet-branco);
	border: 1px solid var(--apet-borda);
	border-left: 3px solid var(--apet-vermelho);
	border-radius: var(--apet-raio);
}

.apet-obrigado__resumo span {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--apet-texto-sec);
}

.apet-obrigado__resumo strong {
	font-family: var(--apet-fonte-titulo);
	font-size: 19px;
	letter-spacing: 0.01em;
}

.apet-obrigado__nota {
	font-size: 14px;
	color: var(--apet-texto-sec);
}

/* ------------------------------------------------------- aviso/contador */

.apet-aviso__data {
	font-size: 18px;
	color: var(--apet-texto-sec);
}

.apet-contador {
	margin-top: var(--apet-esp-3);
	font-family: var(--apet-fonte-titulo);
	font-size: clamp(28px, 5vw, 44px);
	font-weight: 700;
	letter-spacing: 0.06em;
	color: var(--apet-vermelho);
}

/* ------------------------------------------------------------ ranking */

.apet-total strong {
	display: block;
	font-family: var(--apet-fonte-titulo);
	font-size: clamp(40px, 7vw, 68px);
	font-weight: 700;
	line-height: 1;
	color: var(--apet-vermelho);
}

.apet-total span {
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--apet-texto-sec);
}

.apet-ranking {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: var(--apet-esp-2);
}

.apet-ranking__item {
	display: grid;
	grid-template-columns: 44px 64px 1fr auto;
	align-items: center;
	gap: var(--apet-esp-3);
	padding: var(--apet-esp-3);
	background: var(--apet-branco);
	border: 1px solid var(--apet-borda);
	border-radius: var(--apet-raio);
}

.apet-ranking__item--vencedor {
	border-color: var(--apet-vermelho);
	box-shadow: inset 0 0 0 1px var(--apet-vermelho);
}

.apet-ranking__posicao {
	font-family: var(--apet-fonte-titulo);
	font-size: 22px;
	font-weight: 700;
	color: var(--apet-texto-sec);
}

.apet-ranking__item--vencedor .apet-ranking__posicao {
	color: var(--apet-vermelho);
}

.apet-ranking__midia {
	width: 64px;
	overflow: hidden;
	background: var(--apet-cinza-bg);
}

.apet-ranking__midia--pessoa {
	height: 64px;
	border-radius: 50%;
}

.apet-ranking__midia--livro {
	aspect-ratio: 3 / 4;
	border-radius: 2px;
}

.apet-ranking__midia img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.apet-ranking__corpo {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.apet-ranking__nome {
	font-family: var(--apet-fonte-titulo);
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.apet-ranking__extra {
	font-size: 12px;
	color: var(--apet-texto-sec);
}

.apet-ranking__trilho {
	display: block;
	height: 8px;
	border-radius: 999px;
	background: var(--apet-cinza-bg);
	overflow: hidden;
}

.apet-ranking__preenchimento {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--apet-texto-sec);
	transition: width 0.5s ease;
}

.apet-ranking__item--vencedor .apet-ranking__preenchimento {
	background: var(--apet-vermelho);
}

.apet-ranking__valor {
	text-align: right;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.apet-ranking__valor strong {
	font-family: var(--apet-fonte-titulo);
	font-size: 21px;
	font-weight: 700;
}

.apet-ranking__valor span {
	font-size: 12px;
	color: var(--apet-texto-sec);
}

/* ------------------------------------------------------------- footer */

.apet-footer {
	background: var(--apet-preto);
	color: var(--apet-branco);
	margin-top: var(--apet-esp-6);
}

.apet-footer__interno {
	display: flex;
	flex-wrap: wrap;
	gap: var(--apet-esp-5);
	justify-content: space-between;
	padding-top: var(--apet-esp-5);
	padding-bottom: var(--apet-esp-4);
}

/* O rodapé é escuro: a marca entra em versão monocromática branca. */
.apet-footer__marca img {
	max-height: 46px;
	width: auto;
	margin-bottom: var(--apet-esp-2);
	filter: brightness( 0 ) invert( 1 );
}

.apet-footer__nome {
	margin: 0;
	font-size: 14px;
	opacity: 0.75;
	max-width: 420px;
}

.apet-footer__contato {
	font-size: 14px;
	opacity: 0.85;
}

.apet-footer__contato p {
	margin: 0 0 6px;
}

.apet-footer__base {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	padding: var(--apet-esp-3) 0;
}

.apet-footer__base p {
	margin: 0;
	font-size: 12px;
	opacity: 0.6;
}

/* --------------------------------------------------------- responsivo */

@media (max-width: 1024px) {
	.apet-grid--pessoa {
		grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	}
}

@media (max-width: 768px) {
	:root {
		--apet-esp-5: 44px;
		--apet-esp-6: 56px;
		--apet-barra-altura: 76px;
	}

	/* Sem espaço para as três colunas: logo centrada em cima, botão embaixo. */
	.apet-header__interno {
		grid-template-columns: 1fr;
		justify-items: center;
		gap: var(--apet-esp-2);
		padding-top: var(--apet-esp-3);
		padding-bottom: var(--apet-esp-3);
		min-height: 0;
	}

	.apet-header__lado:empty {
		display: none;
	}

	.apet-header__lado--fim {
		justify-content: center;
	}

	.apet-header__logo img {
		max-height: 44px;
	}

	.apet-grid--pessoa,
	.apet-grid--livro {
		grid-template-columns: 1fr;
	}

	.apet-grid--livro .apet-card--livro .apet-card__corpo {
		flex-direction: row;
	}

	.apet-grid--livro .apet-card--livro .apet-card__midia {
		width: 96px;
		flex: 0 0 96px;
	}

	.apet-campos {
		grid-template-columns: 1fr;
	}

	.apet-barra-selecao__escolhas {
		gap: var(--apet-esp-3);
	}

	.apet-barra-selecao__item strong {
		max-width: 120px;
		font-size: 13px;
	}

	.apet-ranking__item {
		grid-template-columns: 32px 48px 1fr;
		grid-template-areas:
			"pos midia corpo"
			"val val val";
		row-gap: var(--apet-esp-2);
	}

	.apet-ranking__posicao { grid-area: pos; }
	.apet-ranking__midia { grid-area: midia; width: 48px; }
	.apet-ranking__corpo { grid-area: corpo; }
	.apet-ranking__valor {
		grid-area: val;
		flex-direction: row;
		align-items: baseline;
		gap: var(--apet-esp-1);
		text-align: left;
	}

	.apet-footer__interno {
		gap: var(--apet-esp-4);
	}
}

@media (prefers-reduced-motion: reduce) {
	.apet-pagina * {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
