/**
 * XRPay Checkout Styles
 *
 * Provides minimal, clean styling for the XRPay payment method at checkout,
 * thank-you page status boxes, and admin pages.
 *
 * @package XRPay_WooCommerce
 * @since   1.0.0
 */

/* Payment method icon styling */
li.payment_method_xrpay img {
	max-height: 24px;
	width: auto;
	margin-left: 8px;
	vertical-align: middle;
	display: inline-block;
}

/* Thank you page polling status box */
#xrpay-payment-status {
	margin: 20px 0;
	padding: 16px 20px;
	border-radius: 8px;
	font-family: inherit;
	font-weight: 500;
	font-size: 15px;
	line-height: 1.5;
}

.xrpay-status {
	margin: 0;
	padding: 12px 16px;
	border-radius: 6px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.xrpay-status--pending {
	background-color: #F3F4F6;
	color: #374151;
	border: 1px solid #E5E7EB;
}

.xrpay-status--confirmed {
	background-color: #ECFDF5;
	color: #065F46;
	border: 1px solid #A7F3D0;
}

.xrpay-status--failed {
	background-color: #FEF2F2;
	color: #991B1B;
	border: 1px solid #FCA5A5;
}

.xrpay-status--timeout {
	background-color: #FFFBEB;
	color: #92400E;
	border: 1px solid #FDE68A;
}

/* Admin branding tweaks */
.xrpay-admin-header {
	background-color: #0052FF !important;
}

.xrpay-admin-header h2 {
	font-weight: 700;
	letter-spacing: -0.02em;
}

/* Subscription content restriction state */
.xrpay-gate {
	--xrpay-gate-accent: #0758f7;
	--xrpay-gate-accent: oklch(56% 0.24 259);
	--xrpay-gate-accent-deep: #0846c7;
	--xrpay-gate-accent-deep: oklch(47% 0.21 259);
	--xrpay-gate-ink: #101a31;
	--xrpay-gate-ink: oklch(24% 0.045 260);
	--xrpay-gate-muted: #52617b;
	--xrpay-gate-muted: oklch(48% 0.038 260);
	--xrpay-gate-surface: #f4f7fd;
	--xrpay-gate-surface: oklch(97% 0.018 259);
	--xrpay-gate-line: #ccd7eb;
	--xrpay-gate-line: oklch(86% 0.035 259);
	container: xrpay-gate / inline-size;
	position: relative;
	isolation: isolate;
	margin: clamp(2rem, 6vw, 4.5rem) 0;
	padding: clamp(1.5rem, 4.5vw, 3.5rem);
	overflow: hidden;
	border-block: 1px solid var(--xrpay-gate-line);
	background: var(--xrpay-gate-surface);
	color: var(--xrpay-gate-ink);
	font-family: inherit;
	font-kerning: normal;
	animation: xrpay-gate-enter 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.xrpay-gate__rule {
	position: relative;
	height: 2px;
	margin-bottom: clamp(1.25rem, 4vw, 2.25rem);
	background: var(--xrpay-gate-line);
}

.xrpay-gate__rule span {
	position: absolute;
	inset: -1px auto -1px 0;
	width: clamp(3.5rem, 14cqi, 8rem);
	background: var(--xrpay-gate-accent);
}

.xrpay-gate__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	margin-bottom: clamp(1.5rem, 5vw, 2.75rem);
	color: var(--xrpay-gate-accent-deep);
	font-size: 0.75rem;
	font-weight: 760;
	line-height: 1.25;
	letter-spacing: 0.105em;
	text-transform: uppercase;
}

.xrpay-gate__meta span:last-child {
	color: var(--xrpay-gate-muted);
}

.xrpay-gate__layout {
	display: grid;
	gap: 2rem;
}

.xrpay-gate__copy {
	max-width: 48rem;
}

.xrpay-gate .xrpay-gate__title {
	max-width: 18ch;
	margin: 0;
	color: var(--xrpay-gate-ink);
	font-family: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
	font-size: clamp(2rem, 9cqi, 3.4rem);
	font-weight: 560;
	line-height: 0.98;
	letter-spacing: -0.035em;
	text-wrap: balance;
}

.xrpay-gate .xrpay-gate__message {
	max-width: 52ch;
	margin: 1.25rem 0 0;
	color: var(--xrpay-gate-muted);
	font-size: 1rem;
	line-height: 1.55;
}

.xrpay-gate .xrpay-gate__eligibility {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.4rem 0.65rem;
	max-width: 52ch;
	margin: 1.5rem 0 0;
	padding-top: 1rem;
	border-top: 1px solid var(--xrpay-gate-line);
	color: var(--xrpay-gate-ink);
	font-size: 0.875rem;
	line-height: 1.5;
}

.xrpay-gate__eligibility > span:first-child {
	color: var(--xrpay-gate-muted);
}

.xrpay-gate__eligibility strong {
	font-weight: 730;
}

.xrpay-gate__or,
.xrpay-gate__more {
	color: var(--xrpay-gate-muted);
	font-weight: 500;
}

.xrpay-gate__actions {
	display: grid;
	align-content: end;
	gap: 0.35rem;
}

.xrpay-gate__primary,
.xrpay-gate__primary:visited {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 3.25rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--xrpay-gate-accent);
	border-radius: 0.25rem;
	background: var(--xrpay-gate-accent);
	color: #f8faff;
	color: oklch(98% 0.008 259);
	font-size: 0.9375rem;
	font-weight: 720;
	line-height: 1.25;
	text-decoration: none;
	transition: transform 140ms cubic-bezier(0.25, 1, 0.5, 1), background-color 140ms cubic-bezier(0.25, 1, 0.5, 1), border-color 140ms cubic-bezier(0.25, 1, 0.5, 1);
}

