/**
 * MDS — /login/ page
 * Inline TRX login popup card + PMPro reset shell.
 */

/* ── Page chrome (center like tools / guest-gate) ──────────────────────── */

.mds-login-page .page_content_wrap {
	width: 100%;
	min-height: calc(100dvh - var(--mds-header-height, 72px));
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
}

.mds-login-page .page_content_wrap > .content_wrap {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	/* stretch — NOT center: center + width:min(860px,100%) collapses the card to content */
	align-items: stretch;
	width: 100%;
	max-width: none;
	padding-left: var(--mds-content-gutter, 20px);
	padding-right: var(--mds-content-gutter, 20px);
	box-sizing: border-box;
}

.mds-login-page .page_content_wrap .content_wrap > .content {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: stretch;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	float: none;
}

.mds-login-page .content .post_item,
.mds-login-page .content article,
.mds-login-page .content .post_content,
.mds-login-page .content .page_content {
	display: block;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	float: none;
}

/*
 * WP page content is an Elementor boxed section with a 50% column —
 * margin:auto on the card only centers inside that half-column (looks left).
 * Flatten Elementor chrome so the card can center in the full workspace.
 */
body.mds-login-page .elementor-15928,
body.mds-login-page .post_content > .elementor {
	width: 100%;
	max-width: none;
}

body.mds-login-page .elementor-section.elementor-top-section {
	width: 100%;
	max-width: none;
}

body.mds-login-page .elementor-section.elementor-section-boxed > .elementor-container {
	max-width: none !important;
	width: 100% !important;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: center;
	min-height: min(70vh, 640px);
}

body.mds-login-page .elementor-top-column,
body.mds-login-page .elementor-column.elementor-col-50,
body.mds-login-page .elementor-column.elementor-col-100 {
	width: 100% !important;
	max-width: 100% !important;
	flex: 0 0 auto !important;
}

body.mds-login-page .elementor-top-column > .elementor-widget-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	gap: 0;
}

body.mds-login-page .elementor-widget-spacer {
	display: none !important;
}

body.mds-login-page .elementor-widget-shortcode,
body.mds-login-page .elementor-shortcode {
	width: 100%;
	max-width: 100%;
	display: flex;
	justify-content: center;
	box-sizing: border-box;
}

.mds-login-page .top_panel_title,
.mds-login-page .sc_layouts_title,
.mds-login-page .breadcrumbs,
.mds-login-page .page_title {
	display: none !important;
}

/* ── Inline auth card (#trx_addons_login_popup on /login/) ─────────────── */

body.mds-login-page #trx_addons_login_popup.mds-login-page__card {
	display: block;
	position: relative;
	/* Fixed px + max-width:% — never min(860px,100%) inside flex (cyclic % → strip) */
	width: 860px;
	max-width: 100%;
	margin: clamp(24px, 5vh, 48px) auto;
	padding: 0;
	flex-shrink: 0;
	box-sizing: border-box;
	left: auto;
	right: auto;
	transform: none;
	float: none;
}

body.mds-login-page #trx_addons_login_popup .mds-login-popup__shell {
	width: 100%;
	min-width: 0;
	min-height: 520px;
	max-height: none;
	box-sizing: border-box;
}

body.mds-login-page #trx_addons_login_popup .mds-login-popup__panel {
	display: flex;
	flex-direction: column;
	min-height: 520px;
	min-width: 240px;
}

body.mds-login-page #trx_addons_login_popup .mds-login-popup__visual {
	min-width: 180px;
}

body.mds-login-page #trx_addons_login_popup .trx_addons_tabs {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
}

/* Stable height Login ↔ Register — avoid panel jump */
body.mds-login-page #trx_addons_login_popup .trx_addons_tabs_content {
	flex: 1 1 auto;
	min-height: 360px;
	max-height: none;
	overflow-x: hidden;
	overflow-y: auto;
}

/* Header Sign In must not open a second Magnific overlay on /login/ */
body.mds-login-page .mfp-bg,
body.mds-login-page .mfp-wrap {
	display: none !important;
}

/* ── PMPro password-reset shell ────────────────────────────────────────── */

.mds-login-page .mds-login-page__card--reset {
	display: block;
	width: 860px;
	max-width: 100%;
	margin: clamp(24px, 5vh, 48px) auto;
	padding: 0;
	border: 1px solid var(--mds-border, var(--theme-color-bd_color));
	border-radius: 20px;
	overflow: hidden;
	background: var(--theme-color-bg_color);
	color: var(--theme-color-text);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
	box-sizing: border-box;
	flex-shrink: 0;
}

