/* ==========================================================================
   ACPHARM Script Order Form
   Scoped to .acprx so theme / page-builder styles don't leak in or out.
   Override any token below from your theme's custom CSS.
   ========================================================================== */

.acprx {
	/* ACPHARM brand palette (Branding Guideline V.01) */
	--acprx-green: #00af3f;        /* PMS 354 — primary */
	--acprx-lime: #8fd400;         /* PMS 375 — primary */
	--acprx-brand: #00832f;        /* darkened green: meets contrast for text and buttons */
	--acprx-brand-deep: #046a2e;
	--acprx-brand-tint: #e8f7ec;
	--acprx-navy: #39275b;         /* PMS 273 — secondary */
	--acprx-violet: #7474c1;       /* PMS 272 — secondary */
	--acprx-violet-tint: #f1f0f9;
	--acprx-charcoal: #4c4c4e;     /* DS 325-2 C — secondary */

	--acprx-ink: #26222e;
	--acprx-muted: var(--acprx-charcoal);
	--acprx-line: #cfd3d8;
	--acprx-line-soft: #e6e9ec;
	--acprx-bg: #f4f7f4;
	--acprx-surface: #ffffff;
	--acprx-error: #b42318;
	--acprx-error-bg: #fdf0ee;
	--acprx-ok: var(--acprx-brand);

	/* Avenir is the corporate font; Apple devices ship Avenir Next. Nunito Sans is the web stand-in. */
	--acprx-font: "Avenir Next", Avenir, "Nunito Sans", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
	--acprx-sticky-top: 0px;
	--acprx-radius: 14px;
	--acprx-ease: cubic-bezier(.22, .68, .32, 1);

	font-family: var(--acprx-font);
	font-size: 1.0625rem;
	line-height: 1.5;
	color: var(--acprx-ink);
	max-width: 38rem;
	margin: 0 auto;
	-webkit-text-size-adjust: 100%;
}

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

.acprx [hidden] { display: none !important; }

.acprx p { margin: 0 0 .75em; }
.acprx a { color: var(--acprx-brand); text-decoration: underline; text-underline-offset: 2px; }

.acprx :focus-visible {
	outline: 3px solid var(--acprx-brand);
	outline-offset: 2px;
}

.acprx-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* ---------- Progress ---------- */

.acprx-head {
	position: sticky;
	top: var(--acprx-sticky-top);
	z-index: 5;
	background: var(--acprx-surface);
	padding: .5rem 0 .625rem;
	border-bottom: 1px solid var(--acprx-line-soft);
}
.acprx-head.is-stuck { box-shadow: 0 6px 18px -12px rgba(38, 34, 46, .5); }

.acprx-brandbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0 1rem .5rem;
}
.acprx-logo {
	height: 38px;
	width: auto;
	mix-blend-mode: multiply;   /* keeps the logo's white box invisible on tinted backgrounds */
}
.acprx-brandbar__tag {
	margin: 0;
	text-align: right;
	font-size: .8125rem;
	line-height: 1.15;
	color: var(--acprx-navy);
	letter-spacing: .01em;
}
.acprx-brandbar__tag em { font-style: normal; font-weight: 700; display: block; line-height: 1.1; }

.acprx-progress {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0 1rem;
	counter-reset: step;
}

.acprx-progress li {
	counter-increment: step;
	margin: 0;
	font-size: .8125rem;
	line-height: 1.2;
	color: var(--acprx-muted);
}

.acprx-progress li::before {
	content: "";
	display: block;
	height: 5px;
	border-radius: 3px;
	background: var(--acprx-line-soft);
	margin-bottom: 6px;
	background-image: linear-gradient(90deg, var(--acprx-green), var(--acprx-lime));
	background-repeat: no-repeat;
	background-size: 0% 100%;
	transition: background-size .45s var(--acprx-ease);
}

.acprx-progress li span::before { content: counter(step) " "; font-weight: 700; }

.acprx-progress li.is-done::before,
.acprx-progress li.is-current::before { background-size: 100% 100%; }

.acprx-progress li.is-current { color: var(--acprx-navy); font-weight: 700; }

/* ---------- Layout ---------- */

