/*
 * Aanvraagvenster — Mok Offerte Flow
 *
 * Zelfde richting als het klantportaal: porselein en delfts blauw. Dat is een
 * keuze en geen gemak — de klant die hier iets invult, ziet straks de
 * offertepagina, en die hoort van dezelfde hand te zijn.
 *
 * Het venster staat over een webshop die zijn eigen stijl heeft. Alles is
 * daarom nadrukkelijk gescoped en gebruikt eigen variabelen, zodat een thema
 * er niet doorheen lekt en wij er niet doorheen lekken.
 */

.mof-modal {
	--mof-m-accent: #1F4B99;
	--mof-m-deep: #16386F;
	--mof-m-wash: #F1F5FC;
	--mof-m-ink: #131A24;
	--mof-m-soft: #56616F;
	--mof-m-faint: #8791A0;
	--mof-m-line: #E1E7EF;
	--mof-m-radius: 14px;
	--mof-m-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	width: min(62rem, calc(100vw - 2rem));
	max-width: none;
	max-height: min(46rem, calc(100vh - 2rem));
	padding: 0;
	border: 0;
	border-radius: var(--mof-m-radius);
	background: #fff;
	color: var(--mof-m-ink);
	font-family: var(--mof-m-font);
	font-size: 16px;
	line-height: 1.5;
	overflow: visible;
	box-shadow: 0 24px 60px rgba(12, 22, 40, 0.22);
}

.mof-modal::backdrop {
	background: rgba(14, 22, 38, 0.55);
	backdrop-filter: blur(2px);
}

/* Pagina eronder niet laten meescrollen */
html.mof-modal-open,
html.mof-modal-open body {
	overflow: hidden;
}

.mof-modal *,
.mof-modal *::before,
.mof-modal *::after {
	box-sizing: border-box;
}

.mof-modal__frame {
	max-height: min(46rem, calc(100vh - 2rem));
	border-radius: var(--mof-m-radius);
	overflow: auto;
	overscroll-behavior: contain;
}

/* Sluitknop hangt half over de rand: nooit te verwarren met een veld */
.mof-modal__close {
	position: absolute;
	top: -0.75rem;
	right: -0.75rem;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 1px solid var(--mof-m-line);
	border-radius: 50%;
	background: #fff;
	color: var(--mof-m-soft);
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(12, 22, 40, 0.16);
	transition: color 0.15s ease, border-color 0.15s ease;
}

.mof-modal__close:hover {
	color: var(--mof-m-accent);
	border-color: var(--mof-m-accent);
}

.mof-modal__close:focus-visible {
	outline: 2px solid var(--mof-m-accent);
	outline-offset: 2px;
}

/* -------------------------------------------------------------- Indeling */

.mof-modal__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
}

.mof-modal__main {
	padding: 2.25rem 2.25rem 2rem;
}

.mof-modal__aside {
	padding: 2.25rem 1.75rem 2rem;
	border-left: 1px solid var(--mof-m-line);
	background: var(--mof-m-wash);
	border-radius: 0 var(--mof-m-radius) var(--mof-m-radius) 0;
}

/* ------------------------------------------------------------- Typografie */

