/**
 * Pabau Academy login modal.
 *
 * Styles the LearnDash LD30 login modal (child override learndash/ld30/modules/login-modal.php).
 * LearnDash moves .learndash-wrapper-login-modal to the top of <body> and toggles .ld-modal-open /
 * .ld-modal-closed on it; here that wrapper becomes a full-screen backdrop and #ld-login-modal a
 * two-column card: the login form on white, and a "New to the Academy?" panel in the homepage CTA
 * gradient (pabau-home.css .ph-cta__band).
 *
 * Selectors start at #ld-login-modal, with !important where needed, to win over learndash.min.css,
 * LearnDash's inline colour CSS, the Customizer's Additional CSS and the pabau-brand-css snippet,
 * which all style this modal.
 *
 * Breakpoint: < 768px the card stacks into one column.
 */

@font-face {
	font-family: "Pabau DM Mono";
	src: url("../fonts/DMMono-Medium.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

.learndash-wrapper-login-modal {
	--pa-font: "Pabau Satoshi", "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--pa-mono: "Pabau DM Mono", "DM Mono", ui-monospace, monospace;
	--pa-neutral-0: #ffffff;
	--pa-neutral-50: #f5f7fa;
	--pa-neutral-200: #d7dde7;
	--pa-neutral-300: #b8c0cd;
	--pa-neutral-600: #4e5768;
	--pa-neutral-800: #1f2a40;
	--pa-neutral-900: #121d36;
	--pa-ink: #1e1b18;
	--pa-blue: #037cd2;
	--pa-blue-hover: #0268b1;
	--pa-cyan: #a4e0f3;
	--pa-yellow: #ffd84d;
	--pa-yellow-hover: #ffcf26;
}

/* Lock the page behind the open modal (class set by pabau-login.js). */
html.pa-login-open {
	overflow: hidden;
}

/* ---------------------------------------------------------------------------
 * Backdrop and card
 * ------------------------------------------------------------------------ */

html body .learndash-wrapper.learndash-wrapper-login-modal.ld-modal-open {
	position: fixed;
	inset: 0;
	z-index: 100000; /* above the sticky header and the admin bar */
	display: flex;
	overflow-y: auto;
	overscroll-behavior: contain;
	margin: 0;
	padding: 40px 24px;
	background-color: rgba(10, 18, 38, 0.64);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	animation: pa-login-fade 0.2s ease-out;
}

html body #ld-login-modal.ld-modal {
	position: relative !important;
	inset: auto !important;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
	width: 100% !important;
	max-width: 960px !important;
	height: auto !important;
	min-height: 0 !important;
	margin: auto !important; /* centres in the backdrop, scrolls when taller than the screen */
	padding: 0 !important;
	overflow: hidden;
	border-radius: 24px;
	background: var(--pa-neutral-0) !important;
	box-shadow: 0 32px 80px -24px rgba(10, 18, 38, 0.55) !important;
	transform: none !important;
	transition: none;
	font-family: var(--pa-font);
	text-align: left;
	color: var(--pa-neutral-900);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	animation: pa-login-rise 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}

html body #ld-login-modal.ld-modal:not(.ld-can-register) {
	grid-template-columns: minmax(0, 1fr);
	max-width: 520px !important;
}

html body #ld-login-modal.ld-modal:focus {
	outline: none;
}

#ld-login-modal,
#ld-login-modal *,
#ld-login-modal *::before,
#ld-login-modal *::after {
	box-sizing: border-box;
}

@keyframes pa-login-fade {
	from {
		opacity: 0;
	}
}

@keyframes pa-login-rise {
	from {
		opacity: 0;
		translate: 0 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	html body .learndash-wrapper.learndash-wrapper-login-modal.ld-modal-open,
	html body #ld-login-modal.ld-modal {
		animation: none;
	}
}

/* Close button: LearnDash's icon-font glyph swapped for a drawn X. */

html body #ld-login-modal .ld-modal-closer {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 2;
	display: block;
	width: 40px;
	height: 40px;
	padding: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 5l10 10M15 5 5 15' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / 18px no-repeat;
	font-size: 0;
	line-height: 0;
	color: transparent;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

html body #ld-login-modal .ld-modal-closer::before {
	content: none !important;
	display: none !important;
}

html body #ld-login-modal .ld-modal-closer:hover {
	background-color: rgba(255, 255, 255, 0.22);
}

