/* ==========================================================================
   SEIF & ALALAMIA Lead Forms — public stylesheet
   Design language: quiet, editorial "boutique intake" card. A single
   gradient hairline signals the brand; everything else stays disciplined
   so the magenta accent and the copy do the talking. Fully responsive,
   RTL/LTR aware via CSS logical properties, motion-reduced friendly.
   All selectors scoped under .salf-wrapper to avoid theme/plugin conflicts.
   ========================================================================== */

.salf-wrapper {
	/* Brand tokens — --salf-bg / --salf-button / --salf-radius are still
	   set inline per-site from Settings > Appearance (see
	   SALF_Public::print_dynamic_colors(), which prints a :root{...} block).
	   --salf-primary has been hardcoded to #FF00FF !important below, so it
	   no longer inherits the admin's chosen color from :root — every rule
	   that used to read var(--salf-primary) now uses the fixed magenta
	   value directly instead. */
	--salf-primary: #FF00FF !important;
	--salf-bg: var(--salf-bg, #FFFFFF);
	--salf-button: var(--salf-button, #000000);
	--salf-radius: var(--salf-radius, 10px);

	/* Design system tokens derived from the brand palette. */
	--salf-ink: #131114;
	--salf-ink-soft: #4a444c;
	--salf-mist: #f8f6f8;
	--salf-line: #e9e3e9;
	--salf-muted: #8c8590;
	--salf-danger: #d92d2d;
	--salf-danger-bg: #fdf1f1;
	--salf-success: #167a4c;
	--salf-shadow-ambient: 0 30px 60px -25px rgba(18, 12, 18, 0.28);
	--salf-shadow-tight: 0 2px 6px rgba(18, 12, 18, 0.06);

	box-sizing: border-box;
	width: 100%;
	max-width: 720px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Roboto, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

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

/* Fallback tinted shadows/borders for browsers without color-mix() support
   (roughly pre-2023 engines). Modern browsers get the accurate brand-tinted
   versions further below via @supports. Approximates the default magenta
   brand color so the design still looks intentional even if an admin has
   customized the primary color on a legacy browser. */
.salf-card-top {
	background: linear-gradient(90deg, #FF00FF 0%, rgba(255, 0, 255, 0.35) 65%, transparent 100%) !important;
}
.salf-wrapper[dir="rtl"] .salf-card-top {
	background: linear-gradient(270deg, #FF00FF 0%, rgba(255, 0, 255, 0.35) 65%, transparent 100%) !important;
}
.salf-field input:focus,
.salf-field select:focus,
.salf-field textarea:focus {
	box-shadow: 0 0 0 4px rgba(255, 0, 255, 0.14);
}
.salf-checkbox-box input[type="checkbox"]:focus-visible ~ .salf-checkbox-mark {
	box-shadow: 0 0 0 4px rgba(255, 0, 255, 0.18);
}
.salf-submit-btn:hover,
.salf-submit-btn:focus-visible {
	box-shadow: 0 10px 26px -8px rgba(255, 0, 255, 0.55);
}

@supports (color: color-mix(in srgb, red, blue)) {
	.salf-card-top {
		background: linear-gradient(90deg, #FF00FF 0%, color-mix(in srgb, #FF00FF 35%, transparent) 65%, transparent 100%) !important;
	}
	.salf-wrapper[dir="rtl"] .salf-card-top {
		background: linear-gradient(270deg, #FF00FF 0%, color-mix(in srgb, #FF00FF 35%, transparent) 65%, transparent 100%) !important;
	}
	.salf-field input:focus,
	.salf-field select:focus,
	.salf-field textarea:focus {
		box-shadow: 0 0 0 4px color-mix(in srgb, #FF00FF 14%, transparent) !important;
	}
	.salf-checkbox-box input[type="checkbox"]:focus-visible ~ .salf-checkbox-mark {
		box-shadow: 0 0 0 4px color-mix(in srgb, #FF00FF 18%, transparent) !important;
	}
	.salf-submit-btn:hover,
	.salf-submit-btn:focus-visible {
		box-shadow: 0 10px 26px -8px color-mix(in srgb, #FF00FF 55%, transparent) !important;
	}
}

/* ---------------------------------- Card --------------------------------- */

.salf-card {
	position: relative;
	background: var(--salf-bg) !important;
	border: 1px solid var(--salf-line);
	border-radius: calc(var(--salf-radius) + 10px);
	overflow: hidden;
	box-shadow: var(--salf-shadow-ambient), var(--salf-shadow-tight);
	animation: salf-card-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes salf-card-in {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.salf-card-top {
	height: 4px;
	width: 100%;
}

.salf-card-inner {
	padding: 40px 44px 36px;
}

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

.salf-eyebrow {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px 0;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--salf-muted);
}

.salf-eyebrow-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #FF00FF !important;
	flex-shrink: 0;
}

.salf-title {
	margin: 0 0 10px 0;
	font-size: 30px;
	line-height: 1.2;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--salf-ink);
}

.salf-description {
	margin: 0 0 30px 0;
	font-size: 15px;
	line-height: 1.7;
	color: var(--salf-ink-soft);
	max-width: 52ch;
}

/* ---------------------------------- Grid ---------------------------------- */

.salf-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px 18px;
	margin-bottom: 28px;
}

.salf-field-full {
	grid-column: 1 / -1;
}

.salf-field-consent {
	grid-column: 1 / -1;
}

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

.salf-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

/* Without this, the [hidden] attribute used by the conditional
   "Order Details" field would be silently overridden by the
   display:flex rule above (same CSS specificity, and this rule
   comes later in the cascade) and the field would stay visible. */
.salf-field[hidden] {
	display: none;
}

.salf-field label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--salf-ink);
}

.salf-required {
	color: #FF00FF !important;
	margin-inline-start: 3px;
}

.salf-field input[type="text"],
.salf-field input[type="tel"],
.salf-field input[type="email"],
.salf-field select,
.salf-field textarea {
	width: 100% !important;
	padding: 13px 16px;
	font-size: 15px;
	line-height: 1.4;
	font-family: inherit;
	color: var(--salf-ink);
	background: var(--salf-mist) !important;
	border: 1.5px solid transparent;
	border-radius: calc(var(--salf-radius) * 0.6);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
}

.salf-field textarea {
	resize: vertical;
	min-height: 96px;
	line-height: 1.6;
}

.salf-field input::placeholder,
.salf-field textarea::placeholder {
	color: var(--salf-muted);
}

.salf-field input:hover,
.salf-field select:hover,
.salf-field textarea:hover {
	border-color: var(--salf-line);
}

.salf-field input:focus,
.salf-field select:focus,
.salf-field textarea:focus {
	outline: none;
	background: var(--salf-bg) !important;
	border-color: #FF00FF !important;
}

.salf-field.salf-field-invalid input,
.salf-field.salf-field-invalid select,
.salf-field.salf-field-invalid textarea {
	border-color: var(--salf-danger);
	background: var(--salf-danger-bg) !important;
}

.salf-field-error {
	display: none;
	font-size: 12.5px;
	color: var(--salf-danger);
	line-height: 1.4;
}

.salf-field.salf-field-invalid .salf-field-error {
	display: block;
}

/* ------------------------------ Custom select ------------------------------ */
/* Fixes native <select> text being clipped/overlapped by the browser's own
   arrow (especially in RTL, where the default arrow sits on the wrong side
   without matching padding). Browser chrome is removed entirely and
   replaced with a background-image arrow, positioned with explicit
   left/right values that are flipped once for [dir="rtl"] below — see
   the note on .salf-select-wrap select for why explicit values are used
   instead of logical (inline-start/end) properties here. */

.salf-select-wrap {
	position: relative;
	display: block;
	width: 100%;
}

.salf-select-wrap select {
	/* Single background-image arrow instead of a separate positioned
	   SVG element: fewer moving parts, and explicit left/right values
	   (flipped once for RTL below) instead of relying on inline-start/
	   end resolving correctly from the dir attribute — easier to
	   verify visually and impossible to end up "half-applied". */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7' fill='none'%3E%3Cpath d='M1 1.2L5.5 5.6L10 1.2' stroke='%234a444c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 16px center !important;
	background-size: 11px 7px !important;
	cursor: pointer;
}

.salf-wrapper[dir="rtl"] .salf-select-wrap select {
	background-position: left 16px center !important;
}

.salf-select-wrap select:invalid {
	color: var(--salf-muted);
}

/* -------------------------------- Checkboxes -------------------------------- */

.salf-checkbox-inline {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 13px;
	color: var(--salf-ink-soft);
	font-weight: 400;
	line-height: 1.55;
	cursor: pointer;
	margin-top: 2px;
}

.salf-checkbox-compact {
	font-size: 12.5px;
}

.salf-checkbox-box {
	position: relative;
	flex-shrink: 0;
	width: 19px;
	height: 19px;
	margin-top: 1px;
}

.salf-checkbox-box input[type="checkbox"] {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

.salf-checkbox-mark {
	position: absolute;
	inset: 0;
	border: 1.5px solid var(--salf-line);
	border-radius: 5px;
	background: var(--salf-mist);
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.salf-checkbox-mark::after {
	content: "";
	position: absolute;
	top: 45%;
	left: 50%;
	width: 5px;
	height: 9px;
	border: solid #ffffff;
	border-width: 0 2px 2px 0;
	transform: translate(-50%, -55%) rotate(45deg) scale(0);
	transition: transform 0.15s ease;
}

.salf-checkbox-box input[type="checkbox"]:checked ~ .salf-checkbox-mark {
	background: #FF00FF !important;
	border-color: #FF00FF !important;
}

.salf-checkbox-box input[type="checkbox"]:checked ~ .salf-checkbox-mark::after {
	transform: translate(-50%, -55%) rotate(45deg) scale(1);
}

/* Honeypot: visually and functionally hidden from humans, still present for bots to fill */
.salf-hp-field {
	position: absolute !important;
	inset-inline-start: -9999px !important;
	top: -9999px !important;
	height: 0;
	width: 0;
	overflow: hidden;
	opacity: 0;
}

/* ---------------------------------- Button ---------------------------------- */

.salf-submit-btn {
	position: relative;
	width: 100%;
	padding: 17px 26px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: #ffffff;
	background: var(--salf-button);
	border: none;
	border-radius: 999px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	overflow: hidden;
	isolation: isolate;
	transition: transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.salf-submit-btn::before {
	content: "";
	position: absolute;
	inset: 0;
	background: #FF00FF !important;
	transform: scaleX(0);
	transform-origin: 0% 50%;
	z-index: -1;
	transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}

.salf-wrapper[dir="rtl"] .salf-submit-btn::before {
	transform-origin: 100% 50%;
}

.salf-submit-btn:hover::before,
.salf-submit-btn:focus-visible::before {
	transform: scaleX(1);
}

.salf-submit-btn:hover,
.salf-submit-btn:focus-visible {
	transform: translateY(-1px);
}

.salf-submit-btn:active {
	transform: translateY(0);
}

.salf-submit-btn:disabled {
	opacity: 0.72;
	cursor: not-allowed;
	transform: none;
}

.salf-btn-arrow {
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.salf-wrapper[dir="rtl"] .salf-btn-arrow {
	transform: scaleX(-1);
}

.salf-submit-btn:hover .salf-btn-arrow {
	transform: translateX(3px);
}

.salf-wrapper[dir="rtl"] .salf-submit-btn:hover .salf-btn-arrow {
	transform: scaleX(-1) translateX(3px);
}

.salf-btn-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: salf-spin 0.7s linear infinite;
}

@keyframes salf-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ----------------------------------- Alert ----------------------------------- */

.salf-alert {
	margin-bottom: 22px;
	padding: 13px 16px;
	border-radius: calc(var(--salf-radius) * 0.6);
	font-size: 13px;
	line-height: 1.5;
	background: var(--salf-danger-bg);
	color: var(--salf-danger);
	border: 1px solid rgba(217, 45, 45, 0.25);
}

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

.salf-success {
	text-align: center;
	padding: 12px 6px 8px;
}

.salf-success-icon {
	color: #FF00FF !important;
	margin: 0 auto 18px auto;
	display: block;
}

.salf-success-circle {
	stroke-dasharray: 182;
	stroke-dashoffset: 182;
	animation: salf-draw 0.6s ease forwards;
}

.salf-success-check {
	stroke-dasharray: 34;
	stroke-dashoffset: 34;
	animation: salf-draw 0.4s ease 0.5s forwards;
}

@keyframes salf-draw {
	to {
		stroke-dashoffset: 0;
	}
}

.salf-success-title {
	margin: 0 0 8px 0;
	font-size: 21px;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--salf-ink);
}

.salf-success-message {
	margin: 0 auto;
	max-width: 42ch;
	font-size: 14.5px;
	line-height: 1.7;
	color: var(--salf-ink-soft);
}

/* ----------------------------------- RTL ------------------------------------ */

.salf-wrapper[dir="rtl"] {
	text-align: right;
}

/* -------------------------------- Responsive --------------------------------- */

@media (max-width: 760px) {
	.salf-card-inner {
		padding: 32px 28px 28px;
	}
	.salf-grid {
		grid-template-columns: 1fr;
		gap: 18px;
	}
	.salf-title {
		font-size: 25px;
	}
}

@media (max-width: 480px) {
	.salf-card-inner {
		padding: 26px 18px 22px;
	}
	.salf-title {
		font-size: 22px;
	}
	.salf-description {
		font-size: 14px;
	}
	.salf-field input[type="text"],
	.salf-field input[type="tel"],
	.salf-field input[type="email"],
	.salf-field select,
	.salf-field textarea {
		/* Keep at 16px+ so iOS Safari does not auto-zoom on focus. */
		font-size: 16px;
		padding: 12px 14px;
	}
	.salf-select-wrap select {
		padding: 12px 38px 12px 14px !important;
	}
	.salf-wrapper[dir="rtl"] .salf-select-wrap select {
		padding: 12px 14px 12px 38px !important;
	}
	.salf-submit-btn {
		padding: 15px 22px;
	}
}

/* ------------------------------- Reduced motion ------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.salf-card,
	.salf-success-circle,
	.salf-success-check,
	.salf-submit-btn,
	.salf-submit-btn::before,
	.salf-btn-arrow,
	.salf-btn-spinner {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
	.salf-card {
		opacity: 1;
		transform: none;
	}
	.salf-success-circle,
	.salf-success-check {
		stroke-dashoffset: 0;
	}
}