.mof-modal__eyebrow {
	margin: 0 0 0.4rem;
	color: var(--mof-m-accent);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.mof-modal__title {
	margin: 0 0 0.6rem;
	color: var(--mof-m-ink);
	font-size: 1.9rem;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.mof-modal__lede {
	margin: 0 0 1.75rem;
	max-width: 34rem;
	color: var(--mof-m-soft);
	font-size: 1rem;
}

/* ------------------------------------------------- Signature: de stappen */

.mof-modal__asidetitle {
	margin: 0 0 1.25rem;
	color: var(--mof-m-deep);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.mof-steps {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mof-steps__item {
	position: relative;
	padding: 0 0 1.5rem 2.25rem;
}

.mof-steps__item::before {
	content: "";
	position: absolute;
	top: 1.9rem;
	bottom: 0.25rem;
	left: 0.72rem;
	width: 1px;
	background: linear-gradient(to bottom, var(--mof-m-accent), rgba(31, 75, 153, 0.18));
}

.mof-steps__item:last-child {
	padding-bottom: 0;
}

.mof-steps__item:last-child::before {
	display: none;
}

.mof-steps__marker {
	position: absolute;
	top: 0.1rem;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	background: var(--mof-m-accent);
	color: #fff;
	font-size: 0.78rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.mof-steps__when {
	display: block;
	margin-bottom: 0.15rem;
	color: var(--mof-m-accent);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.mof-steps__title {
	display: block;
	margin-bottom: 0.2rem;
	font-size: 0.95rem;
	font-weight: 600;
}

.mof-steps__text {
	display: block;
	color: var(--mof-m-soft);
	font-size: 0.85rem;
	line-height: 1.45;
}

.mof-modal__call {
	margin: 1.75rem 0 0;
	padding-top: 1.25rem;
	border-top: 1px solid var(--mof-m-line);
	color: var(--mof-m-soft);
	font-size: 0.85rem;
}

.mof-modal__call a {
	display: block;
	margin-top: 0.15rem;
	color: var(--mof-m-accent);
	font-size: 1.05rem;
	font-weight: 700;
	text-decoration: none;
}

.mof-modal__call a:hover {
	text-decoration: underline;
}

/* ---------------------------------------------------------- Formulier */

.mof-modal .mof-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 1rem;
}

.mof-modal .mof-field {
	display: block;
	margin: 0 0 1.05rem;
}

.mof-modal .mof-field--full,
.mof-modal .mof-field--check,
.mof-modal .mof-field__help {
	grid-column: 1 / -1;
}

.mof-modal .mof-field__label {
	display: block;
	margin-bottom: 0.3rem;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--mof-m-ink);
}

.mof-modal .mof-field__hint {
	color: var(--mof-m-faint);
	font-weight: 400;
}

.mof-modal .mof-field input,
.mof-modal .mof-field select,
.mof-modal .mof-field textarea {
	width: 100%;
	padding: 0.68em 0.8em;
	border: 1px solid #CDD6E3;
	border-radius: 8px;
	background: #fff;
	color: var(--mof-m-ink);
	font-family: inherit;
	font-size: 0.98rem;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.mof-modal .mof-field select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 L6 6.5 L11 1.5' stroke='%2356616F' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.8em center;
	padding-right: 2.2em;
}

.mof-modal .mof-field input:focus,
.mof-modal .mof-field select:focus,
.mof-modal .mof-field textarea:focus {
	outline: none;
	border-color: var(--mof-m-accent);
	box-shadow: 0 0 0 3px rgba(31, 75, 153, 0.14);
}

.mof-modal .mof-field textarea {
	min-height: 5.5rem;
	resize: vertical;
}

.mof-modal .mof-field--check {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.92rem;
}

.mof-modal .mof-field--check input {
	width: auto;
	margin: 0;
}

.mof-modal .mof-field__help {
	margin: -0.75rem 0 1rem;
	color: var(--mof-m-faint);
	font-size: 0.8rem;
}

/* ------------------------------------------------------ Gekozen product */

.mof-modal .mof-picked {
	margin: 0 0 1.5rem;
	padding: 0.9rem 1rem;
	border: 1px solid var(--mof-m-line);
	border-radius: 10px;
	background: #FAFCFF;
}

.mof-modal .mof-picked__title {
	margin: 0 0 0.7rem;
	color: var(--mof-m-faint);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.mof-modal .mof-picked__row {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 0.4rem 0;
}

.mof-modal .mof-picked__img {
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	border-radius: 8px;
	object-fit: cover;
	background: #fff;
}

.mof-modal .mof-picked__body {
	flex: 1 1 auto;
	min-width: 0;
}

.mof-modal .mof-picked__name {
	display: block;
	font-size: 0.95rem;
	font-weight: 600;
}

.mof-modal .mof-picked__sku {
	display: block;
	color: var(--mof-m-faint);
	font-size: 0.78rem;
}

.mof-modal .mof-picked__qty {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--mof-m-faint);
}

.mof-modal .mof-picked__qty input {
	width: 5rem;
	padding: 0.45em 0.55em;
	border: 1px solid #CDD6E3;
	border-radius: 7px;
	font-size: 0.95rem;
	text-align: center;
}

.mof-modal .mof-picked__variations {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	margin-top: 0.5rem;
	padding-top: 0.7rem;
	border-top: 1px dashed var(--mof-m-line);
}

.mof-modal .mof-picked__variation {
	flex: 1 1 10rem;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--mof-m-faint);
}

.mof-modal .mof-picked__variation select {
	padding: 0.5em 0.6em;
	border: 1px solid #CDD6E3;
	border-radius: 7px;
	background: #fff;
	color: var(--mof-m-ink);
	font-size: 0.92rem;
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
}

.mof-modal .mof-picked__note {
	margin: 0.6rem 0 0;
	color: var(--mof-m-soft);
	font-size: 0.8rem;
}

/* ------------------------------------------------------------- Versturen */

/*
 * De verstuurknop blijft in beeld terwijl de klant scrollt.
 *
 * Zonder dit valt hij bij een wat langer formulier onder de vouw, en dan is de
 * belangrijkste actie in het venster precies het enige dat je niet ziet.
 */
.mof-modal__foot {
	position: sticky;
	bottom: 0;
	z-index: 1;
	margin: 0.5rem -2.25rem 0;
	padding: 1.1rem 2.25rem 1.25rem;
	border-top: 1px solid var(--mof-m-line);
	background: #fff;
	box-shadow: 0 -10px 16px -12px rgba(12, 22, 40, 0.35);
}

.mof-modal__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 12rem;
	padding: 0.85em 1.8em;
	border: 0;
	border-radius: 9px;
	background: var(--mof-m-accent);
	color: #fff;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.08s ease;
}

.mof-modal__submit:hover {
	background: var(--mof-m-deep);
}

.mof-modal__submit:active {
	transform: translateY(1px);
}

.mof-modal__submit:disabled {
	opacity: 0.6;
	cursor: progress;
}

.mof-modal__submit:focus-visible {
	outline: 2px solid var(--mof-m-deep);
	outline-offset: 3px;
}

.mof-modal__reassure {
	margin: 0.75rem 0 0;
	color: var(--mof-m-faint);
	font-size: 0.8rem;
}

.mof-modal__error {
	margin: 0 0 1rem;
	padding: 0.75rem 0.9rem;
	border-left: 3px solid #B3261E;
	border-radius: 0 7px 7px 0;
	background: #FDF2F1;
	color: #7A1B15;
	font-size: 0.9rem;
}

.mof-modal__loading {
	padding: 5rem 2rem;
	color: var(--mof-m-faint);
	text-align: center;
}

/* -------------------------------------------------------------- Gelukt */

.mof-done {
	padding: 3.5rem 2.5rem;
	text-align: center;
}

.mof-done__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	margin-bottom: 1.25rem;
	border-radius: 50%;
	background: var(--mof-m-wash);
	color: var(--mof-m-accent);
}

.mof-done__tick {
	stroke-dasharray: 26;
	stroke-dashoffset: 26;
	animation: mof-tick 0.45s 0.1s ease-out forwards;
}

@keyframes mof-tick {
	to { stroke-dashoffset: 0; }
}

.mof-done__title {
	margin: 0 0 0.65rem;
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.015em;
}

.mof-done__title:focus {
	outline: none;
}

.mof-done__text {
	max-width: 30rem;
	margin: 0 auto 1.75rem;
	color: var(--mof-m-soft);
	font-size: 0.98rem;
}

/* ------------------------------------------------------------- Kleiner */

@media (max-width: 860px) {
	.mof-modal {
		width: 100vw;
		max-width: 100vw;
		max-height: 100vh;
		margin: 0;
		border-radius: 0;
	}

	.mof-modal__frame {
		max-height: 100vh;
		border-radius: 0;
	}

	.mof-modal__grid {
		grid-template-columns: 1fr;
	}

	.mof-modal__main {
		padding: 2.75rem 1.25rem 1.5rem;
	}

	/* Op een klein scherm hoort het formulier eerst: wie het venster opent
	   wil invullen, niet lezen. De stappen staan eronder als geruststelling
	   vlak voordat hij verstuurt. */
	.mof-modal__aside {
		padding: 1.5rem 1.25rem 2rem;
		border-left: 0;
		border-top: 1px solid var(--mof-m-line);
		border-radius: 0;
	}

	.mof-modal__close {
		top: 0.6rem;
		right: 0.6rem;
		box-shadow: none;
	}

	.mof-modal__title {
		font-size: 1.55rem;
	}

	.mof-modal .mof-fields {
		grid-template-columns: 1fr;
	}

	.mof-modal__foot {
		margin-left: -1.25rem;
		margin-right: -1.25rem;
		padding-left: 1.25rem;
		padding-right: 1.25rem;
	}

	.mof-modal__submit {
		width: 100%;
	}

	.mof-done {
		padding: 3rem 1.25rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mof-modal *,
	.mof-modal *::before,
	.mof-modal *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	.mof-done__tick {
		stroke-dashoffset: 0;
	}
}