.acprx-form { padding: 0 1rem; }

.acprx-step { display: none; padding: 1.5rem 0 1rem; }
.acprx-step.is-active { display: block; animation: acprx-in .18s ease-out; }

@keyframes acprx-in { from { opacity: 0; } to { opacity: 1; } }

.acprx-title {
	font-family: var(--acprx-font);
	font-size: 1.75rem;
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: -.015em;
	color: var(--acprx-navy);
	margin: 0 0 .5rem;
}
.acprx-title:focus { outline: none; }

.acprx-lede { color: var(--acprx-muted); margin-bottom: 1.25rem; }

.acprx-group {
	border: 0;
	padding: 0;
	margin: 0 0 1.5rem;
	min-width: 0;
}

.acprx-group legend {
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
	padding: 0;
	margin-bottom: .75rem;
	color: var(--acprx-navy);
}

.acprx-row { display: grid; gap: 0 .75rem; }
@media (min-width: 30em) { .acprx-row { grid-template-columns: 1fr 1fr; } }

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

.acprx-field { margin-bottom: 1rem; }

.acprx-field label,
.acprx-upload__label {
	display: block;
	font-weight: 700;
	font-size: 1rem;
	margin-bottom: .375rem;
}

.acprx-opt { font-weight: 400; color: var(--acprx-muted); font-size: .9375rem; }

