/*
 * cjpt-site: MemberPress login / reset password, member area (/account/) and ReadyLaunch checkout styles, ported from
 * the old Divi child theme's style.css. Needed only while MemberPress pages exist.
 *
 * Rewritten: the login-page rules were scoped to Divi's #main-content / .et-l--post; they now use the body class
 * cjpt-mp-auth (added on the MemberPress login page by cjpt-site) and the theme's main#content. The field icons and
 * checkbox tick used Divi's ETModules icon font (gone with Divi); they are inline SVG masks now.
 * Dropped: `.single-memberpressproduct .mp-billing-group label {display:none}` — MemberPress 1.14.1 renders those
 * labels as in-field placeholders (label.placeholder-text), so hiding them would leave the name and address fields
 * unlabeled.
 */

/* ---------------------------------------------------------------- Login and reset password (/login/) */
body.cjpt-mp-auth #content,
body.cjpt-mp-auth .elementor-location-single {
	max-width: none;
	margin: 0;
	padding: 100px 16px;
	background: rgb(217, 242, 20);
	background: linear-gradient(120deg, rgba(217, 242, 20, 1) 0%, rgba(7, 192, 212, 1) 80%);
	box-sizing: border-box;
}

/* The form carries its own "Login" / "Reset Password" heading; the theme's page title is not needed. */
body.cjpt-mp-auth #content > .page-header {
	display: none;
}

body.cjpt-mp-auth .mepr_error,
body.cjpt-mp-auth .mepr-login-errors {
	max-width: 380px;
	margin: 0 auto 20px;
	box-sizing: border-box;
}

.mp_wrapper.mp_login_form,
.mp_wrapper:has(#mepr_forgot_password_form) {
	max-width: 380px;
	background: #fff;
	margin: 0 auto;
	padding: 40px 40px 30px;
	box-sizing: border-box;
	font-family: 'Josefin Sans', Helvetica, Arial, Lucida, sans-serif;
	box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
}

.mp_wrapper.mp_login_form > h2,
.mp_wrapper:has(#mepr_forgot_password_form) > h2 {
	font-size: 32px;
	font-weight: bold;
	text-align: center;
	margin-bottom: 24px;
	padding: 0;
}

#mepr_forgot_password_form {
	margin-top: 50px;
}

.mp_wrapper.mp_login_form input[type=submit],
#mepr_forgot_password_form input[type=submit] {
	background: #07c0d4;
	border: none;
	padding: 14px;
	color: #fff;
	width: 100%;
	font-size: 20px;
	font-weight: bold;
	cursor: pointer;
}

.mp_wrapper.mp_login_form ::placeholder {
	font-weight: 600;
}

.mp_login_form .mp-form-row,
#mepr_forgot_password_form .mp-form-row {
	position: relative;
	margin-bottom: 15px;
}

/* Labels hidden visually (the fields have placeholders), still read by screen readers. */
.mp_wrapper.mp_login_form label:not(:has(input[type=checkbox])),
#mepr_forgot_password_form label:not(:has(input[type=checkbox])) {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Field icons (were ETModules glyphs \e010 person and \7e lock). */
.mp_login_form .mp-form-row.mepr_username::before,
.mepr_forgot_password_input::before,
.mp_login_form .mp-form-row.mepr_password::before {
	content: '';
	position: absolute;
	left: 15px;
	top: 0;
	bottom: 0;
	margin: auto;
	width: 18px;
	height: 18px;
	z-index: 10;
	background-color: #3e3e3c;
	-webkit-mask: var(--cjpt-mp-icon) center / contain no-repeat;
	mask: var(--cjpt-mp-icon) center / contain no-repeat;
	pointer-events: none;
}

.mp_login_form .mp-form-row.mepr_username::before,
.mepr_forgot_password_input::before {
	--cjpt-mp-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512H418.3c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304H178.3z'/%3E%3C/svg%3E");
}

.mp_login_form .mp-form-row.mepr_password::before {
	--cjpt-mp-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M144 144v48H304V144c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192V144C80 64.5 144.5 0 224 0s144 64.5 144 144v48h16c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V256c0-35.3 28.7-64 64-64H80z'/%3E%3C/svg%3E");
}

