/*
 * "Get a Quote": one question at a time (forms/quote-popup.php, js/quote-popup.js).
 *
 * Big answers, one thing to read, and a bar that shows how much is left. Brand colours only, and
 * no font family declared — it inherits the site's, like the page forms do.
 */

.sc-quote {
	--sc-q-red: #FE415F;
	--sc-q-ink: #231F20;
	--sc-q-muted: #6b6466;
	--sc-q-line: #e4dedf;
	--sc-q-blush: #FFF1F4;
	--sc-q-cream: #FBF9F6;
	position: fixed;
	inset: 0;
	/* Above the fixed topbar, which carries z-index 999999 of its own, and above the phone menu. */
	z-index: 1000002;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.sc-quote[hidden] {
	display: none;
}

/* The page behind does not scroll while a question is being answered. */
body.sc-quote-open {
	overflow: hidden;
}

.sc-quote-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(35, 31, 32, .55);
	backdrop-filter: blur(2px);
}

.sc-quote-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(34rem, 100%);
	max-height: min(44rem, 100%);
	border-radius: 1.25rem;
	background: var(--sc-q-cream);
	box-shadow: 0 24px 60px rgba(35, 31, 32, .25);
	overflow: hidden;
}

/* ── The head: how far along, and the way out ───────────────────────────────────────────────── */

.sc-quote-head {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.25rem .75rem;
}

.sc-quote-progress {
	flex: 1;
	height: .4rem;
	border-radius: 1rem;
	background: #efe7e9;
	overflow: hidden;
}

.sc-quote-progress-bar {
	display: block;
	width: 0;
	height: 100%;
	border-radius: 1rem;
	background: var(--sc-q-red);
	transition: width .3s ease;
}

.sc-quote-close {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 1px solid var(--sc-q-line);
	border-radius: 50%;
	background: #fff;
	color: var(--sc-q-ink);
	font-size: .9rem;
	cursor: pointer;
}

/* ── The question ───────────────────────────────────────────────────────────────────────────── */

.sc-quote-body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: .5rem 1.25rem 1.25rem;
}