html body #ld-login-modal .ld-modal-closer:focus-visible {
	outline: 2px solid var(--pa-neutral-0);
	outline-offset: 2px;
}

/* On white (stacked layout, or no register panel) the X goes dark. */
html body #ld-login-modal.ld-modal:not(.ld-can-register) .ld-modal-closer {
	background-color: var(--pa-neutral-50);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 5l10 10M15 5 5 15' stroke='%23121d36' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------------------
 * Login column
 * ------------------------------------------------------------------------ */

html body #ld-login-modal .ld-login-modal-login {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 48px 56px 44px;
	background: var(--pa-neutral-0);
}

html body #ld-login-modal .ld-login-modal-wrapper {
	width: 100%;
	min-width: 0;
	max-width: none;
	margin: 0;
	padding: 0;
}

html body #ld-login-modal .pa-login__brand {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 32px;
}

html body #ld-login-modal .pa-login__brand img {
	display: block;
	width: auto;
	max-width: none;
	height: 27px;
}

html body #ld-login-modal .pa-login__brand-divider {
	flex-shrink: 0;
	width: 1px;
	height: 14px;
	background-color: var(--pa-ink);
	opacity: 0.6;
}

html body #ld-login-modal .pa-login__brand-label {
	position: relative;
	top: 2px;
	font-size: 10px;
	font-weight: 500;
	line-height: normal;
	letter-spacing: 1px;
	text-transform: uppercase;
	white-space: nowrap;
	color: var(--pa-ink);
}

html body #ld-login-modal .ld-modal-heading {
	margin: 0;
	font-family: var(--pa-font);
	font-size: 32px;
	font-weight: 700;
	line-height: 40px;
	letter-spacing: -0.64px;
	text-align: left;
	color: var(--pa-neutral-900) !important; /* LearnDash's inline colour CSS uses !important */
}

html body #ld-login-modal .pa-login__lead {
	margin: 8px 0 0;
	font-size: 16px;
	line-height: 24px;
	color: var(--pa-neutral-600);
}

html body #ld-login-modal .pa-login__note {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 20px 0 0;
	padding: 12px 14px;
	border: 1px solid #cfe3f6;
	border-radius: 12px;
	background-color: #eef6fd;
	font-size: 14px;
	line-height: 20px;
	color: var(--pa-neutral-800);
}

html body #ld-login-modal .pa-login__note svg {
	flex-shrink: 0;
	margin-top: 1px;
	color: var(--pa-blue);
}

html body #ld-login-modal .pa-login__note strong {
	font-weight: 700;
	color: var(--pa-neutral-900);
}

/* "Accessing this course requires a login…" (course pages only). */
html body #ld-login-modal .ld-login-modal-login .ld-modal-text {
	margin: 16px 0 0;
	font-size: 14px;
	line-height: 20px;
	text-align: left;
	color: var(--pa-neutral-600);
}

html body #ld-login-modal .ld-alert {
	display: block;
	min-height: 0;
	margin: 20px 0 0;
	padding: 12px 14px !important;
	border: 1px solid #f4c7c3 !important;
	border-radius: 12px;
	background: #fef3f2 !important;
	box-shadow: none !important;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	text-align: left;
	color: #b42318 !important;
}

html body #ld-login-modal .ld-alert.ld-alert-success {
	border-color: #bfe5d2 !important;
	background: #ecfaf3 !important;
	color: #0b6b4a !important;
}

html body #ld-login-modal .ld-alert .ld-alert-content {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	padding: 0;
}

/* LearnDash's own icon is absolutely placed for a wider box: an inline one instead. */
html body #ld-login-modal .ld-alert .ld-alert-icon {
	display: none !important;
}

html body #ld-login-modal .ld-alert .ld-alert-content::before {
	content: "";
	flex: none;
	width: 18px;
	height: 18px;
	margin-top: 1px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5Zm-.75 4.5h1.5v5.5h-1.5v-5.5Zm.75 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5Zm-.75 4.5h1.5v5.5h-1.5v-5.5Zm.75 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

html body #ld-login-modal .ld-alert .ld-alert-messages,
html body #ld-login-modal .ld-alert .ld-alert-messages * {
	margin: 0;
	padding: 0;
	font: inherit !important;
	color: inherit !important;
}

/* Form (wp_login_form markup) */

html body #ld-login-modal .ld-login-modal-form {
	margin: 24px 0 0;
	text-align: left;
}

html body #ld-login-modal .ld-login-modal-form form {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 0;
}

