/**
 * Waffy Escrow — checkout redirect disclaimer modal.
 * Shared by the classic and Blocks checkout (see assets/js/waffy-disclaimer.js).
 */

/* Wordmark next to the payment method title — Gateway::get_icon() on the classic
   checkout, the Blocks label in blocks.js. Both are data-URI <img>s already
   sized by width/height attributes, so these rules only settle alignment
   against whatever the active theme does to gateway icons. */
.waffy-gateway-icon,
.waffy-blocks-icon {
	display: inline-block;
	width: auto;
	max-height: 22px;
	margin: 0 0.5rem;
	vertical-align: middle;
}

.waffy-blocks-label {
	display: inline-flex;
	align-items: center;
}

.waffy-disclaimer-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: rgba(15, 23, 42, 0.55);
}

.waffy-disclaimer {
	box-sizing: border-box;
	width: 100%;
	max-width: 30rem;
	padding: 1.75rem;
	background: #ffffff;
	border-radius: 0.75rem;
	box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
	font-family: inherit;
}

.waffy-disclaimer__title {
	margin: 0 0 0.75rem;
	font-size: 1.25rem;
	font-weight: 600;
	color: #0D44AD;
}

.waffy-disclaimer__body {
	margin: 0 0 1.5rem;
	line-height: 1.6;
	font-size: 0.95rem;
	color: #333333;
}

/* ── Live checkout progress ───────────────────────────────────────────────────
   The bar shows everywhere; the step list is rendered only in sandbox mode
   (see buildProgress() in assets/js/waffy-disclaimer.js). */

.waffy-progress {
	margin: 0 0 1.5rem;
}

.waffy-progress__track {
	position: relative;
	height: 0.5rem;
	overflow: hidden;
	background: #e8edf6;
	border-radius: 999px;
}

.waffy-progress__fill {
	width: 0;
	height: 100%;
	background: #0D44AD;
	border-radius: inherit;
	transition: width 0.35s ease;
}

.waffy-progress__percent {
	display: block;
	margin-top: 0.4rem;
	font-size: 0.8rem;
	font-weight: 600;
	color: #0D44AD;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.waffy-progress__note {
	margin: 0.9rem 0 0.4rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #8a94a6;
}

.waffy-progress__steps {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.85rem;
}

.waffy-progress__step {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.28rem 0;
	color: #8a94a6;
	transition: color 0.2s ease;
}

/* The marker doubles as checkbox, spinner and cross — one element, four states,
   so rows never reflow as their status changes. */
.waffy-progress__mark {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.05rem;
	height: 1.05rem;
	border: 2px solid #d4dae6;
	border-radius: 50%;
	font-size: 0.7rem;
	line-height: 1;
}

.waffy-progress__label {
	flex: 1 1 auto;
}

.waffy-progress__timing {
	flex: 0 0 auto;
	font-size: 0.75rem;
	font-variant-numeric: tabular-nums;
	color: #a3abb9;
}

.waffy-progress__step.is-running {
	color: #0D44AD;
	font-weight: 600;
}

.waffy-progress__step.is-running .waffy-progress__mark {
	border-color: #c3d0ea;
	border-top-color: #0D44AD;
	animation: waffy-spin 0.7s linear infinite;
}

.waffy-progress__step.is-done,
.waffy-progress__step.is-cached {
	color: #1f2937;
}

.waffy-progress__step.is-done .waffy-progress__mark,
.waffy-progress__step.is-cached .waffy-progress__mark {
	border-color: #16a34a;
	background: #16a34a;
	color: #ffffff;
}

.waffy-progress__step.is-done .waffy-progress__mark::before,
.waffy-progress__step.is-cached .waffy-progress__mark::before {
	content: '✓';
}

/* A cached step is a call that never happened — worth showing as satisfied but
   visually distinct from one we actually made. */
.waffy-progress__step.is-cached .waffy-progress__mark {
	border-color: #94a3b8;
	background: #94a3b8;
}

.waffy-progress__step.is-cached .waffy-progress__timing {
	font-style: italic;
}

.waffy-progress__step.is-failed {
	color: #b91c1c;
}

.waffy-progress__step.is-failed .waffy-progress__mark {
	border-color: #b91c1c;
	background: #b91c1c;
	color: #ffffff;
}

.waffy-progress__step.is-failed .waffy-progress__mark::before {
	content: '✕';
}

@media (prefers-reduced-motion: reduce) {
	.waffy-progress__fill {
		transition: none;
	}

	.waffy-progress__step.is-running .waffy-progress__mark {
		animation: none;
	}
}

.waffy-disclaimer__actions {
	display: flex;
	justify-content: flex-end;
}

.waffy-disclaimer__btn {
	height: 2.75rem;
	padding: 0 1.5rem;
	border: 0;
	border-radius: 0.5rem;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
}

.waffy-disclaimer__btn--confirm {
	position: relative;
	background: #0D44AD;
	color: #ffffff;
}

.waffy-disclaimer__btn--confirm:hover,
.waffy-disclaimer__btn--confirm:focus {
	background: #3972dc;
}

/* Loading state: text hidden, centred spinner, kept visible while the payment
   link loads so the buyer can read the notice. */
.waffy-disclaimer__btn--confirm.is-loading {
	color: transparent;
	pointer-events: none;
}

.waffy-disclaimer__btn--confirm.is-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 1.1rem;
	height: 1.1rem;
	margin: -0.55rem 0 0 -0.55rem;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: waffy-spin 0.7s linear infinite;
}

@keyframes waffy-spin {
	to {
		transform: rotate(360deg);
	}
}
