/* Login page (enqueued only on the /login/ page) */

/* Root cause of the fields/card overflowing their container: inputs and
   buttons here use width:100% plus padding/border, and without
   border-box sizing the browser adds that padding+border ON TOP of the
   100%, pushing them past the card's right edge. This single reset
   fixes every element inside the card at once. */
.mt-login-card,
.mt-login-card *,
.mt-login-card *::before,
.mt-login-card *::after {
	box-sizing: border-box;
}

.mt-login-card {
	display: grid;
	grid-template-columns: 1fr 1fr;
	background: var(--wp--preset--color--base);
	border-radius: 28px;
	overflow: hidden;
	box-shadow: 0 30px 60px rgba(11, 110, 110, 0.12);
}
@media (max-width: 800px) {
	.mt-login-card {
		grid-template-columns: 1fr;
		border-radius: 20px;
		/* Small breathing room so the card doesn't touch the screen edges,
		   while the section background behind it stays full-bleed. */
		margin-left: 12px;
		margin-right: 12px;
	}
	/* Sign-in form comes first on mobile so visitors don't have to scroll
	   past the brand panel to reach the actual form. */
	.mt-login-panel--form {
		order: 1;
	}
	/* Centre the form's intro copy to match the brand panel below it. */
	.mt-login-form-heading,
	.mt-login-form-sub {
		text-align: center;
	}
	.mt-login-panel--brand {
		order: 2;
		text-align: center;
		justify-content: center;
	}
	.mt-login-brand-content {
		width: 100%;
	}
	.mt-login-lead {
		margin-left: auto;
		margin-right: auto;
	}
	.mt-login-steps {
		width: fit-content;
		margin: 0 auto 24px;
	}
	.mt-login-panel--brand::before {
		width: 200px;
		height: 200px;
		top: -60px;
		right: -60px;
	}
	.mt-login-panel--brand::after {
		width: 170px;
		height: 170px;
		bottom: -70px;
		left: -50px;
	}

	/* Strip the stacked container padding on mobile (post-content's own
	   15px plus the constrained group's global padding) so the card can
	   use the full screen width instead of being squeezed twice over. */
	.entry-content.has-global-padding,
	.entry-content.has-global-padding > .alignfull > :where(:not(.alignleft):not(.alignright):not(.alignfull)),
	.entry-content .wp-block-group.has-global-padding {
		padding-left: 0;
		padding-right: 0;
	}
	/* With that padding gone, the negative margins WordPress gives
	   .alignfull to cancel it would now push the block 15px past each
	   edge and bring back the horizontal scrollbar — so zero them too. */
	.entry-content .alignfull {
		margin-left: 0;
		margin-right: 0;
		max-width: 100%;
		width: 100%;
	}
	.entry-content .wp-block-group.alignwide {
		max-width: 100%;
	}
}

@media (max-width: 480px) {
	.mt-login-panel {
		padding: 28px 18px;
	}
	.mt-login-heading {
		font-size: 26px;
	}
	.mt-login-lead {
		font-size: 14px;
	}
	.mt-login-form-heading {
		font-size: 22px;
	}
	.mt-login-panel--brand::before {
		width: 160px;
		height: 160px;
		top: -50px;
		right: -50px;
	}
	.mt-login-panel--brand::after {
		width: 140px;
		height: 140px;
		bottom: -60px;
		left: -40px;
	}
	.mt-form-input-wrap input {
		font-size: 16px; /* keeps iOS from auto-zooming on focus */
	}
	.mt-login-submit,
	.mt-login-social {
		padding: 14px 18px;
	}
}

/* Phone only: card sits flush between the header and footer, square
   corners, no surrounding gap. */
@media (max-width: 600px) {
	.mt-login-card {
		border-radius: 0;
	}
	/* The section's top/bottom padding comes from an inline style on the
	   block, so it needs !important to be cleared. */
	.entry-content .wp-block-group.alignfull.has-background {
		padding-top: 0 !important;
		padding-bottom: 0 !important;
	}
	/* With the card now flush against the header, the form heading needs
	   its own breathing room at the top. */
	.mt-login-panel--form {
		padding-top: 38px;
	}
}