.xrpay-gate__primary > span:last-child {
	font-size: 1.25rem;
	font-weight: 450;
	line-height: 1;
}

.xrpay-gate__secondary,
.xrpay-gate__secondary:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0.5rem;
	color: var(--xrpay-gate-accent-deep);
	font-size: 0.875rem;
	font-weight: 650;
	line-height: 1.3;
	text-align: center;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.xrpay-gate__primary:focus-visible,
.xrpay-gate__secondary:focus-visible {
	outline: 3px solid color-mix(in oklch, var(--xrpay-gate-accent) 35%, transparent);
	outline-offset: 3px;
}

.xrpay-gate .xrpay-gate__state {
	position: relative;
	margin: clamp(1.75rem, 5vw, 3rem) 0 0;
	padding: 1rem 0 0 1.25rem;
	border-top: 1px solid var(--xrpay-gate-line);
	color: var(--xrpay-gate-muted);
	font-size: 0.8125rem;
	line-height: 1.5;
}

.xrpay-gate__state::before {
	position: absolute;
	top: 1.45rem;
	left: 0;
	width: 0.4rem;
	height: 0.4rem;
	border-radius: 50%;
	background: var(--xrpay-gate-accent);
	content: "";
}

@container xrpay-gate (min-width: 40rem) {
	.xrpay-gate__layout {
		grid-template-columns: minmax(0, 1fr) minmax(15rem, 18rem);
		align-items: end;
		gap: clamp(3rem, 8cqi, 6rem);
	}

	.xrpay-gate__actions {
		padding-bottom: 0.15rem;
	}

	.xrpay-gate .xrpay-gate__title {
		font-size: clamp(2.5rem, 6cqi, 4rem);
	}
}

@media (hover: hover) and (pointer: fine) {
	.xrpay-gate__primary:hover {
		transform: translateY(-2px);
		border-color: var(--xrpay-gate-accent-deep);
		background: var(--xrpay-gate-accent-deep);
		color: #f8faff;
	}

	.xrpay-gate__secondary:hover {
		color: var(--xrpay-gate-ink);
	}
}

.xrpay-gate__primary:active {
	transform: translateY(1px);
}

@keyframes xrpay-gate-enter {
	from {
		opacity: 0;
		transform: translateY(0.75rem);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.xrpay-gate {
		animation: none;
	}

	.xrpay-gate__primary,
	.xrpay-gate__secondary {
		transition-duration: 0.01ms;
	}
}