.mp_login_form label:has(#rememberme) {
	margin-bottom: 15px;
	font-weight: 600;
	cursor: pointer;
	display: inline-block;
	width: auto !important;
}

.mp_login_form input#rememberme {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	border: 2px solid #56c6d6;
	border-radius: 0;
	margin: 0;
	padding: 0;
	vertical-align: sub;
	position: relative;
	cursor: pointer;
}

/* Tick (was ETModules \4e). */
.mp_login_form input#rememberme:checked {
	background: #56c6d6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round' d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
}

.mp_login_form input[type=text],
.mp_login_form input[type=password],
#mepr_forgot_password_form input[type=text],
#mepr_forgot_password_form input[type=password] {
	width: 100%;
	box-sizing: border-box;
	background: #e6e6e6;
	border: none !important;
	padding: 15px 15px 15px 50px !important;
}

.mp_login_form .mepr-login-actions {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;
}

.mp_login_form .mepr-login-actions a {
	color: #56c6d6;
	text-align: center;
	display: block;
	margin-bottom: 10px;
	font-weight: 800;
}

.mp_login_form .mepr-login-actions a:last-child {
	margin: 0;
}

.mp_login_form .submit {
	margin-bottom: 20px;
}

/* "Successfully requested password reset" confirmation (/login/?action=forgot_password after submitting), from Divi
 * Theme Options > Custom CSS (was scoped to .page-id-2614 #main-content). */
body.cjpt-mp-auth .mp_wrapper.mepr_password_reset_requested {
	max-width: 380px;
	background: #fff;
	margin: 0 auto;
	padding: 47px 37px 54px;
	box-sizing: border-box;
	font-family: 'Josefin Sans', Helvetica, Arial, Lucida, sans-serif;
	box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
}

body.cjpt-mp-auth .mp_wrapper.mepr_password_reset_requested h3 {
	margin-top: 0;
	font-family: inherit;
	font-weight: bold;
	text-transform: uppercase;
	color: #4bcea5;
	font-size: 33px;
	line-height: 41px;
}

body.cjpt-mp-auth .mp_wrapper.mepr_password_reset_requested p {
	margin-bottom: 0;
	color: #000;
	font-size: 21px;
}

@media screen and (max-width: 767px) {
	body.cjpt-mp-auth .mp_wrapper.mepr_password_reset_requested h3 {
		font-size: 27px;
		line-height: 29px;
	}
}

