/*
Terms modal — used by two callers that are never both present at once: the
checkout terms checkbox (woocommerce/checkout/terms.php) and the "قوانین
حریم‌خصوصی" link in the login modal's own rules line (inc/otp-login.php).
Both render the same markup (new_ubit_render_terms_modal() in
inc/woocommerce.php) and share one instance id, so this lives in its own
file rather than inside checkout.css, which only loads on the checkout
page — the login modal appears on every page for guests.
*/

.new-ubit-terms-trigger {
	color: var(--color-primary);
	text-decoration: underline;
	font: inherit;
	cursor: pointer;
}

.new-ubit-terms-modal {
	position: fixed;
	inset: 0;
	/* Must outrank #new-ubit-otp-modal (999999, assets/css/otp-login.css) --
	   this modal can now open from inside that one too (the login modal's
	   own "قوانین حریم‌خصوصی" link), and needs to layer on top of it, not
	   underneath. */
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-4);
	background: rgb(4 11 60 / 60%);
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--transition-base);
}

.new-ubit-terms-modal.is-open {
	opacity: 1;
	pointer-events: auto;
}

.new-ubit-terms-modal__backdrop {
	position: absolute;
	inset: 0;
}

.new-ubit-terms-modal__panel {
	position: relative;
	width: 100%;
	max-width: 640px;
	max-height: calc(100vh - 2 * var(--space-4));
	display: flex;
	flex-direction: column;
	background: var(--color-bg);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	transform: scale(0.96) translateY(8px);
	transition: transform var(--transition-base);
}

.new-ubit-terms-modal.is-open .new-ubit-terms-modal__panel {
	transform: scale(1) translateY(0);
}

.new-ubit-terms-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
	padding: var(--space-4) var(--space-5);
	border-bottom: 1px solid var(--color-border);
}

.new-ubit-terms-modal__header h2 {
	font-size: var(--text-lg);
	font-weight: var(--font-semibold);
}

.new-ubit-terms-modal__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: var(--radius-sm);
	color: var(--color-muted);
	flex-shrink: 0;
}

.new-ubit-terms-modal__close:hover {
	background: var(--color-surface);
	color: var(--color-ink);
}

.new-ubit-terms-modal__body {
	padding: var(--space-5);
	overflow-y: auto;
	font-size: var(--text-sm);
	line-height: var(--leading-normal);
}

@media (prefers-reduced-motion: reduce) {
	.new-ubit-terms-modal,
	.new-ubit-terms-modal__panel {
		transition: none;
	}
}
