/**
 * Verify box above the checkout form. Selectors start with .psuc-verify so
 * theme and CartFlows button/input styles don't leak in. Override the accent
 * with --psuc-accent on .psuc-verify.
 */
.psuc-verify {
	--psuc-accent: var(--ast-global-color-0, #4f46e5);
	--psuc-text: #111827;
	--psuc-muted: #4b5563;
	--psuc-border: #d1d5db;
	--psuc-radius: 4px;
	--psuc-error: #b91c1c;
	--psuc-success: #15803d;

	box-sizing: border-box;
	margin: 0 0 32px;
	padding: 20px;
	border: 1px solid #c7d2fe;
	border: 1px solid color-mix(in srgb, var(--psuc-accent) 30%, #fff);
	border-radius: 8px;
	background: #f5f7ff;
	background: color-mix(in srgb, var(--psuc-accent) 5%, #fff);
	color: var(--psuc-text);
	font-size: 15px;
	line-height: 1.5;
}

.psuc-verify *,
.psuc-verify *::before,
.psuc-verify *::after {
	box-sizing: border-box;
}

.psuc-verify p {
	margin: 0;
	padding: 0;
}

.psuc-verify--done {
	border-color: #bbf7d0;
	background: #f0fdf4;
}

/* Head: icon + title + text */
.psuc-verify__head {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.psuc-verify__icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #e0e7ff;
	background: color-mix(in srgb, var(--psuc-accent) 14%, #fff);
	color: var(--psuc-accent);
}

.psuc-verify--done .psuc-verify__icon {
	background: #dcfce7;
	color: var(--psuc-success);
}

.psuc-verify__icon svg {
	display: block;
}

.psuc-verify__intro {
	flex: 1 1 auto;
	min-width: 0;
}

.psuc-verify .psuc-verify__title {
	margin-bottom: 2px;
	color: var(--psuc-text);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
}

.psuc-verify .psuc-verify__text {
	color: var(--psuc-muted);
	overflow-wrap: anywhere;
}

.psuc-verify__text strong {
	color: var(--psuc-text);
	font-weight: 600;
}

/* Keep an email whole on one line; break it only when it can't fit at all. */
.psuc-verify__text strong {
	display: inline-block;
	max-width: 100%;
	overflow-wrap: anywhere;
}

.psuc-verify a,
.psuc-verify a:visited {
	color: var(--psuc-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Input + button row, lined up under the text */
.psuc-verify__row {
	display: flex;
	gap: 8px;
	margin-top: 16px;
	padding-left: 48px;
}

.psuc-verify .psuc-verify__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 48px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--psuc-border);
	border-radius: var(--psuc-radius);
	background: #fff;
	box-shadow: none;
	color: var(--psuc-text);
	font-size: 15px;
	line-height: normal;
}

.psuc-verify .psuc-verify__input:focus {
	border-color: var(--psuc-accent);
	outline: 2px solid color-mix(in srgb, var(--psuc-accent) 25%, transparent);
	outline-offset: 0;
}

.psuc-verify .psuc-verify__input[aria-invalid="true"] {
	border-color: var(--psuc-error);
}

.psuc-verify .psuc-verify__input--code {
	flex: 0 1 200px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 20px;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.3em;
	text-align: center;
}

.psuc-verify .psuc-verify__input--code::placeholder {
	color: #d1d5db;
	opacity: 1;
}

.psuc-verify .psuc-verify__button {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	height: 48px;
	min-width: 120px;
	margin: 0;
	padding: 0 20px;
	border: 0;
	border-radius: var(--psuc-radius);
	background: var(--psuc-accent);
	box-shadow: none;
	color: #fff;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-transform: none;
	white-space: nowrap;
}

.psuc-verify .psuc-verify__button:hover,
.psuc-verify .psuc-verify__button:focus {
	background: var(--psuc-accent);
	color: #fff;
	filter: brightness(0.92);
}

.psuc-verify .psuc-verify__button:focus-visible,
.psuc-verify .psuc-verify__link:focus-visible {
	outline: 2px solid var(--psuc-accent);
	outline-offset: 2px;
}

/* Busy: spinner in place of the label */
.psuc-verify .psuc-verify__button.is-busy {
	color: transparent;
	cursor: wait;
}

.psuc-verify .psuc-verify__button.is-busy::after {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 2px solid rgba(255, 255, 255, 0.45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: psuc-spin 0.7s linear infinite;
	content: "";
}

.psuc-verify .psuc-verify__link.is-busy {
	cursor: wait;
	opacity: 0.6;
}

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

/* Text-link buttons */
.psuc-verify .psuc-verify__link,
.psuc-verify .psuc-verify__link:hover,
.psuc-verify .psuc-verify__link:focus {
	display: inline;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: var(--psuc-accent);
	cursor: pointer;
	font: inherit;
	font-weight: 500;
	line-height: inherit;
	text-decoration: underline;
	text-transform: none;
	text-underline-offset: 2px;
}

.psuc-verify .psuc-verify__links {
	margin-top: 12px;
	padding-left: 48px;
	color: var(--psuc-muted);
	font-size: 14px;
}

.psuc-verify--done .psuc-verify__links {
	margin-top: 6px;
}

.psuc-verify__sep {
	margin: 0 8px;
	color: #9ca3af;
}

/* Message line under the row */
.psuc-verify .psuc-verify__message {
	margin: 12px 0 0 48px;
	padding: 10px 12px;
	border-left: 3px solid currentColor;
	border-radius: 0 var(--psuc-radius) var(--psuc-radius) 0;
	font-size: 14px;
}

.psuc-verify .psuc-verify__message[hidden] {
	display: none;
}

.psuc-verify .psuc-verify__message[data-type="error"] {
	background: #fef2f2;
	color: var(--psuc-error);
}

.psuc-verify .psuc-verify__message[data-type="success"] {
	background: #f0fdf4;
	color: var(--psuc-success);
}

.psuc-verify__message a {
	margin-left: 4px;
	color: inherit;
	font-weight: 600;
}

.psuc-verify__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

@media (max-width: 480px) {
	.psuc-verify {
		padding: 16px;
	}

	.psuc-verify__row {
		flex-direction: column;
		padding-left: 0;
	}

	.psuc-verify .psuc-verify__input--code {
		flex-basis: auto;
	}

	.psuc-verify .psuc-verify__button {
		width: 100%;
	}

	.psuc-verify__links > span {
		display: block;
	}

	.psuc-verify__links > span + span {
		margin-top: 6px;
	}

	.psuc-verify__links > .psuc-verify__sep {
		display: none;
	}

	.psuc-verify .psuc-verify__links,
	.psuc-verify .psuc-verify__message {
		margin-left: 0;
		padding-left: 0;
	}

	.psuc-verify .psuc-verify__message {
		padding-left: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.psuc-verify .psuc-verify__button.is-busy::after {
		animation-duration: 2s;
	}
}