html body #ld-login-modal .ld-login-modal-form p {
	margin: 0;
	padding: 0;
}

html body #ld-login-modal .ld-login-modal-form .login-username::before,
html body #ld-login-modal .ld-login-modal-form .login-password::before {
	content: none !important;
	display: none !important;
}

html body #ld-login-modal .ld-login-modal-form label {
	display: block;
	margin: 0 0 6px;
	font-family: var(--pa-font);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	text-align: left;
	color: var(--pa-neutral-800);
}

html body #ld-login-modal input[type="text"],
html body #ld-login-modal input[type="password"],
html body #ld-login-modal input[type="email"] {
	display: block;
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid var(--pa-neutral-200);
	border-radius: 12px;
	outline: none;
	background: var(--pa-neutral-0);
	box-shadow: none;
	font-family: var(--pa-font);
	font-size: 16px; /* 16px keeps iOS from zooming in on focus */
	line-height: 24px;
	color: var(--pa-neutral-900);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

html body #ld-login-modal input[type="text"]:hover,
html body #ld-login-modal input[type="password"]:hover,
html body #ld-login-modal input[type="email"]:hover {
	border-color: var(--pa-neutral-300);
}

html body #ld-login-modal input[type="text"]:focus,
html body #ld-login-modal input[type="password"]:focus,
html body #ld-login-modal input[type="email"]:focus {
	border-color: var(--pa-blue);
	box-shadow: 0 0 0 3px rgba(3, 124, 210, 0.18);
}

html body #ld-login-modal .ld-login-modal-form .login-remember label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: var(--pa-neutral-600);
	cursor: pointer;
}

html body #ld-login-modal .login-remember input[type="checkbox"] {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--pa-blue);
	cursor: pointer;
}

html body #ld-login-modal .ld-login-modal-form .login-submit {
	margin-top: 4px;
	text-align: left;
}

html body #ld-login-modal .login-submit input[type="submit"] {
	display: block;
	width: 100% !important;
	min-width: 0 !important;
	height: 48px;
	margin: 0 !important;
	padding: 0 24px !important;
	border: 0 !important;
	border-radius: 999px !important;
	background-color: var(--pa-blue) !important;
	background-image: none !important;
	box-shadow: none !important;
	font-family: var(--pa-font) !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 48px !important;
	letter-spacing: normal;
	text-transform: none;
	color: var(--pa-neutral-0) !important;
	opacity: 1 !important;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

html body #ld-login-modal .login-submit input[type="submit"]:hover,
html body #ld-login-modal .login-submit input[type="submit"]:focus {
	background-color: var(--pa-blue-hover) !important;
}

html body #ld-login-modal .login-submit input[type="submit"]:focus-visible {
	outline: 2px solid var(--pa-blue);
	outline-offset: 2px;
}

html body #ld-login-modal .ld-forgot-password-link {
	display: block;
	width: fit-content;
	margin: 16px auto 0;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	text-decoration: none;
	color: var(--pa-blue) !important;
}

html body #ld-login-modal .ld-forgot-password-link:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
	color: var(--pa-blue-hover) !important;
}

/* ---------------------------------------------------------------------------
 * "New to the Academy?" column
 * ------------------------------------------------------------------------ */

html body #ld-login-modal .ld-login-modal-register {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 56px 48px;
	background-color: var(--pa-neutral-900) !important;
	background-image:
		radial-gradient(120% 60% at 100% 0%, rgba(121, 198, 236, 0.2) 0%, rgba(121, 198, 236, 0) 60%),
		linear-gradient(180deg, var(--pa-neutral-900) 0%, var(--pa-blue) 100%) !important;
	color: var(--pa-neutral-0);
}

html body #ld-login-modal .ld-login-modal-register .ld-content {
	display: flex !important;
	flex-direction: column;
	align-items: flex-start !important;
	justify-content: center;
	text-align: left;
}

html body #ld-login-modal .pa-login__eyebrow {
	margin: 0 0 12px;
	font-family: var(--pa-mono);
	font-size: 12px;
	font-weight: 500;
	line-height: 16px;
	letter-spacing: 1.44px;
	text-transform: uppercase;
	color: var(--pa-cyan);
}

html body #ld-login-modal .ld-login-modal-register .ld-modal-heading {
	font-size: 28px;
	line-height: 36px;
	letter-spacing: -0.56px;
	color: var(--pa-neutral-0) !important;
}