.mds-login-page .mds-login-page__card--reset .mds-login-popup__shell {
	width: 100%;
	min-height: min(520px, calc(100vh - 160px));
	max-height: none;
}

.mds-login-page .mds-login-page__tabs {
	display: flex;
	flex-wrap: nowrap;
	margin: 0;
	padding: 0;
	list-style: none;
	border-bottom: 1px solid var(--mds-border, var(--theme-color-bd_color));
	background: var(--theme-color-bg_color);
}

.mds-login-page .mds-login-page__tab {
	flex: 1 1 50%;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.mds-login-page .mds-login-page__tab-label {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: var(--mds-login-tab-height, 56px);
	padding: 0 12px;
	border: none;
	border-bottom: 3px solid var(--theme-color-text_link);
	margin-bottom: -2px;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.2;
	color: var(--theme-color-text_dark);
	background: var(--theme-color-bg_color);
	box-sizing: border-box;
}

.mds-login-page .mds-login-page__body {
	flex: 1 1 auto;
	min-height: 0;
	max-height: none;
	overflow: visible;
	box-sizing: border-box;
	padding: 24px 28px 28px;
}

.mds-login-page .pmpro_login_wrap,
.mds-login-page .pmpro_lost_password_wrap,
.mds-login-page .pmpro_reset_password_wrap {
	float: none;
	clear: both;
	display: block;
	max-width: none;
	margin: 0;
	padding: 0;
	background: transparent;
	border: none;
	border-radius: 0;
}

.mds-login-page .pmpro_login_wrap hr,
.mds-login-page .pmpro_lost_password_wrap hr {
	display: none;
}

.mds-login-page .pmpro_lost_password-instructions {
	margin: 0 0 16px;
	font-size: 0.9rem;
	line-height: 1.5;
	color: color-mix(in srgb, var(--theme-color-text) 78%, transparent);
}

.mds-login-page #lostpasswordform p,
.mds-login-page #resetpassform .pmpro_reset_password-field,
.mds-login-page .mds-login-page__form p {
	margin: 0 0 12px;
}

.mds-login-page #lostpasswordform label,
.mds-login-page #resetpassform label,
.mds-login-page .mds-login-page__form label {
	display: block;
	margin: 0 0 6px;
	font-size: 0.86rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--theme-color-text_dark);
}

.mds-login-page #lostpasswordform input[type="text"],
.mds-login-page #resetpassform input[type="password"],
.mds-login-page .mds-login-page__form input[type="text"],
.mds-login-page .mds-login-page__form input[type="password"],
.mds-login-page .mds-login-page__form input[type="email"] {
	width: 100%;
	height: 48px;
	padding: 0 16px !important;
	border: 1px solid var(--mds-border, var(--theme-color-bd_color));
	border-radius: var(--mds-radius-sm, 8px);
	background: var(--mds-bg-input, var(--theme-color-alter_bg_color));
	color: var(--theme-color-text_dark);
	font-size: 0.92rem;
	line-height: 1.3;
	box-sizing: border-box;
}

.mds-login-page #lostpasswordform input[type="submit"],
.mds-login-page #resetpassform input[type="submit"],
.mds-login-page .mds-login-page__form .login-submit input {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	padding: 12px 24px;
	border: none;
	border-radius: var(--mds-radius-pill, 999px);
	background: var(--theme-color-text_link);
	color: #fff;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
}

.mds-login-page .pmpro_message {
	margin: 0 0 16px;
	border-radius: var(--mds-radius-sm, 8px);
}

@media (max-width: 720px) {
	body.mds-login-page #trx_addons_login_popup.mds-login-page__card,
	.mds-login-page .mds-login-page__card--reset {
		width: 440px;
		max-width: 100%;
		border-radius: 16px;
		margin: 16px auto 24px;
	}

	body.mds-login-page #trx_addons_login_popup .mds-login-popup__shell,
	body.mds-login-page #trx_addons_login_popup .mds-login-popup__panel {
		min-height: 0;
	}

	body.mds-login-page #trx_addons_login_popup .trx_addons_tabs_content {
		min-height: 0;
	}

	body.mds-login-page #trx_addons_login_popup .mds-login-popup__visual,
	body.mds-login-page #trx_addons_login_popup .mds-login-popup__panel {
		min-width: 0;
	}
}

html.mds-light .mds-login-page .mds-login-page__card--reset,
html.mds-light body.mds-login-page #trx_addons_login_popup.mds-login-page__card {
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.14);
}
