/*
 * smh/contact-form (root .smh-contact-form). Owner: WP5. Contract: docs/ARCHITECTURE.md 5.3.6, 5.8, 6.7.
 * The form sheet: white paper, 1 px hairline, 32 px padding, THE page's folder-pocket corner (.smh-pocket, base.css).
 * Labels above inputs (15 px 500 ink), one column, 48 px inputs with a 1 px muted border (5.44:1, UI stroke >= 3:1),
 * radius 2 px, focus ring from base.css; errors in the error token next to the field and in a summary box at the top
 * (3 px error rule on the inline start, like the service page's document callout). Submit never disabled.
 * Logical properties only; Chromium 114 floor (no :has() needed, no nesting).
 */

/* Design A (2026-09-29): the form card. White sheet on layered shadows, 4 px corners and THE page's folder-pocket
   corner (28 px, end-end), a title and the required-fields line, two columns for the short fields from 761 px, the
   preferred contact method as three segmented choices, the petrol submit with the arrow. */
.smh-contact-form {
	position: relative;
	box-sizing: border-box;
	padding: clamp(26px, 3.2vw, 48px);
	border: 0;
	border-radius: var(--smh-r-tab);
	border-end-end-radius: var(--smh-r-pocket);
	background: var(--smh-white);
	color: var(--smh-ink);
	box-shadow: 0 2px 3px rgb(10 40 50 / .07), 0 18px 38px -14px rgb(10 40 50 / .3), 0 64px 120px -40px rgb(6 30 40 / .55), 0 0 0 1px rgb(255 255 255 / .4);
	scroll-margin-block-start: 96px;
}
.smh-contact-form__title { font-size: clamp(21px, 1.7vw, 25px); font-weight: 700; line-height: 1.4; color: var(--smh-ink); }
.smh-contact-form__form > .smh-contact-form__sub { margin-top: calc(-1 * var(--wp--preset--spacing--40)); font-size: 15px; line-height: 1.6; color: var(--smh-muted); }

.smh-contact-form__form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 20px;
	margin: 0;
}
.smh-contact-form__form > * { grid-column: 1 / -1; margin: 0; min-inline-size: 0; }
.smh-contact-form__form > .smh-contact-form__field--half { grid-column: auto; }
@media (max-width: 760px) {
	.smh-contact-form__form { grid-template-columns: minmax(0, 1fr); }
	.smh-contact-form__form > .smh-contact-form__field--half { grid-column: 1 / -1; }
}
.smh-contact-form [hidden] { display: none !important; }

/* ---------- Labels, hints ---------- */
.smh-contact-form__label {
	display: block;
	margin: 0 0 var(--wp--preset--spacing--20);
	padding: 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	line-height: var(--smh-lh-normal);
	color: var(--smh-ink);
}
.smh-contact-form__optional { font-weight: 400; color: var(--smh-muted); }
.smh-contact-form__hint {
	margin: calc(var(--wp--preset--spacing--10) * -1) 0 var(--wp--preset--spacing--20);
	font-size: var(--wp--preset--font-size--small);
	line-height: var(--smh-lh-normal);
	color: var(--smh-muted);
}

/* ---------- Inputs ---------- */
.smh-contact-form__input {
	display: block;
	box-sizing: border-box;
	inline-size: 100%;
	min-block-size: 52px;
	margin: 0;
	padding: 0.625rem 1rem;
	border: 1px solid var(--smh-a-steel-m, var(--smh-muted));
	border-radius: var(--smh-r-control);
	background: var(--smh-white);
	color: var(--smh-ink);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--medium);
	line-height: var(--smh-lh-snug);
	transition: border-color .25s, box-shadow .35s cubic-bezier(.16, 1, .3, 1);
}
.smh-contact-form__input:hover { border-color: var(--smh-petrol); }
.smh-contact-form__input:focus { outline: none; border-color: var(--smh-petrol-light); box-shadow: 0 0 0 4px rgb(25 100 120 / .16); }
.smh-contact-form__input:focus-visible { outline: 2px solid var(--smh-focus); outline-offset: 2px; }
.smh-contact-form__textarea { min-block-size: 9.5rem; resize: vertical; line-height: var(--smh-lh-loose); }
html[lang|="en"] .smh-contact-form__textarea { line-height: var(--smh-lh-normal); }
/* Phone and e-mail are typed left to right; on the Arabic site they still sit against the start (right) edge. */
[dir="rtl"] .smh-contact-form__input--ltr { text-align: right; }

.smh-contact-form__input[aria-invalid="true"] {
	border-color: var(--smh-error);
	box-shadow: inset 0 0 0 1px var(--smh-error);
}
.smh-contact-form__error {
	margin: var(--wp--preset--spacing--20) 0 0;
	padding-inline-start: var(--wp--preset--spacing--30);
	border-inline-start: 3px solid var(--smh-error);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	line-height: var(--smh-lh-normal);
	color: var(--smh-error);
}

/* Select: native control, brand chevron (the icon set's chevron, turned down; masks need the -webkit- prefix on 114). */
.smh-contact-form__select { position: relative; display: block; }
.smh-contact-form__select select {
	-webkit-appearance: none;
	appearance: none;
	padding-inline-end: 2.75rem;
	cursor: pointer;
}
.smh-contact-form__select::after {
	content: "";
	position: absolute;
	inset-inline-end: 0.875rem;
	inset-block-start: 50%;
	inline-size: 1.125rem;
	block-size: 1.125rem;
	transform: translateY(-50%) rotate(90deg);
	background: var(--smh-petrol);
	-webkit-mask: url(../../svg/icons/chevron.svg) center / contain no-repeat;
	mask: url(../../svg/icons/chevron.svg) center / contain no-repeat;
	pointer-events: none;
}