.mt-login-panel {
	padding: clamp(36px, 4.5vw, 56px) clamp(24px, 3.5vw, 56px);
}

.mt-login-panel--brand {
	position: relative;
	overflow: hidden;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	display: flex;
	align-items: center;
}
.mt-login-panel--brand::before {
	content: "";
	position: absolute;
	top: -80px;
	right: -80px;
	width: 260px;
	height: 260px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.06);
}
.mt-login-panel--brand::after {
	content: "";
	position: absolute;
	bottom: -100px;
	left: -60px;
	width: 220px;
	height: 220px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.12);
}
.mt-login-brand-content {
	position: relative;
	z-index: 1;
	width: 100%;
}
.mt-login-logo {
	display: block;
	width: 84px;
	height: auto;
	margin-bottom: 26px;
}
.mt-login-brand-image {
	display: block;
	width: 100%;
	max-height: 220px;
	object-fit: contain;
	margin-top: 32px;
}
.mt-login-eyebrow {
	display: inline-block;
	font: 700 11px var(--wp--preset--font-family--inter);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin-bottom: 14px;
}
.mt-login-eyebrow--dark {
	color: var(--wp--preset--color--primary);
}
.mt-login-heading {
	margin: 0 0 16px;
	font: 700 clamp(28px, 3.2vw, 38px) var(--wp--preset--font-family--poppins);
	line-height: 1.15;
}
.mt-login-lead {
	margin: 0 0 28px;
	font: 400 15px/1.7 var(--wp--preset--font-family--inter);
	color: rgba(255, 255, 255, 0.85);
	max-width: 40ch;
}
.mt-login-steps {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin-bottom: 24px;
}
.mt-login-step {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 0;
	font: 500 15px var(--wp--preset--font-family--inter);
	color: rgba(255, 255, 255, 0.75);
}
.mt-login-step:not(:last-child)::after {
	content: "";
	position: absolute;
	left: 13px;
	top: 34px;
	width: 1px;
	height: 20px;
	background: rgba(255, 255, 255, 0.25);
}
.mt-login-step__num {
	flex: none;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.14);
	color: var(--wp--preset--color--base);
	font: 700 12px var(--wp--preset--font-family--poppins);
}
.mt-login-step--active {
	color: var(--wp--preset--color--base);
	font-weight: 700;
}
.mt-login-step--active .mt-login-step__num {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast);
}
.mt-login-tagline {
	margin: 4px 0 0;
	font: 600 italic 14px var(--wp--preset--font-family--poppins);
	color: var(--wp--preset--color--accent);
}

.mt-login-panel--form {
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.mt-login-form-heading {
	margin: 0 0 6px;
	font: 700 28px var(--wp--preset--font-family--poppins);
	color: var(--wp--preset--color--contrast);
}
.mt-login-form-sub {
	margin: 0 0 26px;
	font: 400 14.5px/1.6 var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--neutral);
}
.mt-login-form {
	display: flex;
	flex-direction: column;
	gap: 18px;
}
.mt-form-group label {
	display: block;
	margin-bottom: 8px;
	font: 600 13px var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--contrast);
}
.mt-form-input-wrap {
	position: relative;
}
.mt-form-input-wrap input {
	width: 100%;
	border: 1.5px solid color-mix(in srgb, var(--wp--preset--color--primary) 18%, transparent);
	border-radius: 12px;
	padding: 13px 16px;
	font: 400 14.5px var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--contrast);
	background: #f9fbfb;
	transition: border-color 0.2s ease;
}
.mt-form-input-wrap input:focus {
	outline: none;
	border-color: var(--wp--preset--color--primary);
	background: var(--wp--preset--color--base);
}
.mt-login-form.is-invalid .mt-form-input-wrap input:invalid,
.mt-form-input-wrap input.is-invalid {
	border-color: #d64545;
}
.mt-form-toggle-password {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	font: 600 12.5px var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--primary);
}
.mt-form-error {
	display: block;
	margin-top: 6px;
	font: 500 12.5px var(--wp--preset--font-family--inter);
	color: #d64545;
	min-height: 1px;
}
.mt-form-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
}
.mt-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	font: 500 13.5px var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
}
.mt-checkbox input {
	width: 17px;
	height: 17px;
	accent-color: var(--wp--preset--color--primary);
}
.mt-login-link {
	font: 600 13.5px var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
}
.mt-login-submit {
	cursor: pointer;
	border: none;
	border-radius: 999px;
	padding: 15px 20px;
	font: 700 15px var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--accent);
	transition: background-color 0.2s ease, opacity 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}