.acprx input[type="text"],
.acprx input[type="email"],
.acprx input[type="tel"],
.acprx input[type="url"],
.acprx input[type="date"],
.acprx select,
.acprx textarea {
	display: block;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: .75rem .875rem;
	font: inherit;
	font-size: 1.0625rem;
	color: var(--acprx-ink);
	background: var(--acprx-surface);
	border: 1.5px solid var(--acprx-line);
	border-radius: 8px;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.acprx textarea { min-height: 96px; resize: vertical; }

.acprx select {
	padding-right: 2.5rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231a2421' stroke-width='2'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .9rem center;
}

.acprx input:focus,
.acprx select:focus,
.acprx textarea:focus {
	border-color: var(--acprx-brand);
	outline: 3px solid rgba(0, 175, 63, .22);
	outline-offset: 0;
}

.acprx ::placeholder { color: #87938f; opacity: 1; }

.acprx-hint { font-size: .9375rem; color: var(--acprx-muted); margin: .375rem 0 0; }
.acprx-hint--lead { margin: -.25rem 0 .875rem; }

/* Errors */
.acprx :is(input, select, textarea).is-invalid,
.acprx :is(input, select, textarea).is-invalid:focus { border-color: var(--acprx-error); }

.acprx-field-error {
	display: flex;
	gap: .375rem;
	color: var(--acprx-error);
	font-size: .9375rem;
	font-weight: 700;
	margin: .375rem 0 0;
}
.acprx-field-error::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--acprx-error); color: #fff; font-size: .75rem; margin-top: .1rem; }

.acprx-errors {
	background: var(--acprx-error-bg);
	border-left: 4px solid var(--acprx-error);
	border-radius: 0 8px 8px 0;
	padding: .75rem 1rem;
	margin-bottom: 1.25rem;
	color: var(--acprx-ink);
}
.acprx-errors p { margin: 0 0 .25rem; font-weight: 700; }
.acprx-errors ul { margin: 0; padding-left: 1.1rem; }
.acprx-errors a { color: var(--acprx-error); }

/* ---------- Choice tiles ---------- */

.acprx-tiles { display: grid; gap: .625rem; }
@media (min-width: 30em) { .acprx-tiles--pair { grid-template-columns: 1fr 1fr; } }

.acprx-tile {
	position: relative;
	display: flex;
	align-items: center;
	gap: .875rem;
	min-height: 60px;
	padding: .875rem 1rem;
	background: var(--acprx-surface);
	border: 1.5px solid var(--acprx-line);
	border-radius: 10px;
	cursor: pointer;
	margin: 0;
	font-weight: 400;
	-webkit-tap-highlight-color: transparent;
	transition: border-color .15s, background-color .15s;
}

.acprx-tile input {
	flex: none;
	width: 22px; height: 22px;
	margin: 0;
	-webkit-appearance: none;
	appearance: none;
	border: 2px solid var(--acprx-muted);
	border-radius: 50%;
	background: #fff;
	display: grid;
	place-items: center;
}
.acprx-tile input::after {
	content: "";
	width: 10px; height: 10px;
	border-radius: 50%;
	background: var(--acprx-green);
	transform: scale(0);
	transition: transform .22s var(--acprx-ease);
}
.acprx-tile input:checked { border-color: var(--acprx-green); }
.acprx-tile input:checked::after { transform: scale(1); }
.acprx-tile input:focus-visible { outline: 3px solid var(--acprx-brand); outline-offset: 2px; }

.acprx-tile.is-checked {
	border-color: var(--acprx-green);
	background: var(--acprx-brand-tint);
	box-shadow: inset 0 0 0 1px var(--acprx-green);
}
.acprx-tile:active { transform: scale(.99); }
.acprx-tile.is-invalid { border-color: var(--acprx-error); }

.acprx-tile__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.acprx-tile__title { font-weight: 700; line-height: 1.3; }
.acprx-tile__sub { font-size: .9375rem; color: var(--acprx-muted); line-height: 1.35; margin-top: .125rem; }
.acprx-tile__price { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Privacy/terms notice — a shortcode's output, rendered just above the consent tick boxes */
.acprx-privacy-notice { font-size: .9375rem; color: var(--acprx-muted); line-height: 1.5; background: var(--acprx-bg); border: 1px solid var(--acprx-line-soft); border-radius: 10px; padding: .875rem 1rem; margin: 0 0 1rem; }
/* The shortcode's own markup (a page-builder paragraph, a theme's default heading size, an
   inline style) routinely carries a bigger font-size than the form. Only the DESCENDANTS get
   the !important inherit — the wrapper itself must NOT be in this rule, or its own !important
   would beat the admin-set inline style="font-size:…" on the wrapper and the setting would
   never have any visible effect (that was the bug: this rule used to also match the wrapper). */
.acprx-privacy-notice :is(p, li, span, div, strong, em, b, i, a, h1, h2, h3, h4, h5, h6) { font-size: inherit !important; }
.acprx-privacy-notice p:first-child { margin-top: 0; }
.acprx-privacy-notice p:last-child { margin-bottom: 0; }
.acprx-privacy-notice a { color: var(--acprx-navy); font-weight: 700; }

/* Checkboxes */
.acprx-check {
	display: flex;
	gap: .75rem;
	align-items: flex-start;
	margin: 0 0 1rem;
	cursor: pointer;
	font-weight: 400;
}
.acprx-check input {
	flex: none;
	width: 24px; height: 24px;
	margin: 0;
	accent-color: var(--acprx-brand);
}
.acprx-check--required { padding: .875rem 1rem; border: 1.5px solid var(--acprx-line); border-radius: 10px; background: var(--acprx-surface); }
.acprx-check.is-invalid { border-color: var(--acprx-error); }

/* ---------- Buttons ---------- */

.acprx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	min-height: 52px;
	padding: .75rem 1.25rem;
	font: inherit;
	font-weight: 700;
	font-size: 1.0625rem;
	line-height: 1.2;
	border-radius: 10px;
	border: 1.5px solid transparent;
	cursor: pointer;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
	transition: background-color .15s, border-color .15s;
}
.acprx-btn--primary { background: var(--acprx-brand); color: #fff; }
.acprx-btn--primary:hover { background: var(--acprx-brand-deep); }
.acprx-btn--primary::after {
	content: "";
	position: absolute; left: 0; right: 0; bottom: 0;
	height: 3px; border-radius: 0 0 10px 10px;
	background: linear-gradient(90deg, var(--acprx-green), var(--acprx-lime));
}
.acprx-btn { position: relative; overflow: hidden; }
.acprx-btn:active { transform: translateY(1px); }
.acprx-btn--ghost { background: var(--acprx-surface); color: var(--acprx-brand); border-color: var(--acprx-line); }
.acprx-btn--ghost:hover { border-color: var(--acprx-green); }
.acprx-btn[disabled], .acprx-btn[aria-busy="true"] { opacity: .65; cursor: progress; }

.acprx-btn--upload {
	position: relative;
	flex: 1;
	background: var(--acprx-surface);
	color: var(--acprx-brand);
	border: 1.5px dashed var(--acprx-brand);
	margin: 0;
}
.acprx-btn--upload:focus-within { outline: 3px solid var(--acprx-green); outline-offset: 2px; }
.acprx-btn--upload:hover { background: var(--acprx-brand-tint); }

.acprx-link {
	background: none; border: 0; padding: .5rem; margin: -.5rem;
	min-height: 44px;
	font: inherit; font-size: .9375rem; font-weight: 700;
	color: var(--acprx-muted); text-decoration: underline; cursor: pointer;
}
.acprx-link:hover { color: var(--acprx-error); }

.acprx-add { width: 100%; margin-top: .25rem; }

/* Sticky action bar — sits in the thumb zone on phones */
.acprx-bar {
	position: sticky;
	bottom: 0;
	z-index: 4;
	display: flex;
	gap: .625rem;
	margin: 0 -1rem;
	padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px));
	background: var(--acprx-surface);
	border-top: 1px solid var(--acprx-line-soft);
}
.acprx-bar #acprx-next { flex: 1; }

