/*
 * Acessibilidade Gov Pro — Aviso de cookies LGPD (glassmorphic).
 *
 * Os botões usam seletores com ID (#agp-lgpd ...) e !important nas propriedades
 * essenciais de propósito: temas/page builders (Elementor etc.) costumam ter um
 * estilo global para todo <button> (cor de destaque no hover, padding, fonte),
 * que sem isso vazaria para o banner.
 */

.agp-lgpd {
	--agp-lgpd-accent: #2563eb;
	--agp-lgpd-bg: rgba( 255, 255, 255, 0.86 );
	--agp-lgpd-border: rgba( 15, 23, 42, 0.08 );
	--agp-lgpd-text: #0f172a;
	--agp-lgpd-muted: #475569;
	--agp-lgpd-link: var( --agp-lgpd-accent );

	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 999998;
	max-width: 1120px;
	margin: 0 auto;
	padding: 18px 22px;
	background: var( --agp-lgpd-bg );
	backdrop-filter: blur( 14px ) saturate( 160% );
	-webkit-backdrop-filter: blur( 14px ) saturate( 160% );
	border: 1px solid var( --agp-lgpd-border );
	border-radius: 18px;
	box-shadow: 0 18px 50px rgba( 15, 23, 42, 0.22 );
	color: var( --agp-lgpd-text );
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	box-sizing: border-box;
}

@media ( prefers-color-scheme: dark ) {
	.agp-lgpd {
		--agp-lgpd-bg: rgba( 20, 24, 33, 0.86 );
		--agp-lgpd-border: rgba( 255, 255, 255, 0.12 );
		--agp-lgpd-text: #f1f5f9;
		--agp-lgpd-muted: #a8b3c4;
		/* A cor de destaque escolhida no admin costuma ser escura demais como texto
		   sobre fundo escuro (contraste WCAG AA): clareamos só o link. */
		--agp-lgpd-link: #93c5fd;
		--agp-lgpd-link: color-mix( in srgb, var( --agp-lgpd-accent ) 40%, #ffffff );
	}

	/* Logos costumam ser feitas para fundo claro: uma pastilha clara atrás dela
	   garante legibilidade no modo escuro, seja qual for a imagem enviada. */
	.agp-lgpd .agp-lgpd-logo {
		padding: 6px 10px;
		background: rgba( 255, 255, 255, 0.94 );
		border-radius: 12px;
	}
}

.agp-lgpd[hidden] {
	display: none;
}

.agp-lgpd:not( [hidden] ) {
	animation: agp-lgpd-in 0.45s cubic-bezier( 0.4, 0, 0.2, 1 );
}

@keyframes agp-lgpd-in {
	from {
		opacity: 0;
		transform: translateY( 28px );
	}
	to {
		opacity: 1;
		transform: translateY( 0 );
	}
}

.agp-lgpd *,
.agp-lgpd *::before,
.agp-lgpd *::after {
	box-sizing: border-box;
}

.agp-lgpd:focus {
	outline: none;
}

.agp-lgpd-inner {
	display: flex;
	align-items: center;
	gap: 18px;
}

.agp-lgpd-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 46px;
	height: 46px;
	border-radius: 14px;
	color: var( --agp-lgpd-accent );
	background: rgba( 37, 99, 235, 0.12 );
	background: color-mix( in srgb, var( --agp-lgpd-accent ) 14%, transparent );
}