.mt-login-submit:hover {
	background: var(--wp--preset--color--accent-dark);
}
.mt-login-submit[disabled] {
	opacity: 0.75;
	cursor: default;
}
.mt-login-spinner {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid rgba(26, 26, 26, 0.25);
	border-top-color: var(--wp--preset--color--contrast);
	animation: mt-spin 0.7s linear infinite;
}
@keyframes mt-spin {
	to {
		transform: rotate(360deg);
	}
}
.mt-login-divider {
	position: relative;
	text-align: center;
	margin: 24px 0;
}
.mt-login-divider::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 1px;
	background: color-mix(in srgb, var(--wp--preset--color--primary) 14%, transparent);
}
.mt-login-divider span {
	position: relative;
	background: var(--wp--preset--color--base);
	padding: 0 14px;
	font: 600 11px var(--wp--preset--font-family--inter);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--neutral);
}
.mt-login-social {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	cursor: pointer;
	border: 1.5px solid color-mix(in srgb, var(--wp--preset--color--primary) 16%, transparent);
	border-radius: 999px;
	padding: 13px 20px;
	background: var(--wp--preset--color--base);
	font: 600 14px var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--contrast);
}
.mt-login-social svg {
	width: 18px;
	height: 18px;
}
.mt-login-social:hover {
	background: #f9fbfb;
}
.mt-login-footnote {
	margin: 22px 0 0;
	text-align: center;
	font: 400 13.5px var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--neutral);
}
.mt-login-footnote a {
	font-weight: 700;
	color: var(--wp--preset--color--primary);
}
.mt-login-security {
	margin: 14px 0 0;
	text-align: center;
	font: 400 12px var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--neutral);
}
.mt-login-alert {
	border-radius: 10px;
	padding: 12px 16px;
	margin-bottom: 18px;
	font: 500 13.5px var(--wp--preset--font-family--inter);
}
.mt-login-alert--error {
	background: rgba(214, 69, 69, 0.1);
	color: #b32b2b;
}
.mt-login-alert--success {
	background: color-mix(in srgb, var(--wp--preset--color--primary) 10%, transparent);
	color: var(--wp--preset--color--primary);
}

/* ──────────────────────────────────────────────────────────────
   Registration page — builds on the same card/panel system above.
   ────────────────────────────────────────────────────────────── */

.mt-register-card .mt-login-panel--form {
	justify-content: flex-start;
}
.mt-register-form {
	gap: 16px;
}

/* Side-by-side first/last name */
.mt-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}
@media (max-width: 480px) {
	.mt-form-grid {
		grid-template-columns: 1fr;
	}
}

/* Small grey helper line under a field */
.mt-form-hint {
	display: block;
	margin-top: 6px;
	font: 400 12.5px/1.5 var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--neutral);
}
.mt-form-optional {
	font-weight: 400;
	color: var(--wp--preset--color--neutral);
}

/* Leading icon inside an input */
.mt-form-input-wrap--icon .mt-form-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	color: var(--wp--preset--color--primary);
	opacity: 0.55;
	pointer-events: none;
}
.mt-form-input-wrap--icon input {
	padding-left: 42px;
}

