/* ==========================================================================
 * John Morley quote form — inline and pop-up (mockup: .qf / .pop).
 * A white card: a progress bar of one segment per step, "Step x of 6", the
 * question in display capitals, then the answers; Back, Finish later and
 * Continue along the bottom. In the pop-up the card has a fixed height: the
 * question stays at the top and the buttons at the bottom, only the answers
 * scroll.
 * ======================================================================== */

.jmf { --jmf-ink: var(--slate, #2B2B2D); --jmf-line: var(--line, #D5D5D3); --jmf-mute: var(--mute, #5F6668);
	position: relative; display: flex; flex-direction: column; min-width: 0; scroll-margin-top: 100px; /* clear the sticky header */ border-radius: var(--r, 4px); background: #fff; font: 400 16px/1.55 var(--body, "Public Sans", system-ui, sans-serif); color: var(--jmf-ink); text-align: left; }
.jmf *, .jmf *::before, .jmf *::after { box-sizing: border-box; }
.jmf svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.jmf__sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.jmf__form { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; }
.jmf__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* top: progress and count (text elements carry .jmf so their margins outrank `.jm p { margin: 0 }`) */
.jmf__top { flex: none; padding: 24px 28px 0; }
.jmf__bar { display: flex; gap: 4px; margin-bottom: 18px; }
.jmf__bar i { flex: 1; height: 4px; border-radius: 2px; background: var(--jmf-line); transition: background-color .3s; }
.jmf__bar i.is-done { background: var(--clay, #F26B1D); }
.jmf .jmf__count { display: flex; justify-content: space-between; gap: 12px; margin: 0; font-size: 13.5px; font-weight: 600; color: var(--jmf-mute); }
.jmf__saved { display: inline-flex; align-items: center; gap: 6px; color: var(--jmf-mute); font-weight: 500; }
.jmf__saved::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--clay, #F26B1D); }
.jmf__saved[hidden] { display: none; }

/* body: one step at a time */
.jmf__body { flex: 1; min-height: 0; padding: 4px 28px 20px; }
.jmf__step { min-width: 0; margin: 0; padding: 0; border: 0; }
.jmf__step[hidden] { display: none; }
.jmf__step.in-next { animation: jmf-in-next .4s var(--ease, ease); }
.jmf__step.in-prev { animation: jmf-in-prev .4s var(--ease, ease); }
@keyframes jmf-in-next { from { opacity: 0; transform: translateX(18px); } }
@keyframes jmf-in-prev { from { opacity: 0; transform: translateX(-18px); } }
.jmf .jmf__h { display: block; float: none; width: 100%; margin: 0; padding: 0; font: 800 34px/1 var(--font-display, "Big Shoulders Display", sans-serif); letter-spacing: .005em; text-transform: uppercase; color: var(--jmf-ink); outline: none; }
.jmf .jmf__help { margin: 6px 0 0; max-width: 56ch; font-size: 15px; color: var(--jmf-mute); }
.jmf__fields { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 20px; }
.jmf__f { flex: 1 1 100%; min-width: 0; }
.jmf__f.is-half { flex: 1 1 calc(50% - 6px); }
.jmf .jmf__label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--jmf-ink); }
.jmf__f--choice:not(:first-child) .jmf__label { margin: 8px 0 10px; font-size: 15px; font-weight: 700; }
.jmf .jmf__fhelp { margin: -2px 0 8px; font-size: 13.5px; color: var(--jmf-mute); }
.jmf input[type=text], .jmf input[type=email], .jmf input[type=tel], .jmf textarea { width: 100%; min-height: 50px; margin: 0; padding: 12px 14px; border: 1px solid var(--jmf-line); border-radius: var(--r, 4px); background: #fff; box-shadow: none; font: 400 16px/1.4 var(--body, sans-serif); color: var(--jmf-ink); transition: border-color .2s, box-shadow .2s; }
.jmf textarea { min-height: 120px; resize: vertical; }
.jmf input::placeholder, .jmf textarea::placeholder { color: #8E9396; }
.jmf input:focus, .jmf textarea:focus { outline: none; border-color: var(--jmf-ink); box-shadow: 0 0 0 1px var(--jmf-ink); }
.jmf__f--postcode input { text-transform: uppercase; letter-spacing: .03em; }
.jmf__f.is-bad input, .jmf__f.is-bad textarea { border-color: var(--clay, #F26B1D); box-shadow: 0 0 0 1px var(--clay, #F26B1D); }
.jmf .jmf__ferr { margin: 8px 0 0; font-size: 14.5px; font-weight: 600; color: var(--clay-ink, #B84A0A); }
.jmf__ferr[hidden], .jmf__note[hidden] { display: none; }

/* choices: hidden inputs, the <span> is the visible answer */
.jmf__opts { display: grid; gap: 10px; }
.jmf__opt { position: relative; display: block; margin: 0; cursor: pointer; }
.jmf__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.jmf__opt span { position: relative; display: grid; align-items: center; gap: 8px; width: 100%; border: 1px solid var(--jmf-line); border-radius: var(--r, 4px); background: #fff; color: var(--jmf-ink); transition: border-color .2s, background-color .2s, color .2s, box-shadow .2s; }
.jmf__opt b { font-size: 16px; font-weight: 700; line-height: 1.25; }
.jmf__opt small { display: block; margin-top: 2px; font-size: 14px; font-weight: 400; line-height: 1.4; color: var(--jmf-mute); }
.jmf__opt:hover span { border-color: var(--lead, #808286); }
.jmf__opt input:focus-visible + span { outline: 2px solid var(--clay, #F26B1D); outline-offset: 2px; }
.jmf__opt input:checked + span { border-color: var(--jmf-ink); background: var(--lime, #F2F2F1); box-shadow: inset 0 0 0 1px var(--jmf-ink); }

/* tiles: icon over the label, a clay tick when chosen */
.jmf__f--tiles .jmf__opts { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.jmf__f--tiles .jmf__opt span { align-content: start; min-height: 96px; padding: 14px; }
.jmf__f--tiles .jmf__opt svg { width: 30px; height: 30px; color: var(--clay, #F26B1D); stroke-width: 1.5; }
.jmf__f--tiles .jmf__opt b { font-size: 15px; }
.jmf__f--tiles .jmf__opt input:checked + span::after { content: ""; position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--clay, #F26B1D) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center / 11px no-repeat; }

/* list: a radio dot on the left, label and its small line */
.jmf__f--list .jmf__opts { grid-template-columns: minmax(0, 1fr); }
.jmf__f--list .jmf__opt span { grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 15px 16px; }
.jmf__f--list .jmf__opt span > i { width: 20px; height: 20px; border: 1.5px solid var(--lead-l, #C3C5C8); border-radius: 50%; transition: border-width .15s, border-color .15s; }
.jmf__f--list .jmf__opt input:checked + span > i { border: 6px solid var(--clay, #F26B1D); }

/* chips: pills, slate when chosen */
.jmf__f--chips .jmf__opts { display: flex; flex-wrap: wrap; gap: 8px; }
.jmf__f--chips .jmf__opt span { display: inline-flex; min-height: 42px; padding: 0 16px; border-radius: 999px; }
.jmf__f--chips .jmf__opt b { font-size: 15px; font-weight: 600; }
.jmf__f--chips .jmf__opt input:checked + span { border-color: var(--jmf-ink); background: var(--jmf-ink); color: #fff; box-shadow: none; }

/* the "leaking now" note */
.jmf .jmf__note { margin: 14px 0 0; padding: 14px 16px; border-left: 4px solid var(--clay, #F26B1D); background: var(--clay-soft, #FDEBDD); font-size: 15px; color: var(--jmf-ink); }
.jmf .jmf__note a { font-weight: 700; color: var(--clay-ink, #B84A0A); }

/* consent */
.jmf__check { position: relative; display: flex; gap: 10px; align-items: flex-start; margin-top: 6px; cursor: pointer; font-size: 14.5px; color: var(--jmf-ink); }
.jmf__check input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.jmf__check i { flex: none; width: 18px; height: 18px; margin-top: 2px; border: 1.5px solid var(--lead-l, #C3C5C8); border-radius: 3px; background: #fff; transition: background-color .2s, border-color .2s; }
.jmf__check input:checked + i { border-color: var(--clay, #F26B1D); background: var(--clay, #F26B1D) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center / 12px no-repeat; }
.jmf__check input:focus-visible + i { outline: 2px solid var(--clay, #F26B1D); outline-offset: 2px; }
.jmf__f.is-bad .jmf__check i { border-color: var(--clay, #F26B1D); }

/* photos */
.jmf__drop { position: relative; display: grid; place-items: center; gap: 6px; min-height: 110px; margin: 0; padding: 18px; border: 1.5px dashed var(--lead-l, #C3C5C8); border-radius: var(--r, 4px); background: var(--lime, #F2F2F1); text-align: center; cursor: pointer; font-size: 15px; transition: border-color .2s; }
.jmf__drop:hover, .jmf__drop.is-over { border-color: var(--clay, #F26B1D); }
.jmf__drop svg { width: 28px; height: 28px; color: var(--lead, #808286); }
.jmf__drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.jmf .jmf__files { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.jmf__files li { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--lime-2, #E6E6E4); }
.jmf__files li.is-busy { opacity: .7; }
.jmf__files span { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; }
.jmf__files span b { overflow: hidden; max-width: 22ch; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.jmf__files small { color: var(--jmf-mute); }
.jmf .jmf__files button, .jmf .jmf__files button:hover, .jmf .jmf__files button:focus { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background-color: transparent; color: var(--jmf-mute); cursor: pointer; }
.jmf .jmf__files button:hover { background-color: #fff; color: var(--jmf-ink); }
.jmf__files button svg { width: 14px; height: 14px; }
.jmf__prog { display: block; width: 44px; height: 4px; margin-right: 8px; border-radius: 2px; background: #fff; overflow: hidden; }
.jmf__prog b { display: block; width: 0; height: 100%; background: var(--clay, #F26B1D); transition: width .2s; }

/* error, foot */
.jmf .jmf__err { margin: 0 28px 12px; padding: 12px 14px; border-left: 4px solid var(--clay, #F26B1D); background: var(--clay-soft, #FDEBDD); font-size: 14.5px; font-weight: 600; color: var(--clay-ink, #B84A0A); }
.jmf__err[hidden] { display: none; }
.jmf__foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 28px 22px; border-top: 1px solid var(--jmf-line); }
/* buttons carry .jmf and restate background-color on hover/focus: Hello paints buttons magenta */
.jmf .jmf__back, .jmf .jmf__back:hover, .jmf .jmf__back:focus { min-height: 50px; margin: 0; padding: 0 16px; border: 0; border-radius: var(--r, 4px); background-color: transparent; font: 700 16px/1 var(--body, sans-serif); color: var(--jmf-ink); cursor: pointer; }
.jmf .jmf__back:hover { color: var(--clay-ink, #B84A0A); }
.jmf .jmf__back[hidden] { display: inline-block; visibility: hidden; }
.jmf .jmf__later-btn, .jmf .jmf__later-btn:hover, .jmf .jmf__later-btn:focus { margin: 0; padding: 4px 0; border: 0; background-color: transparent; font: 400 14px/1.3 var(--body, sans-serif); color: var(--jmf-mute); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.jmf .jmf__later-btn:hover { color: var(--jmf-ink); }
.jmf .jmf__next, .jmf .jmf__next:focus { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; margin: 0 0 0 auto; padding: 0 24px; border: 2px solid transparent; border-radius: var(--r, 4px); background-color: var(--clay, #F26B1D); font: 700 16px/1.2 var(--body, sans-serif); letter-spacing: 0; text-transform: none; color: var(--on-clay, #161616); cursor: pointer; transition: background-color .2s; }
.jmf .jmf__next:hover, .jmf .jmf__next:focus-visible { background-color: var(--clay-ink, #B84A0A); color: var(--on-clay, #161616); }
.jmf.is-busy .jmf__next { pointer-events: none; opacity: .65; }
.jmf.is-busy .jmf__next::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: jmf-spin .7s linear infinite; }
@keyframes jmf-spin { to { transform: rotate(360deg); } }

/* finish later: email me a link */
.jmf__later { flex: none; padding: 0 28px; }
.jmf__later-row { display: grid; gap: 8px; padding: 0 0 18px; }
.jmf__later-row[hidden] { display: none; }
.jmf .jmf__later-row p { margin: 0; font-size: 14px; color: var(--jmf-mute); }
.jmf__later-row div { display: flex; gap: 8px; max-width: 460px; }
.jmf .jmf__later-row input { min-height: 44px; padding: 8px 12px; }
.jmf .jmf__later-row button, .jmf .jmf__later-row button:hover, .jmf .jmf__later-row button:focus { flex: none; margin: 0; padding: 0 16px; border: 2px solid var(--jmf-ink); border-radius: var(--r, 4px); background-color: #fff; font: 700 14px var(--body, sans-serif); color: var(--jmf-ink); cursor: pointer; }
.jmf .jmf__later-row button:hover { background-color: var(--jmf-ink); color: #fff; }
.jmf .jmf__later-msg { margin: 0 0 16px; font-size: 14px; color: var(--jmf-mute); }
.jmf__later-msg:empty { display: none; }
.jmf .jmf__small { margin: 0; padding: 0 28px 18px; font-size: 12.5px; color: var(--jmf-mute); }
.jmf__small a { color: inherit; }

/* done */
.jmf__done { display: grid; gap: 14px; justify-items: start; padding: 20px 0 24px; animation: jmf-in-next .45s var(--ease, ease); }
.jmf__done[hidden], .jmf__done-extra[hidden] { display: none; }
.jmf__done-ic { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--clay, #F26B1D); color: var(--on-clay, #161616); }
.jmf__done-ic svg { width: 30px; height: 30px; stroke-width: 2.4; }
.jmf .jmf__done .jmf__h { font-size: 40px; }
.jmf .jmf__done-text p, .jmf .jmf__done-extra { margin: 0 0 8px; max-width: 46ch; color: var(--slate-2, #3B3B3E); }
.jmf__done-extra a { color: var(--clay-ink, #B84A0A); }
.jmf.is-done .jmf__foot, .jmf.is-done .jmf__later, .jmf.is-done .jmf__count, .jmf.is-done .jmf__small { display: none; }

/* ═════════ pop-up ═════════ */
/* above everything, including floating chat buttons (Sky360 WhatsApp is 999999) */
.jm.jmpop { position: fixed; inset: 0; z-index: 1000001; display: grid; place-items: center; padding: 24px; overscroll-behavior: contain; }
.jm.jmpop[hidden] { display: none; }
.jmpop__scrim { position: absolute; inset: 0; background: rgba(43, 43, 45, .6); opacity: 0; transition: opacity .25s; }
.jmpop.is-open .jmpop__scrim { opacity: 1; }
.jmpop__card { position: relative; display: flex; flex-direction: column; width: min(760px, 100%); height: min(720px, calc(100vh - 48px)); height: min(720px, calc(100dvh - 48px)); overflow: hidden; border-radius: var(--r, 4px); background: #fff; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .55); outline: none; opacity: 0; transform: translateY(18px); transition: opacity .25s, transform .35s var(--ease, ease); }
.jmpop.is-open .jmpop__card { opacity: 1; transform: none; }
.jm .jmpop__card:focus, .jm .jmpop__card:focus-visible, .jmf .jmf__h:focus-visible { outline: none; }
.jm .jmpop__x, .jm .jmpop__x:hover, .jm .jmpop__x:focus { position: absolute; top: 10px; right: 10px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background-color: transparent; color: var(--slate, #2B2B2D); cursor: pointer; }
.jm .jmpop__x:hover { background-color: var(--lime, #F2F2F1); }
.jmpop__x svg { width: 24px; height: 24px; }
.jm .jmpop__h { flex: none; margin: 0; padding: 22px 64px 0 28px; font: 800 18px/1 var(--font-display, sans-serif); letter-spacing: .04em; text-transform: uppercase; color: var(--lead, #808286); }
/* fixed height: question pinned at the top, buttons at the bottom, only the answers scroll */
.jmpop .jmf { flex: 1; min-height: 0; border-radius: 0; }
.jmpop .jmf__top { padding-top: 14px; }
.jmpop .jmf__body { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.jmpop .jmf__step:not([hidden]), .jmpop .jmf__done:not([hidden]) { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.jmpop .jmf__done:not([hidden]) { display: grid; align-content: start; overflow-y: auto; }
.jmpop .jmf__step .jmf__h, .jmpop .jmf__step .jmf__help { flex: none; }
.jmpop .jmf__fields { flex: 1; min-height: 0; align-content: flex-start; overflow-y: auto; overscroll-behavior: contain; margin: 0 -6px; padding: 20px 6px 20px; }

/* ═════════ responsive ═════════ */
@media (max-width: 640px) {
	.jmf__top, .jmf__body { padding-left: 18px; padding-right: 18px; }
	.jmf .jmf__err { margin-left: 18px; margin-right: 18px; }
	.jmf__foot { padding: 14px 18px 18px; }
	.jmf__later, .jmf .jmf__small { padding-left: 18px; padding-right: 18px; }
	.jmf .jmf__h { font-size: 30px; }
	.jmf__f.is-half { flex-basis: 100%; }
	.jmf__f--tiles .jmf__opts { grid-template-columns: 1fr 1fr; }
	.jm.jmpop { padding: 0; }
	.jmpop__card { width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
	.jmpop .jmf__foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 640px) {
	.jmf .jmf__later-btn, .jmf .jmf__later-btn:hover, .jmf .jmf__later-btn:focus { min-height: 44px; padding: 12px 0; }
	/* compact tiles (icon beside the label) so a step's choices fit the screen without scrolling inside the pop-up */
	.jmf__f--tiles .jmf__opts { grid-template-columns: 1fr 1fr; gap: 8px; }
	.jmf__f--tiles .jmf__opt span { grid-template-columns: 22px minmax(0, 1fr); align-content: center; gap: 10px; min-height: 58px; padding: 9px 30px 9px 11px; }
	.jmf__f--tiles .jmf__opt svg { width: 22px; height: 22px; }
	.jmf__f--tiles .jmf__opt b { font-size: 14.5px; line-height: 1.2; }
	.jmf__f--tiles .jmf__opt { display: grid; } /* tiles in a row share its height */
	.jmf__f--tiles .jmf__opt span { height: 100%; }
	.jmf__f--tiles .jmf__opt input:checked + span::after { top: 50%; right: 8px; margin-top: -9px; }
}
/* short phones (iPhone SE and similar): a tighter heading and tiles so step 1 still fits */
@media (max-width: 640px) and (max-height: 720px) {
	.jmpop .jmpop__h { padding-top: 16px; }
	.jmpop .jmf__top { padding-top: 10px; }
	.jmpop .jmf__step .jmf__h { font-size: 26px; }
	.jmpop .jmf__step .jmf__help { margin-top: 6px; font-size: 15px; }
	.jmf__f--tiles .jmf__opts { gap: 6px; }
	.jmf__f--tiles .jmf__opt span { min-height: 44px; padding: 6px 24px 6px 10px; gap: 8px; }
	.jmf__f--tiles .jmf__opt b { font-size: 14px; }
	.jmpop .jmf__fields { padding-top: 12px; padding-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
	.jmf *, .jmpop * { animation: none !important; transition: none !important; }
}
