/**
 * Auth buttons and text actions — aligned with Site Identity primary color.
 *
 * @since 1.0.0
 */

.xgate-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 18px;
	border-radius: var(--xgate-radius-md, 12px);
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}

.xgate-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	filter: none;
}

.xgate-btn:focus-visible {
	outline: 2px solid var(--xgate-primary-color, #2563eb);
	outline-offset: 2px;
}

/* Important resists theme button/link rules; Elementor-skinned CTAs opt out via .xgate-btn--elementor-skin. */
.xgate-btn.xgate-btn--primary:not(.xgate-btn--elementor-skin) {
	background: var(--xgate-primary-color, #2563eb) !important;
	color: #fff !important;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
	border-color: transparent !important;
}

.xgate-btn.xgate-btn--primary:not(.xgate-btn--elementor-skin):hover:not(:disabled) {
	filter: brightness(1.06);
	box-shadow: 0 4px 14px var(--xgate-primary-glow, rgba(37, 99, 235, 0.35));
}

.xgate-btn.xgate-btn--primary:not(.xgate-btn--elementor-skin):active:not(:disabled) {
	filter: brightness(0.94);
}

/*
 * Elementor auth form: fallbacks use :where() so computed specificity is 0 — Elementor preview/post CSS
 * ({{WRAPPER}} + path) always wins for live style updates; these rules apply only when Elementor emits no value.
 */
:where(.xgate-block-ui--elementor-widget .xgate-inline-auth .xgate-auth-actions button.xgate-btn--primary.xgate-btn--elementor-skin) {
	background-color: var(--xgate-primary-color, #2563eb);
	color: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
	border-color: transparent !important;
}

:where(.xgate-block-ui--elementor-widget .xgate-inline-auth .xgate-auth-actions button.xgate-btn--primary.xgate-btn--elementor-skin):hover:not(:disabled),
:where(.xgate-block-ui--elementor-widget .xgate-inline-auth .xgate-auth-actions button.xgate-btn--primary.xgate-btn--elementor-skin):focus-visible:not(:disabled) {
	filter: none;
	box-shadow: 0 4px 14px var(--xgate-primary-glow, rgba(37, 99, 235, 0.35));
}

:where(.xgate-block-ui--elementor-widget .xgate-inline-auth .xgate-auth-actions button.xgate-btn--primary.xgate-btn--elementor-skin):active:not(:disabled) {
	filter: none;
}

.xgate-btn.xgate-btn--link {
	background: transparent;
	color: var(--xgate-primary-color, #2563eb) !important;
	border: 0;
	padding: 6px 2px;
	font-weight: 600;
	font-size: 0.875rem;
	border-radius: var(--xgate-radius-sm, 8px);
	text-decoration: none;
	box-shadow: none;
}

.xgate-btn--link:hover:not(:disabled) {
	text-decoration: underline;
	text-underline-offset: 3px;
	filter: none;
}

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

/* ------------------------------------------------------------------------- */
/* Gutenberg auth button block (wrapper .xgate-block-ui--button)             */
/* ------------------------------------------------------------------------- */
.xgate-block-ui--button-full .xgate-btn {
	width: 100%;
	justify-content: center;
}

.xgate-block-ui--button.xgate-ui--btn-radius .xgate-btn {
	border-radius: var(--xgate-scoped-btn-radius, var(--xgate-radius-md, 12px));
}

.xgate-block-ui--button.xgate-ui--btn-bg .xgate-btn.xgate-btn--primary {
	background: var(--xgate-scoped-btn-bg) !important;
}

.xgate-block-ui--button.xgate-ui--btn-color .xgate-btn.xgate-btn--primary {
	color: var(--xgate-scoped-btn-color) !important;
}

.xgate-block-ui--button.xgate-ui--accent .xgate-btn.xgate-btn--primary:focus-visible {
	outline-color: var(--xgate-primary-color, #2563eb);
}