/* Native select styled to match the text inputs */
.mt-form-select {
	width: 100%;
	appearance: none;
	border: 1.5px solid color-mix(in srgb, var(--wp--preset--color--primary) 18%, transparent);
	border-radius: 12px;
	padding: 13px 40px 13px 16px;
	font: 400 14.5px var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--contrast);
	background-color: #f9fbfb;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B6E6E' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 16px;
	cursor: pointer;
	transition: border-color 0.2s ease;
}
.mt-form-select:focus {
	outline: none;
	border-color: var(--wp--preset--color--primary);
	background-color: var(--wp--preset--color--base);
}

/* These two are toggled with the `hidden` attribute from JS. The UA
   stylesheet's [hidden]{display:none} loses to any author `display`
   rule, so it has to be re-stated here or they'd always be visible. */
.mt-password-strength[hidden],
.mt-form-success[hidden] {
	display: none;
}

/* Password strength meter */
.mt-password-strength {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 10px;
}
.mt-password-strength__bars {
	display: flex;
	gap: 6px;
	flex: 1;
}
.mt-password-strength__bars span {
	flex: 1;
	height: 4px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--wp--preset--color--primary) 12%, transparent);
	transition: background-color 0.2s ease;
}
.mt-password-strength__label {
	font: 600 12.5px var(--wp--preset--font-family--inter);
	flex: none;
}
.mt-password-strength[data-level="1"] .mt-password-strength__bars span:nth-child(1),
.mt-password-strength[data-level="2"] .mt-password-strength__bars span:nth-child(-n + 2),
.mt-password-strength[data-level="3"] .mt-password-strength__bars span {
	background: currentColor;
}
.mt-password-strength[data-level="1"] {
	color: #d64545;
}
.mt-password-strength[data-level="2"] {
	color: #d9a400;
}
.mt-password-strength[data-level="3"] {
	color: var(--wp--preset--color--primary);
}

/* "Passwords match" confirmation */
.mt-form-success {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 6px;
	font: 500 12.5px var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--primary);
}
.mt-form-success svg {
	width: 14px;
	height: 14px;
	flex: none;
}

/* Cross-link between the student and instructor sign-ups. Styled as a
   real button rather than a text link so it's actually discoverable. */
.mt-login-alt-block {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--primary) 12%, transparent);
	text-align: center;
}
.mt-login-alt-block__label {
	display: block;
	margin-bottom: 10px;
	font: 500 13.5px var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--neutral);
}
.mt-login-alt-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	padding: 13px 20px;
	border: 1.5px solid color-mix(in srgb, var(--wp--preset--color--primary) 32%, transparent);
	border-radius: 999px;
	background: color-mix(in srgb, var(--wp--preset--color--primary) 5%, transparent);
	font: 700 14px var(--wp--preset--font-family--inter);
	color: var(--wp--preset--color--primary);
	text-decoration: none !important;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}
.mt-login-alt-cta:hover {
	background: color-mix(in srgb, var(--wp--preset--color--primary) 11%, transparent);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}
.mt-login-alt-cta svg {
	width: 17px;
	height: 17px;
	flex: none;
}

/* Terms / newsletter checkboxes */
.mt-form-agreements {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 2px;
}
.mt-checkbox--start {
	align-items: flex-start;
	gap: 10px;
	line-height: 1.5;
}
.mt-checkbox--start input {
	margin-top: 2px;
	flex: none;
}
.mt-checkbox--start a {
	color: var(--wp--preset--color--primary);
	font-weight: 700;
}

/* Inline error shown with a leading warning dot, used for the terms box */
.mt-form-agreements .mt-form-error:not(:empty) {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: -4px;
}
.mt-form-agreements .mt-form-error:not(:empty)::before {
	content: "!";
	flex: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #d64545;
	color: #fff;
	font: 700 10px/14px var(--wp--preset--font-family--inter);
	text-align: center;
}