@media screen and (max-width: 400px) {
	.mp_wrapper.mp_login_form,
	.mp_wrapper:has(#mepr_forgot_password_form),
	body.cjpt-mp-auth .mp_wrapper.mepr_password_reset_requested {
		max-width: 300px;
		padding: 30px;
	}
}

/* ---------------------------------------------------------------- ReadyLaunch checkout (/register/...) */
/* On the old site Divi's global styles (Customizer: Open Sans body text, Josefin Sans headings, its reset of margins and
 * padding) reached these pages; ReadyLaunch drops every stylesheet but its own, so they are restated here. Every rule is
 * prefixed with "body" so it outranks MemberPress's checkout.css, which loads after this file (the child theme won these
 * ties by load order; e.g. the Order Summary box lost its padding and the price grew to 2rem). The first block applies to
 * every ReadyLaunch page (body.mepr-app-layout: checkout and /thank-you/), the rest to the checkout only. */
body.mepr-app-layout,
body.mepr-app-layout input,
body.mepr-app-layout textarea,
body.mepr-app-layout select {
	font-family: 'Open Sans', Helvetica, Arial, Lucida, sans-serif;
}

body.mepr-app-layout {
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5em;
	color: #666;
}

body.mepr-app-layout h1,
body.mepr-app-layout h2,
body.mepr-app-layout h3,
body.mepr-app-layout h4,
body.mepr-app-layout h5,
body.mepr-app-layout h6 {
	font-family: 'Josefin Sans', Helvetica, Arial, Lucida, sans-serif;
	line-height: 1.1em;
	padding-bottom: 10px;
	margin: 0;
	color: #333;
}

body.mepr-app-layout h2 {
	font-size: 27px;
}

/* The membership's own page text above the checkout (the Facebook offer page has an image and a paragraph there). */
body.mepr-app-layout .site-main > p {
	margin: 0;
	padding-bottom: 1em;
}

body.mepr-app-layout .site-main > p:last-of-type {
	padding-bottom: 0;
}

body.mepr-app-layout .aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

/* ReadyLaunch fixes html and body at the window height, so the gradient (painted over the whole canvas from html's box)
 * restarted below the fold; let them grow with the page. */
html:has(body.single-memberpressproduct) {
	height: auto;
	min-height: 100%;
}

body.single-memberpressproduct {
	height: auto;
	min-height: 100%;
	background: rgb(217, 242, 20);
	background: linear-gradient(120deg, rgba(217, 242, 20, 1) 0%, rgba(7, 192, 212, 1) 80%);
}

body.single-memberpressproduct .site-header {
	padding-top: 50px;
	padding-bottom: 20px;
	justify-content: center;
}

body.single-memberpressproduct h1 {
	text-align: center;
	font-size: 54px;
	font-weight: bold;
	margin: 50px 0 20px;
	color: #000;
}

body.single-memberpressproduct h2 {
	font-weight: bolder;
}

body.single-memberpressproduct h3 {
	font-weight: bold;
	padding-bottom: 0;
	font-size: 22px;
	margin-bottom: 20px;
}

body.single-memberpressproduct .mp-signup-group h3 {
	margin-bottom: 0;
}

body.single-memberpressproduct .invoice-wrapper {
	background: #fff;
	align-self: baseline;
	margin: 0 50px;
	padding: 30px !important;
	box-sizing: border-box;
	box-shadow: rgb(71 71 71 / 39%) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
	max-width: 400px;
}

body.single-memberpressproduct .invoice-wrapper .invoice-amount {
	font-size: 1.2rem;
	font-weight: 600;
}

/* Divi's "p { padding-bottom: 1em }" still shows in the order summary's line item name. */
body.single-memberpressproduct .mp-cart-item-details p:not(.desc) {
	padding-bottom: 1em;
}

body.single-memberpressproduct .mp-form-login-here {
	color: #000;
	font-weight: 600;
	font-family: 'Josefin Sans', Helvetica, Arial, Lucida, sans-serif;
	margin: 0 0 10px;
}

body.single-memberpressproduct .mp-form-row.mp-signup-group,
body.single-memberpressproduct .mp-billing-group,
body.single-memberpressproduct .mp-payment-group {
	background: #fff;
	padding: 20px;
	margin: 0 0 30px 0;
	max-width: 400px;
	box-shadow: rgb(71 71 71 / 39%) 0px 20px 60px -30px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
}

body.single-memberpressproduct .mp-form-row.mp-address-group {
	margin-bottom: 0;
}

body.single-memberpressproduct a {
	color: #07c0d4;
}

body.single-memberpressproduct .mepr-checkout-container input.mepr-submit,
body.single-memberpressproduct #validate-email {
	background: #07c0d4;
	color: #fff;
	font-family: 'Josefin Sans', Helvetica, Arial, Lucida, sans-serif;
	font-size: 18px;
	font-weight: bold;
	border-radius: 0;
	padding: 0.75rem;
	width: 100%;
	border: none;
	cursor: pointer;
}

body.single-memberpressproduct #validate-email[disabled] {
	opacity: 0.6;
	cursor: wait;
}

body.single-memberpressproduct .form-wrapper {
	padding-top: 0;
	padding-left: 50px;
	border-left-color: #fff;
}

body.single-memberpressproduct .mepr-checkout-container .invoice-wrapper .mepr_price {
	margin-bottom: 10px;
}

body.single-memberpressproduct .mepr-payment-methods-icons,
body.single-memberpressproduct .mepr-payment-methods-radios {
	display: none;
}