/* ---------- Script card: styled after a dispensing label ---------- */

.acprx-scripts { display: grid; gap: 1rem; margin-bottom: 1rem; }

.acprx-script {
	background: var(--acprx-surface);
	border: 1.5px solid var(--acprx-line);
	border-radius: 14px;
	padding: 0 1rem .25rem;
}

.acprx-script__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 -1rem 1.25rem;
	padding: .875rem 1rem;
	border-bottom: 2px dashed var(--acprx-line);   /* tear-off perforation */
}
.acprx-script {
	background:
		linear-gradient(90deg, var(--acprx-green), var(--acprx-lime)) no-repeat top left / 100% 4px,
		var(--acprx-surface);
	overflow: hidden;
}
.acprx-script__title { margin: 0; font-family: var(--acprx-font); font-size: 1.25rem; font-weight: 700; color: var(--acprx-navy); }

/* ---------- Uploads ---------- */

.acprx-upload { margin-bottom: 1.25rem; }
.acprx-upload__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.acprx-upload__actions .acprx-btn--upload { padding: .75rem .5rem; white-space: nowrap; font-size: 1rem; }

.acprx-files { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .5rem; }

.acprx-file {
	display: grid;
	grid-template-columns: 48px 1fr auto;
	align-items: center;
	gap: .75rem;
	padding: .5rem;
	border: 1px solid var(--acprx-line-soft);
	border-radius: 10px;
	background: var(--acprx-bg);
	margin: 0;
}
.acprx-file__thumb {
	width: 48px; height: 48px; border-radius: 6px;
	object-fit: cover; background: var(--acprx-line-soft);
	display: grid; place-items: center;
	font-size: .75rem; font-weight: 700; color: var(--acprx-muted);
}
.acprx-file__meta { min-width: 0; }
.acprx-file__name { display: block; font-size: .9375rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acprx-file__status { display: block; font-size: .875rem; color: var(--acprx-muted); }
.acprx-file.is-error .acprx-file__status { color: var(--acprx-error); font-weight: 700; }
.acprx-file.is-done .acprx-file__status { color: var(--acprx-ok); }
.acprx-file__bar { height: 4px; border-radius: 2px; background: var(--acprx-line-soft); margin-top: .375rem; overflow: hidden; }
.acprx-file__bar span { display: block; height: 100%; width: 0; background: var(--acprx-brand); transition: width .15s linear; }
.acprx-file.is-done .acprx-file__bar { display: none; }
.acprx-file__x {
	width: 44px; height: 44px;
	border: 0; background: none; border-radius: 8px; cursor: pointer;
	color: var(--acprx-muted); font-size: 1.5rem; line-height: 1;
}
.acprx-file__x:hover { color: var(--acprx-error); background: var(--acprx-error-bg); }

/* Quick-fill chips: one tap instead of typing a familiar answer. */
.acprx-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 0; }
.acprx-chip {
	min-height: 38px;
	padding: .35rem .75rem;
	font: inherit;
	font-size: .875rem;
	font-weight: 700;
	color: var(--acprx-brand);
	background: var(--acprx-brand-tint);
	border: 1.5px solid transparent;
	border-radius: 999px;
	cursor: pointer;
}
.acprx-chip:hover { border-color: var(--acprx-green); }
.acprx-chip:active { transform: scale(.98); }

