:root {
	--fmc-color-primary: #1254a5;
	--fmc-color-primary-dark: #0e4384;
	--fmc-color-text: #1c2b3a;
	--fmc-color-label: #16283c;
	--fmc-color-border: #e2e6ea;
	--fmc-color-field: #f4f6f8;
	--fmc-color-surface: #fff;
	--fmc-color-overlay: rgba(0, 0, 0, 0.5);
	--fmc-color-error: #b32020;
	--fmc-color-success: #1c7c3e;
}

/*
 * Native CSS nesting cannot build BEM names with `&__part` - that is SCSS only,
 * and the browser drops the whole rule. Element and modifier selectors are
 * written out in full; `&` is used only where it is a valid compound selector
 * (`&:hover`, `&.is-open`, `&[disabled]`).
 */

.fmc-pricer-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 100000;
	align-items: center;
	justify-content: center;
	padding: 16px;

	&.is-open {
		display: flex;
	}
}

.fmc-pricer-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.fmc-pricer-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	background: var(--fmc-color-surface);
	border-radius: 8px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.fmc-pricer-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 28px;
	background: var(--fmc-color-primary);
}

.fmc-pricer-modal__title {
	margin: 0;
	color: #fff;
	font-family: 'PT Sans', sans-serif;
	font-size: 26px;
	line-height: 32px;
	font-weight: 700;
}

/* Leaves for the home page - it does not dismiss the modal. */
.fmc-pricer-modal__close {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin-right: -6px;
	border-radius: 4px;
	color: #fff;
	text-decoration: none;

	&:hover,
	&:focus {
		background: rgba(255, 255, 255, 0.16);
		color: #fff;
	}

	&:focus-visible {
		outline: 2px solid #fff;
		outline-offset: 2px;
	}
}

.fmc-pricer-modal__close-icon {
	font-size: 28px;
	line-height: 1;
}

.fmc-pricer-modal__intro {
	margin: 0;
	padding: 22px 28px 0;
	color: var(--fmc-color-text);
	font-size: 16px;
	line-height: 24px;
}

.fmc-pricer-modal__form {
	padding: 22px 28px 28px;
}

.fmc-pricer-modal__field {
	margin-bottom: 22px;
}

.fmc-pricer-modal__label {
	display: block;
	margin-bottom: 8px;
	color: var(--fmc-color-label);
	font-family: 'PT Sans', sans-serif;
	font-size: 16px;
	line-height: 22px;
	font-weight: 700;
}

.fmc-pricer-modal__input,
.fmc-pricer-modal__select {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--fmc-color-border);
	border-radius: 6px;
	background: var(--fmc-color-field);
	color: var(--fmc-color-text);
	font-size: 16px;
	line-height: 24px;

	&:focus {
		border-color: var(--fmc-color-primary);
		outline: none;
	}
}

.fmc-pricer-modal__select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c2b3a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 18px 18px;
	padding-right: 42px;
}

.fmc-pricer-modal__message {
	margin: 0 0 18px;
	font-size: 15px;
	line-height: 22px;

	&:empty {
		display: none;
	}
}

.fmc-pricer-modal__message--error {
	color: var(--fmc-color-error);
}

.fmc-pricer-modal__message--success {
	color: var(--fmc-color-success);
}

.fmc-pricer-modal__submit {
	padding: 14px 26px;
	border: 0;
	border-radius: 4px;
	background: var(--fmc-color-primary);
	color: #fff;
	font-family: 'PT Sans', sans-serif;
	font-size: 16px;
	line-height: 20px;
	font-weight: 700;
	cursor: pointer;

	&:hover {
		background: var(--fmc-color-primary-dark);
	}

	&[disabled] {
		opacity: 0.6;
		cursor: default;
	}
}

.fmc-modal-open {
	overflow: hidden;
}