body.single-memberpressproduct:not(.submitted) .mp-form-row:not(.mepr_coupon) .cc-error {
	display: none !important;
}

body.single-memberpressproduct .mp-form-row #user_email1 + span.cc-error.email-exists {
	display: block !important;
}

body.single-memberpressproduct .mepr-invoice-loader {
	display: none !important;
}

body.single-memberpressproduct:not(.submitted) input.invalid {
	border: 1px solid #ced4da !important;
	background-color: #fff !important;
}

/* Two-step checkout: billing and payment appear once the account exists (the visitor is then logged in). On the old site the
 * terms box, spacer and "Complete Purchase" button sat inside the payment box and so stayed hidden with it; in the rebased
 * form.php they follow it, so they are hidden here too. */
body.single-memberpressproduct:not(.logged-in) .mp-billing-group,
body.single-memberpressproduct:not(.logged-in) .mp-payment-group,
body.single-memberpressproduct:not(.logged-in) .mepr_tos,
body.single-memberpressproduct:not(.logged-in) .mepr_spacer,
body.single-memberpressproduct:not(.logged-in) .mp-form-submit {
	display: none;
}

body.single-memberpressproduct .mp-form-submit {
	max-width: 400px;
}

body.single-memberpressproduct .mp-signup-validate-group {
	max-width: 400px;
	margin: 20px 0 0;
}

.mepr-form-input.searching {
	background-image: url(/wp-admin/images/loading.gif) !important;
	background-size: 15px !important;
	background-position: 93%;
	background-repeat: no-repeat;
}

@media screen and (max-width: 768px) {
	body.single-memberpressproduct .invoice-wrapper {
		margin-bottom: 30px;
		border-bottom: none;
	}
}

/* ---------------------------------------------------------------- Member area (/account/, ReadyLaunch) */
.mepr-downloads a::before {
	content: '' !important;
	background-image: url('/wp-content/uploads/2024/02/Downloads-Icon.png');
	height: 26px;
	display: block;
	width: 26px !important;
	z-index: 1111111;
	background-size: cover;
	filter: contrast(10) brightness(10);
}

.mepr-downloads.mepr-active-nav-tab a::before,
.mepr-account.mepr-active-nav-tab a::before {
	filter: brightness(0) invert(1);
}

.mepr-account a::before {
	content: '' !important;
	background-image: url('/wp-content/uploads/2024/02/Account-Settings-Icon.png');
	height: 34px;
	display: block;
	width: 30px !important;
	z-index: 1111111;
	background-size: cover;
	filter: contrast(10) brightness(10);
	margin-left: -4px;
}

.site-header .site-branding__logo {
	max-height: 25px;
	width: auto;
}

.site-header .profile-menu__hamburger {
	color: #000;
}

.mepr-account-container .mepr_page_header {
	font-weight: bold;
}

header.account-header {
	border-bottom: 1px solid #ddd;
	padding-bottom: 0;
}

.mepr-account-container {
	background: #efefef;
}

.mepr-account-container #mepr-account-nav {
	border-right: 1px solid #ddd;
}

.mepr-the-runners-zone-wrapper .mepr-account-message {
	background: #f9e2d9;
	border: 2px solid #d76856;
}

ul#mepr_account_runners_zone_submenu {
	list-style: none;
	margin: 0;
}

ul#mepr_account_runners_zone_submenu li a {
	color: #000;
	margin-bottom: 5px;
	display: block;
}

ul#mepr_account_runners_zone_submenu li a::before {
	vertical-align: text-bottom;
	content: '\2192';
	color: #08c0d4 !important;
	margin-right: 10px;
}

@media (max-width: 768px) {
	.site-header .site-branding__logo {
		max-height: 18px;
	}

	.mepr-account-container {
		min-height: 0 !important;
	}

	.mepr-nav-item.mepr-active-nav-tab a {
		background: #7f7f7f !important;
	}

	.mepr-account-container #mepr-account-nav .mepr-nav-item a {
		justify-content: left;
		background: #efefef;
	}

	#mepr-account-content {
		background: #fff;
	}
}