/* Logo escolhida no admin: substitui o ícone; sempre pequena (44px de altura). */
.agp-lgpd-logo {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.agp-lgpd .agp-lgpd-logo img {
	display: block !important;
	width: auto !important;
	height: 44px !important;
	max-width: 150px !important;
	max-height: 44px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	object-fit: contain;
}

.agp-lgpd-icon svg {
	width: 24px !important;
	height: 24px !important;
	max-width: none !important;
	display: block;
}

.agp-lgpd-text {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.agp-lgpd-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	color: var( --agp-lgpd-text );
}

.agp-lgpd-desc {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.55;
	color: var( --agp-lgpd-muted );
}

.agp-lgpd .agp-lgpd-policy {
	color: var( --agp-lgpd-link );
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
}

.agp-lgpd .agp-lgpd-policy:hover,
.agp-lgpd .agp-lgpd-policy:focus {
	color: var( --agp-lgpd-link );
	text-decoration-thickness: 2px;
}

.agp-lgpd-actions {
	display: flex;
	flex-shrink: 0;
	gap: 10px;
}

/* Botões: mesmo tamanho e destaque (LGPD: recusar tão fácil quanto aceitar). */
#agp-lgpd .agp-lgpd-btn {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-width: 112px;
	min-height: 44px;
	margin: 0 !important;
	padding: 0 22px !important;
	border: 1.5px solid var( --agp-lgpd-accent ) !important;
	border-radius: 12px !important;
	box-shadow: none !important;
	font-family: inherit !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-shadow: none !important;
	cursor: pointer;
	transition: filter 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

#agp-lgpd .agp-lgpd-btn-primary,
#agp-lgpd .agp-lgpd-btn-primary:hover,
#agp-lgpd .agp-lgpd-btn-primary:focus,
#agp-lgpd .agp-lgpd-btn-primary:active {
	background: var( --agp-lgpd-accent ) !important;
	color: #fff !important;
}

#agp-lgpd .agp-lgpd-btn-primary:hover,
#agp-lgpd .agp-lgpd-btn-primary:active {
	filter: brightness( 0.9 );
}

#agp-lgpd .agp-lgpd-btn-ghost,
#agp-lgpd .agp-lgpd-btn-ghost:focus {
	background: transparent !important;
	color: var( --agp-lgpd-text ) !important;
}

#agp-lgpd .agp-lgpd-btn-ghost:hover,
#agp-lgpd .agp-lgpd-btn-ghost:active {
	background: rgba( 37, 99, 235, 0.1 ) !important;
	background: color-mix( in srgb, var( --agp-lgpd-accent ) 12%, transparent ) !important;
	color: var( --agp-lgpd-text ) !important;
}

#agp-lgpd .agp-lgpd-btn:hover {
	transform: translateY( -1px );
}

#agp-lgpd .agp-lgpd-btn:focus-visible,
.agp-lgpd .agp-lgpd-policy:focus-visible {
	outline: 3px solid var( --agp-lgpd-accent );
	outline-offset: 3px;
}

/* Link "Gerenciar cookies" do shortcode [agp_cookie_settings]. */
.agp-lgpd-reopen {
	appearance: none;
	-webkit-appearance: none;
	background: none;
	border: 0;
	padding: 0;
	color: inherit;
	font: inherit;
	text-transform: none;
	letter-spacing: inherit;
	text-decoration: underline;
	cursor: pointer;
}

@media ( max-width: 760px ) {
	.agp-lgpd {
		left: 10px;
		right: 10px;
		bottom: 10px;
		padding: 16px;
		border-radius: 16px;
	}

	.agp-lgpd-inner {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
	}

	.agp-lgpd-icon {
		display: none;
	}

	/* A logo é identidade da instituição: no celular fica centralizada e
	   responsiva (a altura acompanha a largura da tela, entre 36px e 48px, e
	   nunca passa da largura disponível). O texto e os botões não mudam. */
	.agp-lgpd-logo {
		justify-content: center;
	}

	.agp-lgpd .agp-lgpd-logo img {
		height: clamp( 36px, 11vw, 48px ) !important;
		max-height: 48px !important;
		max-width: 100% !important;
	}

	.agp-lgpd-actions {
		width: 100%;
	}

	#agp-lgpd .agp-lgpd-btn {
		flex: 1 1 0;
		min-width: 0;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.agp-lgpd:not( [hidden] ) {
		animation: none;
	}

	#agp-lgpd .agp-lgpd-btn {
		transition: none;
	}
}

@media print {
	.agp-lgpd {
		display: none !important;
	}
}
