.myportal-lm-form,
.myportal-lm-modal * {
	box-sizing: border-box;
}

.myportal-lm-modal__dialog {
	--myportal-lm-field-bg: rgba(0, 0, 0, 0.04);
	--myportal-lm-field-color: #000;
	--myportal-lm-placeholder-color: #808080;
	--myportal-lm-button-bg: #111;
	--myportal-lm-button-color: #fff;
	--myportal-lm-error-color: #b42318;
	--myportal-lm-gap: 1.25rem;
	--myportal-lm-border-radius: .25rem;

	.myportal-lm-form__submit {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 0.55rem;
		min-height: 3rem;
		padding: 0 1.5rem;
		border: 0;
		border-radius: 0;
		background: var(--myportal-lm-button-bg);
		color: var(--myportal-lm-button-color);
		cursor: pointer;
		font: inherit;
		font-weight: 700;
		line-height: 1;

		&:hover,
		&:focus-visible {
			background: #000;
			outline: none;
		}

		&:disabled {
			cursor: not-allowed;
			opacity: 0.65;
		}
	}
}

.myportal-lm-form {
	text-align: left;

	.myportal-lm-form__fields {
		display: grid;
		gap: var(--myportal-lm-gap);
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.myportal-lm-form__field {
		display: block;
		margin: 0;

		> span {
			position: absolute;
			width: 1px;
			height: 1px;
			padding: 0;
			margin: -1px;
			overflow: hidden;
			clip: rect(0, 0, 0, 0);
			white-space: nowrap;
			border: 0;
		}

		&.myportal-lm-form__field--full {
			grid-column: 1 / -1;
		}
	}

	[data-myportal-lm-test-drive-field][hidden] {
		display: none !important;
	}

	.myportal-lm-form__test-drive-label {
		strong {
			color: #111;
		}

		p {
			padding: 0;
			line-height: 1rem;
			font-style: italic;
		}
	}

	input[type="text"], input[type="email"], input[type="tel"], input[type="date"], select, textarea {
		display: block;
		width: 100%;
		min-height: 3.25rem;
		padding: 0 1rem;
		border: 0;
		-webkit-border-radius: var(--myportal-lm-border-radius);
		-moz-border-radius: var(--myportal-lm-border-radius);
		border-radius: var(--myportal-lm-border-radius);
		background-color: var(--myportal-lm-field-bg);
		box-shadow: none;
		box-sizing: border-box;
		color: var(--myportal-lm-field-color);
		font: inherit;
		line-height: 1.35;
		outline: none;

		&::placeholder {
			color: var(--myportal-lm-placeholder-color);
			opacity: 1;
		}

		&:focus {
			background-color: rgba(0, 0, 0, 0.06);
		}

		&.is-invalid {
			box-shadow: inset 0 0 0 1px var(--myportal-lm-error-color);
		}
	}

	select {
		appearance: none;
		padding-right: 2.5rem;
		background-image: linear-gradient(45deg, transparent 50%, #808080 50%), linear-gradient(135deg, #808080 50%, transparent 50%);
		background-position: calc(100% - 1.25rem) 50%, calc(100% - 0.9rem) 50%;
		background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
		background-repeat: no-repeat;
	}

	textarea {
		min-height: 3rem;
		height: 8rem;
		padding-top: 0.875rem;
		padding-bottom: 0.875rem;
		resize: vertical;
	}

	.myportal-lm-form__check {
		display: flex;
		align-items: flex-start;
		gap: 0.75rem;
		margin: 1.5rem 0 0;
		color: #333;
		font-size: 0.95rem;
		font-weight: 400;
		line-height: 1.45;
		text-align: left;

		input[type="checkbox"] {
			flex: 0 0 auto;
			width: auto;
			margin: 0.25rem 0 0;
		}
	}

	.myportal-lm-form__checks {
		margin-top: 1.5rem;

		.myportal-lm-form__check {
			margin-top: .3rem;

			span {
				font-size: 0.85rem;
			}
		}
	}

	.myportal-lm-form__error {
		margin: 0.9rem 0 0;
		color: var(--myportal-lm-error-color);
		font-size: 0.92rem;
	}

	.myportal-lm-form__success {
		margin: 0.9rem 0 0;
		color: #111;
	}

	.myportal-lm-form__actions {
		margin-top: 1.5rem;
	}

	&.is-loading {
		pointer-events: none;

		.myportal-lm-form__submit::before {
			width: 1rem;
			height: 1rem;
			border: 2px solid rgba(255, 255, 255, 0.45);
			border-top-color: #fff;
			border-radius: 50%;
			content: "";
			animation: myportal-lm-spin 0.75s linear infinite;
		}
	}
}

.myportal-lm-modal {
	display: flex;
	align-items: center;
	justify-content: center;
	position: fixed;
	inset: 0;
	z-index: 10020;
	padding: 1rem;

	&[hidden] {
		display: none;
	}

	.myportal-lm-modal__overlay {
		position: absolute;
		inset: 0;
		background: rgba(15, 23, 42, 0.58);
	}

	.myportal-lm-modal__dialog {
		position: relative;
		width: min(100% - 2rem, 44rem);
		max-height: calc(100vh - 2rem);
		margin: 0;
		overflow-y: auto;
		-webkit-border-radius: var(--myportal-lm-border-radius);
		-moz-border-radius: var(--myportal-lm-border-radius);
		border-radius: var(--myportal-lm-border-radius);
		background: #fff;
		box-shadow: 0 1.25rem 3.75rem rgba(15, 23, 42, 0.24);
	}

	.myportal-lm-modal__head {
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		gap: 1rem;
		padding: 1.75rem 1.75rem 0;
	}

	.myportal-lm-modal__title {
		margin: 0 !important;
		color: #111;
		font-size: 1.35rem;
		line-height: 1.2;
		margin-bottom: 0;
	}

	.myportal-lm-modal__subject {
		margin: 0;
		padding: 0;
		color: #555;
		font-size: 0.95rem;
	}

	.myportal-lm-modal__close {
		width: 2.5rem;
		height: 2.5rem;
		border: 0;
		border-radius: 0;
		background: transparent;
		color: #111;
		cursor: pointer;
		font-size: 1.75rem;
		line-height: 1;
	}

	.myportal-lm-form,
	.myportal-lm-form__success {
		padding: 1.75rem;
	}
}

body.myportal-lm-modal-open {
	overflow: hidden;
}

@keyframes myportal-lm-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (max-width: 47.99875rem) {
	.myportal-lm-form {
		.myportal-lm-form__fields {
			grid-template-columns: minmax(0, 1fr);
		}
	}

	.myportal-lm-modal {
		padding: 0.75rem;

		.myportal-lm-modal__dialog {
			width: 100%;
		}

		.myportal-lm-modal__head,
		.myportal-lm-form,
		.myportal-lm-form__success {
			padding-inline: 1.25rem;
		}
	}
}
