/* ==========================================================================
   ACPHARM Prescription Quote Form
   Scoped to .acpq so theme / page-builder styles don't leak in or out.
   Sibling of the Script Order Form's .acprx stylesheet — same tokens,
   same components, minus the multi-step wizard machinery this form doesn't need.
   Override any token below from your theme's custom CSS.
   ========================================================================== */

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

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

	--acpq-font: "Avenir Next", Avenir, "Nunito Sans", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
	--acpq-radius: 14px;
	--acpq-ease: cubic-bezier(.22, .68, .32, 1);

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

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

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

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

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

.acpq-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;
}

/* ---------- Header ---------- */

.acpq-head { padding: .5rem 0 .625rem; border-bottom: 1px solid var(--acpq-line-soft); }
.acpq-brandbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1rem .5rem; }

/* Both higher specificity AND !important: Elementor ships `.elementor img {
   height:auto; max-width:100%; }`, which is more specific than a plain
   `.acpq-logo` class rule (class+type beats class alone) and so overrides it
   even without !important on either side. Repeating the class and qualifying
   with img.acpq-logo pushes our specificity above ".elementor img", and
   !important is the belt-and-braces on top of that. */
.acpq-brandbar img.acpq-logo,
.acpq .acpq-logo.acpq-logo {
	display: block !important;
	height: 38px !important;
	width: auto !important;
	max-width: 160px !important;
	max-height: 38px !important;
	flex: none !important;
	mix-blend-mode: multiply;
}
.acpq-brandbar__tag { margin: 0; text-align: right; font-size: .8125rem; line-height: 1.15; color: var(--acpq-navy); letter-spacing: .01em; }
.acpq-brandbar__tag em { font-style: normal; font-weight: 700; display: block; line-height: 1.1; }

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

.acpq-form { padding: 0 1rem; }
.acpq-step { padding: 1.5rem 0 1rem; }

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

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

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

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

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

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

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

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

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

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

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

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

.acpq-hint { font-size: .9375rem; color: var(--acpq-muted); margin: .375rem 0 0; }

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

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

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

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

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

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

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

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

.acpq-tile__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.acpq-tile__title { font-weight: 700; line-height: 1.3; }
.acpq-tile__sub { font-size: .9375rem; color: var(--acpq-muted); line-height: 1.35; margin-top: .125rem; }

/* Privacy/terms notice — a shortcode's output, rendered just above the consent tick boxes */
.acpq-privacy-notice { font-size: .9375rem; color: var(--acpq-muted); line-height: 1.5; background: var(--acpq-bg); border: 1px solid var(--acpq-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). */
.acpq-privacy-notice :is(p, li, span, div, strong, em, b, i, a, h1, h2, h3, h4, h5, h6) { font-size: inherit !important; }
.acpq-privacy-notice p:first-child { margin-top: 0; }
.acpq-privacy-notice p:last-child { margin-bottom: 0; }
.acpq-privacy-notice a { color: var(--acpq-navy); font-weight: 700; }

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

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

.acpq-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;
	position: relative;
	overflow: hidden;
	-webkit-tap-highlight-color: transparent;
	transition: background-color .15s, border-color .15s;
}
.acpq-btn--primary { background: var(--acpq-brand); color: #fff; }
.acpq-btn--primary:hover { background: var(--acpq-brand-deep); }
.acpq-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(--acpq-green), var(--acpq-lime));
}
.acpq-btn:active { transform: translateY(1px); }
.acpq-btn[disabled], .acpq-btn[aria-busy="true"] { opacity: .65; cursor: progress; }

.acpq-btn--upload {
	position: relative;
	flex: 1;
	background: var(--acpq-surface);
	color: var(--acpq-brand);
	border: 1.5px dashed var(--acpq-brand);
	margin: 0;
	padding: .75rem .5rem;
	white-space: nowrap;
	font-size: 1rem;
}
.acpq-btn--upload:focus-within { outline: 3px solid var(--acpq-green); outline-offset: 2px; }
.acpq-btn--upload:hover { background: var(--acpq-brand-tint); }

/* Sticky action bar — sits in the thumb zone on phones */
.acpq-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(--acpq-surface);
	border-top: 1px solid var(--acpq-line-soft);
}
.acpq-bar #acpq-send { flex: 1; }

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

.acpq-upload { margin-bottom: 1.25rem; }
.acpq-upload__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }

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

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

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

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

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

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

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

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

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

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

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

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

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