/*
 * Driver coupon form, public side.
 *
 * Designed as a service job card: a deep petrol header stating the offer, then
 * hairline-ruled sections, with amber as the action colour. Amber rather than
 * the usual blue because this is the signal colour of the vehicle world, and
 * dark text on amber the way a road sign does it.
 *
 * Every selector starts with .ihdc- so no existing theme or plugin style is
 * changed. Nothing here targets body, html, a bare element, or a theme class.
 */

.ihdc-wrap {
	--ihdc-ink: #11242e;
	--ihdc-ink-soft: #5a6b75;
	--ihdc-rule: #dde4e8;
	--ihdc-rule-soft: #eceff1;
	--ihdc-paper: #fff;
	--ihdc-tint: #f5f8f9;
	--ihdc-signal: #f5a524;
	--ihdc-signal-deep: #d98c0a;
	--ihdc-go: #1f7a45;
	--ihdc-go-tint: #eef7f1;
	--ihdc-stop: #b3261e;
	--ihdc-stop-tint: #fdf2f1;

	box-sizing: border-box;
	max-width: 760px;
	margin-inline: auto;

	/* Clear space above the card, set per page by the shortcode's top_gap for
	   themes whose header floats over the content. Zero unless asked for. */
	padding-top: var(--ihdc-gap, 0px);
	color: var(--ihdc-ink);
	font-size: 16px;
	line-height: 1.6;
	text-align: left;
}

.ihdc-wrap *,
.ihdc-wrap *::before,
.ihdc-wrap *::after {
	box-sizing: border-box;
}

/* Many themes decorate headings with an underline, a bar or an all-caps rule
   through ::before / ::after. Those would land in the middle of this card, so
   they are switched off here and nowhere else. */
.ihdc-wrap .ihdc-head__title,
.ihdc-wrap .ihdc-section__title {
	text-transform: none;
	text-align: left;
}

.ihdc-wrap .ihdc-head__title::before,
.ihdc-wrap .ihdc-head__title::after,
.ihdc-wrap .ihdc-section__title::before,
.ihdc-wrap .ihdc-section__title::after {
	content: none;
	display: none;
}

/* ---- The card -------------------------------------------------------- */

.ihdc-card {
	overflow: hidden;
	border: 1px solid var(--ihdc-rule);
	border-radius: 16px;
	background: var(--ihdc-paper);
	box-shadow:
		0 1px 2px rgba(17, 36, 46, .05),
		0 18px 40px -22px rgba(17, 36, 46, .32);
}

.ihdc-head {
	position: relative;
	padding: 2rem 2.25rem 1.75rem;
	background: var(--ihdc-ink);
	color: #fff;
	box-shadow: inset 0 -4px 0 var(--ihdc-signal);
}

.ihdc-head__title {
	margin: 0;
	color: #fff;
	font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.05rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -.02em;
}

.ihdc-head__sub {
	max-width: 52ch;
	margin: .7rem 0 0;
	color: rgba(255, 255, 255, .78);
	font-size: 1rem;
	line-height: 1.55;
}

.ihdc-body {
	padding: 0 2.25rem 2.25rem;
}

/* ---- Sections -------------------------------------------------------- */

.ihdc-section {
	padding-top: 1.9rem;
}

.ihdc-section + .ihdc-section {
	margin-top: 1.9rem;
	border-top: 1px solid var(--ihdc-rule-soft);
}

.ihdc-section__title {
	margin: 0 0 1.15rem;
	color: var(--ihdc-ink);
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -.01em;
}

.ihdc-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.35rem 1.5rem;
}

.ihdc-field--wide {
	grid-column: 1 / -1;
}

/* ---- Fields ---------------------------------------------------------- */

.ihdc-field > label {
	display: block;
	margin-bottom: .45rem;
	color: var(--ihdc-ink);
	font-size: .9375rem;
	font-weight: 600;
	line-height: 1.35;
}

.ihdc-optional {
	margin-left: .45rem;
	color: var(--ihdc-ink-soft);
	font-size: .8125rem;
	font-weight: 400;
}