.sc-quote-step-count {
	margin: 0 0 .35rem;
	color: var(--sc-q-muted);
	font-size: .8rem;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.sc-quote-title {
	margin: 0 0 .25rem;
	color: var(--sc-q-ink);
	font-size: 1.5rem;
	line-height: 1.2;
	text-wrap: balance;
}

.sc-quote-hint {
	margin: 0 0 1rem;
	color: var(--sc-q-muted);
	font-size: .95rem;
	line-height: 1.5;
}

.sc-quote-hint[hidden] {
	display: none;
}

.sc-quote-step {
	display: flex;
	flex-direction: column;
	gap: .85rem;
	margin-top: 1rem;
}

/* ── Answers ────────────────────────────────────────────────────────────────────────────────── */

.sc-quote-field {
	display: block;
}

.sc-quote-field-label {
	display: block;
	margin-bottom: .35rem;
	color: var(--sc-q-ink);
	font-size: .9rem;
	font-weight: 600;
}

.sc-quote-input {
	display: block;
	width: 100%;
	padding: .9rem 1rem;
	border: 1px solid var(--sc-q-line);
	border-radius: .85rem;
	background: #fff;
	color: var(--sc-q-ink);
	/* 1rem or more, so iOS does not zoom the page when a box is tapped. */
	font-size: 1rem;
	font-family: inherit;
	line-height: 1.4;
}

.sc-quote-input:focus {
	outline: none;
	border-color: var(--sc-q-red);
	box-shadow: 0 0 0 3px rgba(254, 65, 95, .15);
}

textarea.sc-quote-input {
	resize: vertical;
	min-height: 7rem;
}

/* A whole row per answer: easy to hit with a thumb, and readable at a glance. */
.sc-quote-choices {
	display: flex;
	flex-direction: column;
	gap: .6rem;
}

.sc-quote-choice {
	display: block;
	width: 100%;
	padding: 1rem 1.15rem;
	border: 2px solid var(--sc-q-line);
	border-radius: .9rem;
	background: #fff;
	color: var(--sc-q-ink);
	font-size: 1.05rem;
	font-family: inherit;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease;
}

.sc-quote-choice.is-on {
	border-color: var(--sc-q-red);
	background: var(--sc-q-blush);
}

@media (hover: hover) {
	.sc-quote-choice:hover {
		border-color: var(--sc-q-red);
	}
}

.sc-quote-choice:focus-visible,
.sc-quote-input:focus-visible {
	outline: 2px solid var(--sc-q-red);
	outline-offset: 2px;
}

.sc-quote-ticks {
	display: flex;
	flex-direction: column;
	gap: .6rem;
}

.sc-quote-tick {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .85rem 1rem;
	border: 2px solid var(--sc-q-line);
	border-radius: .9rem;
	background: #fff;
	font-size: 1rem;
	line-height: 1.35;
	cursor: pointer;
}

.sc-quote-tick.is-on {
	border-color: var(--sc-q-red);
	background: var(--sc-q-blush);
}

.sc-quote-tick input {
	flex: none;
	width: 1.1rem;
	height: 1.1rem;
	accent-color: var(--sc-q-red);
}

/* ── Notes and errors ───────────────────────────────────────────────────────────────────────── */

.sc-quote-note {
	margin: 0;
	font-size: .9rem;
	line-height: 1.5;
}

.sc-quote-note p {
	margin: 0;
}

.sc-quote-note p + p {
	margin-top: .5rem;
}

.sc-quote-note--info {
	color: var(--sc-q-muted);
}

.sc-quote-note--warn {
	color: #a15c00;
}

.sc-quote-note--safety {
	padding: 1rem 1.1rem;
	border: 1.5px solid #FFD980;
	border-radius: .9rem;
	background: #FFF8E7;
	color: #664400;
}

.sc-quote-note-title {
	margin-bottom: .35rem !important;
	color: #996600;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.sc-quote-error {
	margin: 1rem 0 0;
	padding: .75rem 1rem;
	border: 1px solid var(--sc-q-red);
	border-radius: .75rem;
	background: var(--sc-q-blush);
	color: var(--sc-q-red);
	font-size: .9rem;
}

/* ── Sent ───────────────────────────────────────────────────────────────────────────────────── */

.sc-quote-tick-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	background: var(--sc-q-red);
	color: #fff;
	font-size: 1.5rem;
}

.sc-quote-sent {
	margin: 0;
	color: var(--sc-q-muted);
	font-size: 1rem;
	line-height: 1.55;
}

.sc-quote-sent--test {
	color: var(--sc-q-red);
	font-size: .85rem;
}

/* ── The foot ───────────────────────────────────────────────────────────────────────────────── */

.sc-quote-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.25rem 1.25rem;
	border-top: 1px solid var(--sc-q-line);
	background: var(--sc-q-cream);
}

.sc-quote-back {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .75rem .5rem;
	border: 0;
	background: none;
	color: var(--sc-q-muted);
	font-size: .95rem;
	font-family: inherit;
	font-weight: 600;
	cursor: pointer;
}

.sc-quote-back[hidden] {
	display: none;
}

.sc-quote-next {
	margin-left: auto;
	padding: .85rem 2rem;
	border: 0;
	border-radius: 2rem;
	background: var(--sc-q-red);
	color: #fff;
	font-size: 1rem;
	font-family: inherit;
	font-weight: 700;
	cursor: pointer;
}

.sc-quote-next[disabled] {
	opacity: .6;
	cursor: progress;
}

/* ── On a phone it is the whole screen ──────────────────────────────────────────────────────── */

@media (max-width: 575.98px) {
	.sc-quote {
		padding: 0;
	}

	.sc-quote-dialog {
		width: 100%;
		max-height: 100%;
		height: 100%;
		border-radius: 0;
	}

	.sc-quote-title {
		font-size: 1.35rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sc-quote-progress-bar {
		transition: none;
	}
}