/* ---------- Preferred channel (radios) ---------- */
.smh-contact-form__choices { border: 0; padding: 0; min-inline-size: 0; }
.smh-contact-form__options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 420px) { .smh-contact-form__options { grid-template-columns: 1fr; } }
.smh-contact-form__option { position: relative; display: block; cursor: pointer; }
.smh-contact-form__option input {
	position: absolute;
	inset: 0;
	inline-size: 100%;
	block-size: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}
.smh-contact-form__option span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-block-size: 48px;
	padding: 0 12px;
	border: 1px solid var(--smh-a-steel-m, var(--smh-muted));
	border-radius: var(--smh-r-control);
	font-size: 15px;
	line-height: 1.4;
	text-align: center;
	color: var(--smh-ink);
	transition: border-color .25s, background-color .25s, color .25s;
}
.smh-contact-form__option input:hover + span { border-color: var(--smh-petrol); }
.smh-contact-form__option input:checked + span { background: var(--smh-petrol); border-color: var(--smh-petrol); color: var(--smh-white); }
.smh-contact-form__option input:focus-visible + span { outline: 2px solid var(--smh-focus); outline-offset: 2px; box-shadow: 0 0 0 4px rgb(25 100 120 / .16); }
.smh-contact-form__option input[aria-invalid="true"] + span { border-color: var(--smh-error); }
@media (forced-colors: active) { .smh-contact-form__option input:checked + span { outline: 2px solid Highlight; } }
.smh-contact-form__consent input {
	flex: none;
	inline-size: 1.25rem;
	block-size: 1.25rem;
	margin: 0;
	accent-color: var(--smh-petrol);
	cursor: pointer;
}

/* ---------- Consent ---------- */
.smh-contact-form__consent {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	column-gap: var(--wp--preset--spacing--30);
	align-items: start;
}
.smh-contact-form__consent input { margin-block-start: 0.75rem; }
.smh-contact-form__consent label {
	padding-block: 0.4375rem; /* a 44 px target even on one line (the label toggles the checkbox) */
	font-size: var(--wp--preset--font-size--medium);
	line-height: var(--smh-lh-relaxed);
	cursor: pointer;
}
.smh-contact-form__consent .smh-contact-form__error { grid-column: 1 / -1; }

/* ---------- Honeypot: out of sight and out of the tab order; bots still see a normal field ---------- */
.smh-contact-form__hp {
	position: absolute !important;
	inline-size: 1px;
	block-size: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---------- Submit, notice ---------- */
.smh-contact-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 6px; }
.smh-contact-form__submit {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	min-block-size: 58px;
	padding: 0 28px;
	border: 0;
	border-radius: var(--smh-r-control);
	background: var(--smh-petrol);
	color: var(--smh-white);
	font-size: 17px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 14px 30px -14px rgb(15 61 76 / .7);
	transition: transform .5s cubic-bezier(.16, 1, .3, 1), background-color .3s;
}
.smh-contact-form__submit::after {
	content: "";
	inline-size: 20px;
	block-size: 20px;
	flex: none;
	background: currentColor;
	-webkit-mask: url(../../svg/icons/arrow.svg) center / contain no-repeat;
	mask: url(../../svg/icons/arrow.svg) center / contain no-repeat;
}
html:not([dir="rtl"]) .smh-contact-form__submit::after { transform: scaleX(-1); }
.smh-contact-form__submit:hover { background-color: var(--smh-petrol-light); color: var(--smh-white); }
@media (hover: hover) { .smh-contact-form__submit:hover { transform: translateY(-2px); } }
.smh-contact-form__submit:active { background-color: var(--smh-petrol-deep); color: var(--smh-white); transform: none; }
.smh-contact-form__form[aria-busy="true"] .smh-contact-form__submit { background-color: var(--smh-petrol-deep); cursor: progress; }
@media (max-width: 599px) {
	.smh-contact-form__submit { inline-size: 100%; }
}
.smh-contact-form__notice {
	font-size: 13.5px;
	line-height: var(--smh-lh-relaxed);
	color: var(--smh-muted);
}

/* ---------- Summary and failure panel ---------- */
.smh-contact-form__summary {
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	border-inline-start: 3px solid var(--smh-error);
	background: var(--smh-ground);
	color: var(--smh-ink);
}
.smh-contact-form__summary:focus { outline: 2px solid var(--smh-focus); outline-offset: 2px; }
.smh-contact-form__summary-title { margin: 0; font-weight: 500; line-height: var(--smh-lh-relaxed); }
.smh-contact-form__summary ul { margin: var(--wp--preset--spacing--20) 0 0; padding-inline-start: 1.25rem; }
.smh-contact-form__summary li { margin: 0; line-height: var(--smh-lh-loose); }
.smh-contact-form__summary a { color: var(--smh-error); font-weight: 500; }
.smh-contact-form__fallback { padding-inline: var(--wp--preset--spacing--50); }

@media print {
	.smh-contact-form { display: none !important; }
}

/* Design A: hints sit under their input (DOM order unchanged: label, hint, input, error; aria-describedby links
   the hint), so the two-column rows keep their inputs aligned. */
.smh-contact-form__field { display: flex; flex-direction: column; }
.smh-contact-form__field > .smh-contact-form__input,
.smh-contact-form__field > .smh-contact-form__select { order: 2; }
.smh-contact-form__field > .smh-contact-form__hint { order: 3; margin: 8px 0 0; font-size: 13px; }
.smh-contact-form__field > .smh-contact-form__error { order: 4; }
.smh-contact-form__field.smh-contact-form__consent { display: grid; }
