/*
 * Aviso de consentimiento de la landing (assets/js/consent.v1.js).
 *
 * Se carga en páginas con hojas distintas (styles.css, legal-pages.css, verifactu/app-pages.css),
 * así que no depende de ninguna: toma sus colores si existen y, si no, los de la marca.
 * Rechazar y Aceptar comparten estilo a propósito: la AEPD pide que rechazar cueste lo mismo.
 */

.consent {
	--consent-primary: var(--app-primary, #0074c8);
	--consent-text: var(--app-text, #152033);
	--consent-muted: var(--app-muted, #64708a);
	--consent-border: var(--app-border, #dde5ef);
	--consent-surface: var(--app-surface, #fff);
	--consent-surface-muted: var(--app-surface-muted, #f7f9fc);

	position: fixed;
	z-index: 1000;
	inset-inline-end: 1rem;
	inset-block-end: 1rem;
	box-sizing: border-box;
	width: min(26rem, calc(100% - 2rem));
	max-height: calc(100vh - 2rem);
	overflow-y: auto;
	padding: 1.1rem;
	border: 1px solid var(--consent-border);
	border-radius: 0.85rem;
	background: var(--consent-surface);
	color: var(--consent-text);
	box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
	font: 0.95rem/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif;
	text-align: start;
}

.consent[hidden] {
	display: none;
}

.consent h2 {
	margin: 0;
	color: inherit;
	font-size: 1.05rem;
	font-weight: 750;
}

.consent p {
	margin: 0.45rem 0 0.9rem;
	color: var(--consent-muted);
}

.consent a {
	color: var(--consent-primary);
	font-weight: 650;
	text-decoration: underline;
}

.consent__options {
	display: grid;
	gap: 0.5rem;
	margin: 0 0 0.9rem;
}

.consent__options[hidden] {
	display: none;
}

.consent__option {
	display: flex;
	gap: 0.65rem;
	align-items: flex-start;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--consent-border);
	border-radius: 0.6rem;
	background: var(--consent-surface-muted);
	cursor: pointer;
}

.consent__option input {
	flex: none;
	width: 1.1rem;
	height: 1.1rem;
	margin: 0.15rem 0 0;
	accent-color: var(--consent-primary);
}

.consent__option span {
	display: grid;
	gap: 0.1rem;
}

.consent__option small {
	color: var(--consent-muted);
	font-size: 0.85rem;
}

.consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.consent__actions button {
	flex: 1 1 auto;
	min-height: 2.75rem;
	padding: 0.45rem 0.9rem;
	border: 1px solid var(--consent-primary);
	border-radius: 0.55rem;
	background: var(--consent-primary);
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.consent__actions .consent__configure {
	border-color: var(--consent-border);
	background: transparent;
	color: var(--consent-text);
}

.consent__actions button[hidden] {
	display: none;
}

.consent__actions button:focus-visible,
.consent__option:focus-within {
	outline: 3px solid color-mix(in srgb, var(--consent-primary) 45%, transparent);
	outline-offset: 2px;
}

@media (max-width: 600px) {
	.consent {
		inset-inline: 0.5rem;
		inset-block-end: 0.5rem;
		width: auto;
	}

	.consent__actions button {
		flex-basis: calc(50% - 0.25rem);
	}

	.consent__actions .consent__configure,
	.consent__actions .consent__save {
		flex-basis: 100%;
		order: 3;
	}
}

/* El botón del pie que vuelve a abrir el aviso. Se parece a los enlaces que lo rodean. */
.consent-settings {
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.site-footer-links .consent-settings {
	color: var(--app-muted, #64708a);
	font-size: 0.9rem;
	font-weight: 700;
	text-decoration: none;
}

.site-footer-links .consent-settings:hover,
.site-footer-links .consent-settings:focus {
	color: var(--app-primary-dark, #005896);
}
