/* ==========================================================================
   ACPHARM Contact Form
   Scoped to .acps 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.
   ========================================================================== */

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

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

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

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

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

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

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

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

.acps-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 ---------- */

.acps-head { padding: .5rem 0 .625rem; border-bottom: 1px solid var(--acps-line-soft); }
.acps-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
   `.acps-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.acps-logo pushes our specificity above ".elementor img", and
   !important is the belt-and-braces on top of that. */
.acps-brandbar img.acps-logo,
.acps .acps-logo.acps-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;
}
.acps-brandbar__tag { margin: 0; text-align: right; font-size: .8125rem; line-height: 1.15; color: var(--acps-navy); letter-spacing: .01em; }
.acps-brandbar__tag em { font-style: normal; font-weight: 700; display: block; line-height: 1.1; }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.acps-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;
}
.acps-btn--primary { background: var(--acps-brand); color: #fff; }
.acps-btn--primary:hover { background: var(--acps-brand-deep); }
.acps-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(--acps-green), var(--acps-lime));
}
.acps-btn:active { transform: translateY(1px); }
.acps-btn[disabled], .acps-btn[aria-busy="true"] { opacity: .65; cursor: progress; }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* ==========================================================================
   Contact form additions
   ========================================================================== */

/* Topic tiles: lighter and shorter than the quote form's two big tiles, since there are six. */
.acps-tiles--compact .acps-tile { min-height: 52px; padding: .625rem .875rem; }

/* Shortcuts to the Quote and Order Script pages */
.acps-shortcuts { margin: 0 0 1.5rem; }
.acps-shortcuts__intro { font-size: .9375rem; font-weight: 700; color: var(--acps-muted); margin: 0 0 .5rem !important; }
.acps-shortcuts__row { display: grid; gap: .5rem; }
@media (min-width: 30em) { .acps-shortcuts__row { grid-template-columns: 1fr 1fr; } }
.acps a.acps-shortcut {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 0 .5rem;
	padding: .75rem 1rem;
	border-radius: 10px;
	background: var(--acps-violet-tint);
	border: 1.5px solid transparent;
	color: var(--acps-navy);
	text-decoration: none;
	transition: border-color .15s, background-color .15s;
}
.acps a.acps-shortcut:hover { border-color: var(--acps-violet); }
.acps-shortcut__title { font-weight: 700; line-height: 1.3; }
.acps-shortcut__sub { grid-column: 1; font-size: .875rem; color: var(--acps-muted); line-height: 1.35; }
.acps-shortcut__arrow { grid-column: 2; grid-row: 1 / span 2; color: var(--acps-violet); }

/* Optional attachment — collapsed by default so the form stays short */
.acps details.acps-upload { border: 1.5px dashed var(--acps-line); border-radius: 10px; padding: .75rem 1rem; }
.acps details.acps-upload[open] { border-style: solid; }
.acps details.acps-upload > summary { cursor: pointer; margin: 0; list-style: none; display: flex; align-items: center; gap: .5rem; }
.acps details.acps-upload > summary::-webkit-details-marker { display: none; }
.acps details.acps-upload > summary::before { content: "+"; display: inline-grid; place-items: center; width: 1.375rem; height: 1.375rem; border-radius: 50%; background: var(--acps-brand-tint); color: var(--acps-brand); font-weight: 700; flex: none; }
.acps details.acps-upload[open] > summary::before { content: "–"; }
.acps details.acps-upload[open] > summary { margin-bottom: .5rem; }
.acps details.acps-upload .acps-upload__actions { margin-top: .75rem; }

/* ---------- S2/S3 additions ---------- */

.acps-section {
	display: flex; align-items: center; gap: .625rem;
	margin: 2rem 0 .375rem; padding-top: 1.25rem; border-top: 1px solid var(--acps-line-soft);
	font-family: var(--acps-font); font-size: 1.25rem; line-height: 1.25; font-weight: 700; color: var(--acps-navy);
}
.acps-section:first-of-type { margin-top: 1.25rem; }
.acps-section__n {
	flex: none; display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%;
	background: var(--acps-brand-tint); color: var(--acps-brand-deep); font-size: .9375rem;
}
.acps-section__hint { margin: 0 0 1rem; }

.acps-notice {
	display: block;
	background: var(--acps-violet-tint); border-left: 4px solid var(--acps-violet); border-radius: 0 10px 10px 0;
	padding: .875rem 1rem; margin: 0 0 1.25rem; font-size: .9375rem; line-height: 1.5; color: var(--acps-ink);
}
.acps-notice p { margin: 0; }
.acps-notice__title { font-weight: 700; color: var(--acps-navy); margin-bottom: .25rem !important; }
.acps-notice--warn { background: #fff7e6; border-left-color: #c77700; }
.acps-notice--warn .acps-notice__title { color: #7a4a00; }

.acps-sub { border-left: 3px solid var(--acps-line-soft); padding-left: .875rem; margin: -.25rem 0 1.25rem; }
.acps-upload { margin: .25rem 0 1.25rem; }

@media (min-width: 30em) { .acps-row--3 { grid-template-columns: 1.4fr .8fr .8fr; } }

.acps-group--yesno { margin-bottom: 1rem; }
.acps-group--yesno legend { font-size: 1rem; }
.acps-group--yesno .acps-tiles { grid-template-columns: 1fr 1fr; max-width: 20rem; }

.acps input[type="date"] { -webkit-appearance: none; appearance: none; text-align: left; }

.acps-sign { margin-top: 1.25rem; }
.acps-sign__decl { margin: 0 0 .625rem; }
.acps-sign__pad {
	position: relative; height: 170px; background: var(--acps-surface);
	border: 1.5px solid var(--acps-line); border-radius: 10px; overflow: hidden;
}
.acps-sign.is-invalid .acps-sign__pad { border-color: var(--acps-error); }
.acps-sign__pad canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.acps-sign__line { position: absolute; left: 1rem; right: 1rem; bottom: 38px; border-bottom: 1.5px dashed var(--acps-line); pointer-events: none; }
.acps-sign__clear {
	position: absolute; top: .5rem; right: .5rem; min-height: 36px; padding: 0 .875rem;
	font: inherit; font-size: .875rem; font-weight: 700; color: var(--acps-navy);
	background: var(--acps-surface); border: 1.5px solid var(--acps-line); border-radius: 999px; cursor: pointer;
}
.acps-sign__clear:hover { border-color: var(--acps-navy); }

/* ---------- Multiple products ---------- */
.acps-item { border: 1.5px solid var(--acps-line-soft); border-radius: 12px; padding: .875rem 1rem .25rem; margin: 0 0 1rem; background: var(--acps-surface); }
.acps-item__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 .5rem; }
.acps-item__title { margin: 0; font-weight: 700; font-size: .875rem; text-transform: uppercase; letter-spacing: .05em; color: var(--acps-brand-deep); }
.acps-item__remove { min-height: 36px; padding: 0 .875rem; font: inherit; font-size: .875rem; font-weight: 700; color: var(--acps-error); background: none; border: 1.5px solid var(--acps-line); border-radius: 999px; cursor: pointer; }
.acps-item__remove:hover { border-color: var(--acps-error); }
.acps-btn--add {
	display: flex; width: 100%; justify-content: center; align-items: center; min-height: 52px; margin: 0 0 1.25rem;
	font: inherit; font-weight: 700; color: var(--acps-brand-deep); background: var(--acps-brand-tint);
	border: 1.5px dashed var(--acps-green); border-radius: 12px; cursor: pointer;
}
.acps-btn--add:hover { background: #d9f2e0; }
.acps-btn--add[hidden], .acps-item__remove[hidden] { display: none; }

/* ---------- Prices ---------- */
.acps-tile__price { display: block; font-size: .9375rem; font-weight: 700; color: var(--acps-brand-deep); }
.acps-tile__price:empty { display: none; }
.acps-total { background: var(--acps-brand-tint); border: 1.5px solid var(--acps-green); border-radius: 12px; padding: .875rem 1rem; margin: 0 0 1.25rem; }
.acps-total[hidden] { display: none; }
.acps-total__row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.acps-total__label { font-weight: 700; color: var(--acps-navy); }
.acps-total__amount { font-size: 1.375rem; color: var(--acps-brand-deep); }
.acps-total__note { margin: .25rem 0 0; font-size: .9375rem; font-weight: 700; color: var(--acps-navy); }
.acps-total__note:empty { display: none; }
.acps-total .acps-hint { margin-top: .375rem; }