/* ---------- Notices ---------- */

.acprx-notice {
	display: flex;
	gap: .75rem;
	align-items: flex-start;
	padding: .875rem 1rem;
	margin-bottom: 1.25rem;
	background: var(--acprx-violet-tint);
	border-left: 4px solid var(--acprx-violet);
	border-radius: 0 10px 10px 0;
	color: var(--acprx-ink);
}
.acprx-notice svg { flex: none; color: var(--acprx-navy); margin-top: .1rem; }
.acprx-notice p { margin: 0; }
.acprx-notice__title { font-weight: 700; color: var(--acprx-navy); margin-bottom: .125rem !important; }

.acprx-banner {
	margin: 1rem;
	padding: .875rem 1rem;
	background: var(--acprx-error-bg);
	border-left: 4px solid var(--acprx-error);
	border-radius: 0 8px 8px 0;
	font-weight: 700;
}

/* ---------- Review ---------- */

.acprx-review:empty { display: none; }
.acprx-review {
	background: var(--acprx-surface);
	border: 1.5px solid var(--acprx-line);
	border-radius: 14px;
	margin-bottom: 1.25rem;
	overflow: hidden;
}
.acprx-review h3 {
	margin: 0; padding: .875rem 1rem; color: var(--acprx-navy);
	font-family: var(--acprx-font); font-size: 1.125rem; font-weight: 700;
	border-bottom: 2px dashed var(--acprx-line);
}
.acprx-review dl { margin: 0; padding: .25rem 1rem; }
.acprx-review dl > div {
	display: grid;
	grid-template-columns: 7.5rem 1fr;
	gap: .75rem;
	padding: .625rem 0;
	border-bottom: 1px solid var(--acprx-line-soft);
}
.acprx-review dl > div:last-child { border-bottom: 0; }
.acprx-review dt { color: var(--acprx-muted); font-size: .9375rem; }
.acprx-review dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.acprx-review dd small { display: block; font-weight: 400; color: var(--acprx-muted); font-size: .875rem; }
.acprx-file__x:active { transform: scale(.92); }
.acprx-review__edit {
	background: none; border: 0; padding: 0; margin-top: .125rem;
	font: inherit; font-size: .875rem; font-weight: 700; color: var(--acprx-brand); text-decoration: underline; cursor: pointer;
}
.acprx-review__total {
	display: flex; justify-content: space-between; gap: 1rem;
	padding: .875rem 1rem; background: var(--acprx-brand-tint);
	border-top: 3px solid transparent;
	border-image: linear-gradient(90deg, var(--acprx-green), var(--acprx-lime)) 1;
	font-weight: 700; font-variant-numeric: tabular-nums;
}
.acprx-review__total small { display: block; font-weight: 400; color: var(--acprx-muted); font-size: .875rem; }

.acprx-turnstile { margin: 0 0 1rem; min-height: 0; }

/* Honeypot */
.acprx-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

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

.acprx-done { padding: 2.5rem 1rem 2rem; }
.acprx-done:focus { outline: none; }
.acprx-done__mark { color: var(--acprx-green); margin-bottom: .5rem; }
.acprx-done__wave { display: block; width: 190px; max-width: 60%; height: auto; margin: .25rem 0 1.25rem; }
.acprx-ref { font-size: 1.125rem; }
.acprx-ref strong { font-size: 1.375rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; }

/* Loading state before the session token arrives */
.acprx[data-state="loading"] #acprx-next { opacity: .65; pointer-events: none; }

/* ---------- Larger screens ---------- */

