/**
 * Retoques de usabilidad del formulario de reserva.
 *
 * ── Aceptación de términos ──────────────────────────────────────────────
 *
 * La etiqueta ERA el enlace: todo el texto apuntaba al documento, así que
 * pulsarlo lo abría en otra pestaña en vez de marcar la casilla. La única zona
 * que marcaba de verdad era el cuadradito nativo, de unos 13 px, imposible de
 * acertar en un móvil.
 *
 * Ahora la casilla ocupa una pastilla entera: cualquier punto de ella la marca.
 * El enlace al documento va aparte, debajo y a la derecha, pequeño, para que se
 * pueda consultar sin riesgo de pulsarlo al intentar aceptar.
 */

.idt-term {
	display: block;
	margin: 14px 0 18px;
}

/* La pastilla: toda ella marca la casilla. */
.idt-term__check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 12px 14px;
	border: 1px solid #dbe1ea;
	border-radius: 12px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
	/* Un golpe accidental no debe seleccionar el texto. */
	-webkit-user-select: none;
	user-select: none;
	/* Sin resalte azul al tocar en móvil. */
	-webkit-tap-highlight-color: transparent;
}

.idt-term__check:hover {
	border-color: #b9c4d4;
	background: #fcfdff;
}

/* La casilla nativa se oculta pero sigue siendo la que vale: mantiene el
   required, el foco por teclado y los lectores de pantalla. */
.idt-term__check input[type="checkbox"] {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	border: 0;
	opacity: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* El cuadro dibujado, bastante mayor que el nativo. */
.idt-term__box {
	position: relative;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	margin-top: 1px;
	border: 2px solid #c2cbd8;
	border-radius: 6px;
	background: #fff;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.idt-term__box::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 7px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2.5px 2.5px 0;
	transform: rotate(45deg) scale(0);
	transition: transform 0.15s ease;
}

.idt-term__check input[type="checkbox"]:checked ~ .idt-term__box {
	border-color: #0f9d76;
	background: #0f9d76;
}

.idt-term__check input[type="checkbox"]:checked ~ .idt-term__box::after {
	transform: rotate(45deg) scale(1);
}

/* Foco por teclado visible sobre la pastilla entera. */
.idt-term__check input[type="checkbox"]:focus-visible ~ .idt-term__box {
	outline: 2px solid #0f9d76;
	outline-offset: 2px;
}

.idt-term__check:has(input[type="checkbox"]:checked) {
	border-color: #a7ded0;
	background: #f4fbf8;
}

.idt-term__text {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 14px;
	line-height: 1.45;
	color: #2f3b47;
}

.idt-term__req {
	margin-left: 3px;
	color: #d1495b;
	font-weight: 700;
}

/* El enlace al documento: aparte, debajo, pequeño y a la derecha. */
.idt-term__link {
	display: block;
	margin-top: 6px;
	padding-right: 2px;
	text-align: right;
	font-size: 12px;
	line-height: 1.4;
	color: #6b7787;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.idt-term__link:hover,
.idt-term__link:focus {
	color: #0f9d76;
}

@media (max-width: 480px) {
	.idt-term__text {
		font-size: 13.5px;
	}

	/* En móvil el enlace necesita area suficiente para el dedo. */
	.idt-term__link {
		padding: 6px 2px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.idt-term__check,
	.idt-term__box,
	.idt-term__box::after {
		transition: none;
	}
}