.ihdc-field input[type="text"],
.ihdc-field input[type="email"],
.ihdc-field input[type="tel"],
.ihdc-field input[type="number"],
.ihdc-field input[type="date"],
.ihdc-field select,
.ihdc-field textarea {
	display: block;
	width: 100%;
	min-height: 52px;
	padding: .8rem 1rem;
	border: 1.5px solid var(--ihdc-rule);
	border-radius: 10px;
	background-color: var(--ihdc-paper);
	color: var(--ihdc-ink);
	font: inherit;
	font-size: 16px; /* Stops iOS zooming in on focus. */
	line-height: 1.4;
	transition: border-color .12s ease, box-shadow .12s ease;
}

.ihdc-field textarea {
	min-height: 112px;
	line-height: 1.55;
	resize: vertical;
}

.ihdc-field .ihdc-numeric {
	font-variant-numeric: tabular-nums;
	letter-spacing: .02em;
}

.ihdc-field input::placeholder,
.ihdc-field textarea::placeholder {
	color: #9aaab4;
	opacity: 1;
}

.ihdc-field input:hover,
.ihdc-field select:hover,
.ihdc-field textarea:hover {
	border-color: #c3ced5;
}

.ihdc-field input:focus,
.ihdc-field select:focus,
.ihdc-field textarea:focus {
	border-color: var(--ihdc-ink);
	box-shadow: 0 0 0 3px rgba(245, 165, 36, .38);
	outline: none;
}

/* Keyboard users still get a ring in forced-colours mode. */
.ihdc-field input:focus-visible,
.ihdc-field select:focus-visible,
.ihdc-field textarea:focus-visible {
	outline: 2px solid transparent;
	outline-offset: 2px;
}

.ihdc-field select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 2.75rem;
	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.6 6 6.4 11 1.6' fill='none' stroke='%235a6b75' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1rem center;
	cursor: pointer;
}

/* Unit tag sitting inside the meter-reading field. */
.ihdc-unit {
	position: relative;
}

.ihdc-unit .ihdc-numeric {
	padding-right: 3.5rem;
}

.ihdc-unit__tag {
	position: absolute;
	top: 50%;
	right: 1rem;
	transform: translateY(-50%);
	color: var(--ihdc-ink-soft);
	font-size: .875rem;
	font-weight: 600;
	pointer-events: none;
}

.ihdc-help {
	margin: .45rem 0 0;
	color: var(--ihdc-ink-soft);
	font-size: .875rem;
	line-height: 1.5;
}

.ihdc-hidden {
	display: none !important;
}

/* ---- Honeypot, off-screen for people, present for bots --------------- */

.ihdc-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

/* ---- Turnstile ------------------------------------------------------- */

.ihdc-section--check {
	padding-top: 1.6rem;
}

/* ---- Terms and conditions -------------------------------------------- */

.ihdc-consent {
	margin-top: 1.9rem;
	padding: 1rem 1.2rem;
	border: 1px solid var(--ihdc-rule);
	border-radius: 10px;
	background: var(--ihdc-tint);
}

.ihdc-check {
	display: flex;
	align-items: flex-start;
	gap: .75rem;
	margin: 0;
	color: var(--ihdc-ink);
	font-size: .9375rem;
	font-weight: 500;
	line-height: 1.5;
	cursor: pointer;
}

.ihdc-check input[type="checkbox"] {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	accent-color: var(--ihdc-signal);
	cursor: pointer;
}

.ihdc-check input[type="checkbox"]:focus-visible {
	outline: 3px solid var(--ihdc-ink);
	outline-offset: 2px;
}

.ihdc-check a {
	color: var(--ihdc-ink);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ---- Actions --------------------------------------------------------- */

.ihdc-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 1.5rem;
	margin-top: 1.9rem;
	padding-top: 1.75rem;
	border-top: 1px solid var(--ihdc-rule-soft);
}