html body #ld-login-modal .ld-login-modal-register .ld-modal-text {
	margin: 12px 0 0;
	font-size: 16px;
	line-height: 24px;
	color: #dbedfd;
}

html body #ld-login-modal .pa-login__points {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 24px 0 0;
	padding: 0;
	list-style: none;
}

html body #ld-login-modal .pa-login__points li {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	color: var(--pa-neutral-0);
}

html body #ld-login-modal .pa-login__points svg {
	flex-shrink: 0;
}

html body #ld-login-modal .ld-login-modal-register .ld-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: auto;
	min-width: 0;
	height: 48px;
	margin: 32px 0 0;
	padding: 0 24px;
	border: 0 !important;
	border-radius: 999px !important;
	background-color: var(--pa-yellow) !important;
	background-image: none !important;
	box-shadow: none !important;
	filter: none;
	transform: none;
	font-family: var(--pa-font);
	font-size: 15px;
	font-weight: 700 !important;
	line-height: 20px;
	white-space: nowrap;
	text-decoration: none;
	color: var(--pa-neutral-900) !important;
	opacity: 1 !important;
	transition: background-color 0.15s ease;
}

html body #ld-login-modal .ld-login-modal-register .ld-button:hover,
html body #ld-login-modal .ld-login-modal-register .ld-button:focus {
	background-color: var(--pa-yellow-hover) !important;
	box-shadow: none !important;
	filter: none;
	transform: none;
	color: var(--pa-neutral-900) !important;
}

html body #ld-login-modal .ld-login-modal-register .ld-button:focus-visible {
	outline: 2px solid var(--pa-neutral-0);
	outline-offset: 2px;
}

/* LearnDash's inline register form (only when no registration page is set). */
html body #ld-login-modal #ld-user-register {
	margin: 24px 0 0;
	text-align: left;
}

html body #ld-login-modal #ld-user-register label {
	display: block;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	color: var(--pa-neutral-0);
}

html body #ld-login-modal #ld-user-register input[type="text"],
html body #ld-login-modal #ld-user-register input[type="email"] {
	margin: 6px 0 16px;
	border-color: transparent;
}

html body #ld-login-modal #ld-user-register #reg_passmail {
	font-size: 14px;
	color: #dbedfd;
}

html body #ld-login-modal #ld-user-register input[type="submit"] {
	width: 100%;
	height: 48px;
	margin: 8px 0 0;
	padding: 0 24px;
	border: 0 !important;
	border-radius: 999px !important;
	background: var(--pa-yellow) !important;
	box-shadow: none !important;
	font-family: var(--pa-font);
	font-size: 15px;
	font-weight: 700;
	color: var(--pa-neutral-900) !important;
}

/* ---------------------------------------------------------------------------
 * Phones: one column, login first
 * ------------------------------------------------------------------------ */

@media (max-width: 767.98px) {
	html body .learndash-wrapper.learndash-wrapper-login-modal.ld-modal-open {
		padding: 12px;
	}

	html body #ld-login-modal.ld-modal {
		grid-template-columns: minmax(0, 1fr);
		border-radius: 20px;
	}

	html body #ld-login-modal .ld-modal-closer {
		top: 12px;
		right: 12px;
		background-color: var(--pa-neutral-50);
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 5l10 10M15 5 5 15' stroke='%23121d36' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
	}

	html body #ld-login-modal .ld-modal-closer:hover {
		background-color: #e9edf3;
	}

	html body #ld-login-modal .ld-modal-closer:focus-visible {
		outline-color: var(--pa-blue);
	}

	html body #ld-login-modal .ld-login-modal-login {
		padding: 24px 20px 28px;
	}

	html body #ld-login-modal .pa-login__brand {
		margin-bottom: 24px;
	}

	html body #ld-login-modal .ld-modal-heading {
		font-size: 28px;
		line-height: 36px;
		letter-spacing: -0.56px;
	}

	html body #ld-login-modal .ld-login-modal-register {
		padding: 28px 20px 28px;
	}

	html body #ld-login-modal .pa-login__eyebrow {
		margin-bottom: 8px;
	}

	html body #ld-login-modal .ld-login-modal-register .ld-modal-heading {
		font-size: 22px;
		line-height: 30px;
		letter-spacing: -0.44px;
	}

	html body #ld-login-modal .pa-login__points {
		gap: 10px;
		margin-top: 18px;
	}

	html body #ld-login-modal .ld-login-modal-register .ld-button {
		width: 100%;
		margin-top: 24px;
	}
}
