/*
	The "Request a home visit" pop-up (home-visit-request.js; Oliver, 3 Oct 2026). Its colours and fonts are the
	--hvr-* settings below, set here to TIW's palette, so another site can restyle it by setting them again. Buttons use
	the site's own .btn and .btn-2.
*/
.hvr {
	--hvr-bg: #10241a;
	--hvr-text: rgba(255, 255, 255, .88);
	--hvr-strong: #fff;
	--hvr-soft: rgba(255, 255, 255, .7);
	--hvr-line: rgba(255, 255, 255, .45);
	--hvr-field: rgba(255, 255, 255, .07);
	--hvr-accent: #D9643A;
	--hvr-error: #ff9c8a;
	--hvr-head: "Avenir Next", "Avenir", "Helvetica Neue", Arial, sans-serif;
	--hvr-body: "Averia Serif Libre", Georgia, serif;
	--hvr-radius: 3px;

	width: min(40rem, calc(100vw - 1.5rem)); max-width: none; max-height: calc(100dvh - 1.5rem);
	margin: auto; padding: 0; border: 0; border-radius: var(--hvr-radius); overflow: auto; overscroll-behavior: contain;
	background: var(--hvr-bg); color: var(--hvr-text);
	box-shadow: inset 3px 0 0 var(--hvr-accent), inset 0 0 0 1px rgba(255, 255, 255, .16), 0 30px 80px -20px rgba(0, 0, 0, .8);
	font: 1rem/1.65 var(--hvr-body);
}
.hvr::backdrop { background: rgba(4, 12, 7, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
html.hvr-open { overflow: hidden; }   /* the page behind doesn't scroll while it's open */
.hvr[open] { animation: hvr-in .25s ease-out; }
@keyframes hvr-in { from { opacity: 0; transform: translateY(.6rem); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hvr[open] { animation: none; } }

.hvr-panel { position: relative; padding: clamp(1.25rem, 4vw, 2rem) clamp(1.1rem, 4vw, 2rem) clamp(1.25rem, 4vw, 1.8rem) calc(clamp(1.1rem, 4vw, 2rem) + 3px); }
.hvr h2 { margin: 0 2.5rem .4rem 0; color: var(--hvr-strong); font: 700 clamp(1.25rem, 4vw, 1.6rem)/1.2 var(--hvr-head); text-transform: uppercase; }
.hvr-intro { margin: 0 0 1.2rem; color: var(--hvr-soft); }
.hvr-close {
	position: absolute; top: .6rem; right: .6rem; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0;
	border: 0; border-radius: 999px; background: none; color: var(--hvr-strong); font: 400 1.9rem/1 var(--hvr-head); cursor: pointer;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3);
}
.hvr-close:hover { box-shadow: inset 0 0 0 1px #fff; }
.hvr :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.hvr-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hvr-field { display: flex; flex-direction: column; gap: .25rem; margin-bottom: 1.3rem; }
.hvr-field label { color: var(--hvr-strong); font: 700 .72rem/1.3 var(--hvr-head); letter-spacing: .14em; text-transform: uppercase; }
.hvr-hint { font-size: .85rem; color: var(--hvr-soft); }

.hvr input, .hvr select, .hvr textarea {
	box-sizing: border-box; max-width: 100%; margin: 0; padding: .45rem .6rem; border: 0; border-radius: var(--hvr-radius);
	background: var(--hvr-field); box-shadow: inset 0 -1.5px 0 var(--hvr-line);
	color: var(--hvr-strong); font: 1rem/1.35 var(--hvr-body);   /* 16px: phones don't zoom in on focus */
	color-scheme: dark;
}
.hvr input::placeholder, .hvr textarea::placeholder { color: rgba(255, 255, 255, .5); }
.hvr input:focus, .hvr select:focus, .hvr textarea:focus { outline: 2px solid #fff; outline-offset: 1px; box-shadow: inset 0 -1.5px 0 var(--hvr-accent); }
.hvr [aria-invalid="true"] { box-shadow: inset 0 -2px 0 var(--hvr-error); background: rgba(255, 120, 100, .1); }
.hvr select option { background: #10241a; color: #fff; }
#hvr-email { width: 100%; }

/* the request itself: a letter with the blanks inline */
.hvr-letter { margin: 0; padding: 0; border: 0; min-width: 0; }
.hvr-letter legend { padding: 0; margin-bottom: .4rem; color: var(--hvr-strong); font: 700 .72rem/1.3 var(--hvr-head); letter-spacing: .14em; text-transform: uppercase; }
.hvr-letter p { margin: 0 0 .6rem; line-height: 2.5; }
.hvr-blank { display: inline-flex; flex-direction: column; vertical-align: top; max-width: 100%; line-height: 1.35; }
.hvr-blank input, .hvr-blank select { display: inline-block; }
.hvr-name input { width: 13rem; }
.hvr-address input { width: 18rem; }
.hvr-phone input { width: 11rem; }
.hvr-date input { min-width: 10.5rem; }
.hvr-time input { min-width: 7.5rem; }
.hvr-notes { display: flex; width: 100%; }
.hvr-notes textarea { width: 100%; resize: vertical; min-height: 4.5rem; }
.hvr-err { display: block; min-height: 0; color: var(--hvr-error); font: 700 .78rem/1.35 var(--hvr-head); }
.hvr-err:empty { display: none; }
.hvr-blank .hvr-err { max-width: 16rem; padding-top: .15rem; }
.hvr-summary { margin: 0 0 1rem; padding: .7rem .9rem; border-radius: var(--hvr-radius); background: rgba(255, 120, 100, .12); box-shadow: inset 3px 0 0 var(--hvr-error); color: var(--hvr-strong); }
.hvr-summary:focus { outline: none; }
.hvr-days { margin: .8rem 0 0; font-size: .85rem; color: var(--hvr-soft); }

/* the hidden field bots fill in: off-screen, never shown */
.hvr-trap { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.hvr-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }
.hvr-send { min-width: 9rem; }
.hvr-send[disabled] { opacity: .65; cursor: progress; }
.hvr-status { margin-top: 1rem; }
.hvr-status:empty { display: none; }
.hvr-status.is-error { padding: .8rem 1rem; border-radius: var(--hvr-radius); background: rgba(255, 120, 100, .1); box-shadow: inset 3px 0 0 var(--hvr-error); }
.hvr-status p { margin: 0 0 .7rem; }
.hvr-status p:last-child { margin-bottom: 0; }
.hvr-small { font-size: .88rem; color: var(--hvr-soft); }
.hvr-status a:not(.btn), .hvr-done a { color: var(--hvr-strong); }

.hvr-done { padding: .4rem 0 0; }
.hvr-done:focus { outline: none; }
.hvr-done-h { margin: 0 0 .6rem; color: var(--hvr-strong); font: 700 1.1rem/1.4 var(--hvr-head); }

@media (max-width: 520px) {
	.hvr { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
	.hvr-letter p { line-height: 1.7; }
	.hvr-blank { display: flex; width: 100%; margin: .3rem 0 .45rem; }
	.hvr-blank input, .hvr-blank select { width: 100% !important; }
	.hvr-blank .hvr-err { max-width: none; }
	.hvr-send { width: 100%; }
	/* the X stays in the corner while the form scrolls */
	.hvr-close { position: fixed; z-index: 2; top: max(.6rem, env(safe-area-inset-top)); right: .6rem; background: var(--hvr-bg); }
}
.hvr.is-sent .hvr-intro { display: none; }
