/**
 * Before You Begin — terms agreement (shortcode + shared checkbox styling).
 */

.hff-terms-agree {
	--hff-terms-gold: #ca9b17;
	--hff-terms-blue: #85d8fd;
	--hff-terms-ink: #1a252f;
	--hff-terms-text: #ffffff;
	--hff-terms-muted: #c5cfdb;

	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1.35rem;
	max-width: 34rem;
	font-family: Montserrat, "Segoe UI", sans-serif;
}

.hff-terms-agree__row {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.9rem;
	margin: 0;
	cursor: pointer;
	color: var(--hff-terms-text);
	font-weight: 500;
	font-size: 1.3125rem;
	line-height: 1.75;
}

.hff-terms-agree__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	pointer-events: none;
}

.hff-terms-agree__box {
	box-sizing: border-box;
	flex: none;
	width: 25px;
	height: 25px;
	border: 1px solid rgba(133, 216, 253, 0.5);
	border-radius: 5px;
	background: rgba(130, 211, 249, 0.15);
	position: relative;
}

.hff-terms-agree__input:focus-visible + .hff-terms-agree__box {
	outline: 2px solid var(--hff-terms-blue);
	outline-offset: 2px;
}

.hff-terms-agree__input:checked + .hff-terms-agree__box {
	background: rgba(133, 216, 253, 0.35);
	border-color: var(--hff-terms-blue);
}

.hff-terms-agree__input:checked + .hff-terms-agree__box::after {
	content: "";
	position: absolute;
	left: 7px;
	top: 3px;
	width: 6px;
	height: 12px;
	border: solid var(--hff-terms-blue);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.hff-terms-agree__text {
	flex: 1 1 auto;
}

.hff-terms-agree__link {
	color: var(--hff-terms-gold);
	text-decoration: underline;
	text-underline-offset: 0.15em;
	font-weight: 600;
}

.hff-terms-agree__link:hover {
	color: #e0b52a;
}

.hff-terms-agree__error {
	margin: -0.5rem 0 0;
	color: #ffb4b4;
	font-size: 0.95rem;
	line-height: 1.4;
}

.hff-terms-agree__btn {
	display: inline-flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 56px;
	padding: 0 1.625rem;
	border-radius: 7px;
	background: var(--hff-terms-gold);
	color: var(--hff-terms-ink);
	font-family: Montserrat, "Segoe UI", sans-serif;
	font-weight: 700;
	font-size: 1.25rem;
	line-height: 1.2;
	text-decoration: none;
	transition: filter 0.15s ease, transform 0.15s ease;
}

.hff-terms-agree__btn:hover {
	filter: brightness(1.06);
	color: var(--hff-terms-ink);
}

.hff-terms-agree__btn.is-disabled,
.hff-terms-agree__btn[aria-disabled="true"] {
	opacity: 0.55;
	cursor: not-allowed;
	filter: none;
}

.hff-terms-agree__btn-arrow {
	font-weight: 700;
	line-height: 1;
}

/* Form Flow checkbox field named terms_agree */
.hff-flow__field--terms-agree {
	margin-top: 0.25rem;
}

.hff-flow__field--terms-agree > .hff-flow__label,
.hff-flow__field--terms-agree legend.hff-flow__label {
	display: none;
}

.hff-flow__field--terms-agree .hff-flow__check-option {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	margin: 0;
	cursor: pointer;
	color: #ffffff;
	font-family: Montserrat, "Segoe UI", sans-serif;
	font-weight: 500;
	font-size: 1.05rem;
	line-height: 1.6;
}

.hff-flow__field--terms-agree .hff-flow__check-box {
	box-sizing: border-box;
	flex: none;
	width: 25px;
	height: 25px;
	border: 1px solid rgba(133, 216, 253, 0.5);
	border-radius: 5px;
	background: rgba(130, 211, 249, 0.15);
	position: relative;
}

.hff-flow__field--terms-agree .hff-flow__check-input:checked + .hff-flow__check-box {
	background: rgba(133, 216, 253, 0.35);
	border-color: #85d8fd;
}

.hff-flow__field--terms-agree .hff-flow__check-input:checked + .hff-flow__check-box::after {
	content: "";
	position: absolute;
	left: 7px;
	top: 3px;
	width: 6px;
	height: 12px;
	border: solid #85d8fd;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.hff-flow__field--terms-agree .hff-flow__check-label a,
.hff-flow__field--terms-agree .hff-terms-agree__link {
	color: #ca9b17;
	text-decoration: underline;
	text-underline-offset: 0.15em;
	font-weight: 600;
}

.hff-theme-american-concealed .hff-flow__field--terms-agree .hff-flow__check-option {
	background: transparent !important;
	border: 0 !important;
	padding: 0 !important;
	box-shadow: none !important;
	border-radius: 0 !important;
}

.hff-theme-american-concealed .hff-flow__field--terms-agree .hff-flow__check-input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

@media (max-width: 640px) {
	.hff-terms-agree__row {
		font-size: 1.05rem;
		align-items: flex-start;
	}

	.hff-terms-agree__btn {
		width: 100%;
		font-size: 1.1rem;
	}
}