@media (min-width: 48em) {
	.acprx-form { padding: 0 1.5rem; }
	.acprx-bar { position: static; margin: 0; padding: 1rem 0 0; border-top: 0; }
	.acprx-bar #acprx-next { flex: 0 1 16rem; margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
	.acprx *, .acprx *::before, .acprx *::after { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   Motion
   One idea: content arrives from the direction you're travelling, and each
   question settles a beat after the one above it. Everything here is switched
   off by prefers-reduced-motion at the end of the file.
   ========================================================================== */

/* Step change: the incoming step slides in, its questions rise in sequence. */
.acprx-step.is-active { animation: acprx-step-in .34s var(--acprx-ease) both; }
.acprx[data-dir="back"] .acprx-step.is-active { animation-name: acprx-step-in-back; }

@keyframes acprx-step-in {
	from { opacity: 0; transform: translate3d(22px, 0, 0); }
	to   { opacity: 1; transform: none; }
}
@keyframes acprx-step-in-back {
	from { opacity: 0; transform: translate3d(-22px, 0, 0); }
	to   { opacity: 1; transform: none; }
}

/* Question-by-question stagger. */
.acprx-step.is-active > * { animation: acprx-rise .42s var(--acprx-ease) both; }
.acprx-step.is-active > *:nth-child(1) { animation-delay: .04s; }
.acprx-step.is-active > *:nth-child(2) { animation-delay: .09s; }
.acprx-step.is-active > *:nth-child(3) { animation-delay: .14s; }
.acprx-step.is-active > *:nth-child(4) { animation-delay: .19s; }
.acprx-step.is-active > *:nth-child(5) { animation-delay: .24s; }
.acprx-step.is-active > *:nth-child(6) { animation-delay: .29s; }
.acprx-step.is-active > *:nth-child(n+7) { animation-delay: .33s; }

/* Within a group, each field follows the one above it. */
.acprx-step.is-active .acprx-group > .acprx-field,
.acprx-step.is-active .acprx-tiles > * { animation: acprx-rise .4s var(--acprx-ease) both; }
.acprx-step.is-active .acprx-group > .acprx-field:nth-child(2),
.acprx-step.is-active .acprx-tiles > *:nth-child(2) { animation-delay: .05s; }
.acprx-step.is-active .acprx-group > .acprx-field:nth-child(3),
.acprx-step.is-active .acprx-tiles > *:nth-child(3) { animation-delay: .1s; }
.acprx-step.is-active .acprx-group > .acprx-field:nth-child(4),
.acprx-step.is-active .acprx-tiles > *:nth-child(4) { animation-delay: .15s; }
.acprx-step.is-active .acprx-group > .acprx-field:nth-child(n+5),
.acprx-step.is-active .acprx-tiles > *:nth-child(n+5) { animation-delay: .2s; }

@keyframes acprx-rise {
	from { opacity: 0; transform: translate3d(0, 10px, 0); }
	to   { opacity: 1; transform: none; }
}

/* Conditional blocks open and close instead of jumping. */
.acprx-reveal {
	overflow: hidden;
	max-height: 0;
	opacity: 0;
	transform: translate3d(0, -4px, 0);
	transition: max-height .36s var(--acprx-ease), opacity .24s linear, transform .3s var(--acprx-ease), margin .3s var(--acprx-ease);
}
.acprx-reveal.is-open {
	max-height: 160rem;
	opacity: 1;
	transform: none;
}
.acprx-reveal:not(.is-open) { margin-bottom: 0 !important; }

/* Script cards and uploaded files animate in and out. */
.acprx-script { animation: acprx-card-in .4s var(--acprx-ease) both; }
.acprx-script.is-going {
	animation: acprx-card-out .28s var(--acprx-ease) both;
	pointer-events: none;
}
@keyframes acprx-card-in {
	from { opacity: 0; transform: translate3d(0, 16px, 0) scale(.99); }
	to   { opacity: 1; transform: none; }
}
@keyframes acprx-card-out {
	to { opacity: 0; transform: translate3d(0, -8px, 0) scale(.98); max-height: 0; margin-top: -1rem; }
}

.acprx-file { animation: acprx-rise .3s var(--acprx-ease) both; }
.acprx-file.is-done .acprx-file__thumb { animation: acprx-pop .3s var(--acprx-ease); }
@keyframes acprx-pop {
	0%   { transform: scale(1); }
	45%  { transform: scale(1.06); }
	100% { transform: scale(1); }
}

/* Success: the tick draws itself once. */
.acprx-done__mark circle { stroke-dasharray: 140; stroke-dashoffset: 140; animation: acprx-draw .6s var(--acprx-ease) .05s forwards; }
.acprx-done__mark path   { stroke-dasharray: 40; stroke-dashoffset: 40; animation: acprx-draw .35s var(--acprx-ease) .5s forwards; }
@keyframes acprx-draw { to { stroke-dashoffset: 0; } }

/* Sending. */
.acprx-btn[aria-busy="true"] .acprx-btn__label { opacity: .9; }
.acprx-btn[aria-busy="true"]::before {
	content: "";
	width: 18px; height: 18px;
	margin-right: .5rem;
	border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: acprx-spin .7s linear infinite;
}
@keyframes acprx-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.acprx *, .acprx *::before, .acprx *::after { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   Motion
   One idea: content arrives from the direction you're travelling, and each
   question settles a beat after the one above it. Everything here is switched
   off by prefers-reduced-motion at the end of the file.
   ========================================================================== */

/* Step change: the incoming step slides in, its questions rise in sequence. */
.acprx-step.is-active { animation: acprx-step-in .34s var(--acprx-ease) both; }
.acprx[data-dir="back"] .acprx-step.is-active { animation-name: acprx-step-in-back; }

@keyframes acprx-step-in {
	from { opacity: 0; transform: translate3d(22px, 0, 0); }
	to   { opacity: 1; transform: none; }
}
@keyframes acprx-step-in-back {
	from { opacity: 0; transform: translate3d(-22px, 0, 0); }
	to   { opacity: 1; transform: none; }
}

/* Question-by-question stagger. */
.acprx-step.is-active > * { animation: acprx-rise .42s var(--acprx-ease) both; }
.acprx-step.is-active > *:nth-child(1) { animation-delay: .04s; }
.acprx-step.is-active > *:nth-child(2) { animation-delay: .09s; }
.acprx-step.is-active > *:nth-child(3) { animation-delay: .14s; }
.acprx-step.is-active > *:nth-child(4) { animation-delay: .19s; }
.acprx-step.is-active > *:nth-child(5) { animation-delay: .24s; }
.acprx-step.is-active > *:nth-child(6) { animation-delay: .29s; }
.acprx-step.is-active > *:nth-child(n+7) { animation-delay: .33s; }

/* Within a group, each field follows the one above it. */
.acprx-step.is-active .acprx-group > .acprx-field,
.acprx-step.is-active .acprx-tiles > * { animation: acprx-rise .4s var(--acprx-ease) both; }
.acprx-step.is-active .acprx-group > .acprx-field:nth-child(2),
.acprx-step.is-active .acprx-tiles > *:nth-child(2) { animation-delay: .05s; }
.acprx-step.is-active .acprx-group > .acprx-field:nth-child(3),
.acprx-step.is-active .acprx-tiles > *:nth-child(3) { animation-delay: .1s; }
.acprx-step.is-active .acprx-group > .acprx-field:nth-child(4),
.acprx-step.is-active .acprx-tiles > *:nth-child(4) { animation-delay: .15s; }
.acprx-step.is-active .acprx-group > .acprx-field:nth-child(n+5),
.acprx-step.is-active .acprx-tiles > *:nth-child(n+5) { animation-delay: .2s; }

@keyframes acprx-rise {
	from { opacity: 0; transform: translate3d(0, 10px, 0); }
	to   { opacity: 1; transform: none; }
}

/* Conditional blocks open and close instead of jumping. */
.acprx-reveal {
	overflow: hidden;
	max-height: 0;
	opacity: 0;
	transform: translate3d(0, -4px, 0);
	transition: max-height .36s var(--acprx-ease), opacity .24s linear, transform .3s var(--acprx-ease), margin .3s var(--acprx-ease);
}
.acprx-reveal.is-open {
	max-height: 160rem;
	opacity: 1;
	transform: none;
}
.acprx-reveal:not(.is-open) { margin-bottom: 0 !important; }

/* Script cards and uploaded files animate in and out. */
.acprx-script { animation: acprx-card-in .4s var(--acprx-ease) both; }
.acprx-script.is-going {
	animation: acprx-card-out .28s var(--acprx-ease) both;
	pointer-events: none;
}
@keyframes acprx-card-in {
	from { opacity: 0; transform: translate3d(0, 16px, 0) scale(.99); }
	to   { opacity: 1; transform: none; }
}
@keyframes acprx-card-out {
	to { opacity: 0; transform: translate3d(0, -8px, 0) scale(.98); max-height: 0; margin-top: -1rem; }
}

.acprx-file { animation: acprx-rise .3s var(--acprx-ease) both; }
.acprx-file.is-done .acprx-file__thumb { animation: acprx-pop .3s var(--acprx-ease); }
@keyframes acprx-pop {
	0%   { transform: scale(1); }
	45%  { transform: scale(1.06); }
	100% { transform: scale(1); }
}

/* Success: the tick draws itself once. */
.acprx-done__mark circle { stroke-dasharray: 140; stroke-dashoffset: 140; animation: acprx-draw .6s var(--acprx-ease) .05s forwards; }
.acprx-done__mark path   { stroke-dasharray: 40; stroke-dashoffset: 40; animation: acprx-draw .35s var(--acprx-ease) .5s forwards; }
@keyframes acprx-draw { to { stroke-dashoffset: 0; } }

/* Sending. */
.acprx-btn[aria-busy="true"] .acprx-btn__label { opacity: .9; }
.acprx-btn[aria-busy="true"]::before {
	content: "";
	width: 18px; height: 18px;
	margin-right: .5rem;
	border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: acprx-spin .7s linear infinite;
}
@keyframes acprx-spin { to { transform: rotate(360deg); } }

/* Native cross-document-style transition where the browser supports it. */
@media (prefers-reduced-motion: no-preference) {
	::view-transition-old(acprx-step) { animation: acprx-vt-out .22s var(--acprx-ease) both; }
	::view-transition-new(acprx-step) { animation: acprx-step-in .3s var(--acprx-ease) both; }
}
@keyframes acprx-vt-out {
	to { opacity: 0; transform: translate3d(-18px, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
	.acprx *, .acprx *::before, .acprx *::after { animation: none !important; transition: none !important; }
	.acprx-reveal { max-height: none; opacity: 1; transform: none; }
	.acprx-reveal:not(.is-open) { display: none; }
}

/* ---------- Address suggestions ---------- */

/* Each field is a positioning context for its suggestion list. A field with an open
   list is lifted, or the fields below it — also positioned — would paint over it. */
.acprx-field { position: relative; }
.acprx-field.is-searching { z-index: 20; }

.acprx-suggest {
	position: absolute;
	z-index: 6;
	left: 0;
	right: 0;
	margin: 2px 0 0;
	padding: 0;
	list-style: none;
	background: var(--acprx-surface);
	border: 1.5px solid var(--acprx-green);
	border-radius: 10px;
	box-shadow: 0 12px 28px -18px rgba(38, 34, 46, .8);
	overflow: hidden;
}

.acprx-suggest__item {
	margin: 0;
	padding: .75rem 1rem;
	min-height: 48px;
	font-size: 1rem;
	line-height: 1.35;
	cursor: pointer;
	border-bottom: 1px solid var(--acprx-line-soft);
}
.acprx-suggest__item:last-child { border-bottom: 0; }
.acprx-suggest__item:hover,
.acprx-suggest__item.is-active { background: var(--acprx-brand-tint); }

/* While the chosen address is being fetched. */
.acprx input.is-loading {
	background-image: linear-gradient(90deg, var(--acprx-green), var(--acprx-lime));
	background-repeat: no-repeat;
	background-position: bottom left;
	background-size: 40% 3px;
	animation: acprx-slide 1s ease-in-out infinite;
}
@keyframes acprx-slide {
	0%   { background-position: 0% 100%; }
	50%  { background-position: 100% 100%; }
	100% { background-position: 0% 100%; }
}