.ihdc-submit {
	flex: 0 0 auto;
	min-height: 54px;
	padding: .9rem 2.1rem;
	border: 0;
	border-radius: 10px;
	background: var(--ihdc-signal);
	color: var(--ihdc-ink);
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: -.005em;
	cursor: pointer;
	transition: background-color .12s ease, transform .08s ease;
}

.ihdc-submit:hover {
	background: var(--ihdc-signal-deep);
	color: var(--ihdc-ink);
}

.ihdc-submit:focus-visible {
	outline: 3px solid var(--ihdc-ink);
	outline-offset: 2px;
}

.ihdc-submit:active {
	transform: translateY(1px);
}

.ihdc-actions__note {
	flex: 1 1 15rem;
	margin: 0;
	color: var(--ihdc-ink-soft);
	font-size: .875rem;
	line-height: 1.5;
}

/* ---- Errors ---------------------------------------------------------- */

.ihdc-alert {
	margin-top: 1.9rem;
	padding: 1.1rem 1.3rem;
	border: 1px solid #f0cdc9;
	border-left: 4px solid var(--ihdc-stop);
	border-radius: 10px;
	background: var(--ihdc-stop-tint);
}

.ihdc-alert__head {
	margin: 0 0 .5rem;
	color: #8d1f18;
	font-size: .9375rem;
	font-weight: 700;
}

.ihdc-alert ul {
	margin: 0;
	padding-left: 1.2rem;
	list-style: disc;
}

.ihdc-alert li {
	margin: .3rem 0;
	color: #6d2420;
	font-size: .9375rem;
	line-height: 1.5;
}

/* ---- Success --------------------------------------------------------- */

.ihdc-head--done {
	background: var(--ihdc-ink);
	box-shadow: inset 0 -4px 0 var(--ihdc-go);
}

.ihdc-head__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin-bottom: 1rem;
	border-radius: 50%;
	background: var(--ihdc-go);
	color: #fff;
}

/* The reference is a tear-off stub: a dashed edge, and the number given the
   weight of a docket number rather than buried in a sentence. */
.ihdc-stub {
	margin-top: 1.9rem;
	padding: 1.4rem 1.6rem;
	border: 1px solid var(--ihdc-rule);
	border-top: 2px dashed var(--ihdc-rule);
	border-radius: 0 0 12px 12px;
	background: var(--ihdc-tint);
	text-align: center;
}

.ihdc-stub__label {
	display: block;
	color: var(--ihdc-ink-soft);
	font-size: .875rem;
}

.ihdc-stub__ref {
	display: block;
	margin: .35rem 0 .5rem;
	color: var(--ihdc-ink);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: clamp(1.5rem, 1.2rem + 1.4vw, 1.95rem);
	font-weight: 700;
	letter-spacing: .08em;
}

.ihdc-stub__note {
	display: block;
	color: var(--ihdc-ink-soft);
	font-size: .875rem;
	line-height: 1.5;
}

.ihdc-next {
	padding-top: 1.9rem;
}

.ihdc-steps {
	margin: 0 0 .9rem;
	padding-left: 1.2rem;
	list-style: disc;
}

.ihdc-steps li {
	margin: .4rem 0;
	line-height: 1.55;
}

/* ---- Narrow screens -------------------------------------------------- */

@media (max-width: 640px) {
	/* A phone header is typically around half the height of the desktop one,
	   so the desktop gap would leave dead space here. Scaled to 60% unless the
	   shortcode gave an exact mobile figure. */
	.ihdc-wrap {
		padding-top: var(--ihdc-gap-mobile, calc(var(--ihdc-gap, 0px) * .6));
	}

	.ihdc-head {
		padding: 1.6rem 1.25rem 1.4rem;
	}

	.ihdc-body {
		padding: 0 1.25rem 1.75rem;
	}

	.ihdc-grid {
		grid-template-columns: 1fr;
		gap: 1.2rem;
	}

	.ihdc-actions {
		gap: .9rem;
	}

	.ihdc-submit {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ihdc-wrap * {
		transition: none !important;
	}

	.ihdc-submit:active {
		transform: none;
	}
}
