/*
 * EmiratesX forms module (quote request, membership application).
 *
 * Form specifics only. Every selector starts with .ex-forms (plural), so nothing
 * here collides with the design module's .ex-form wrapper and its
 * .ex-form__* helpers. Colours come from the brief palette. Theme classes:
 *   .ex-forms--dark   (default) ivory text on the dark surfaces
 *   .ex-forms--light  deep green text on ivory (gold is never text on ivory)
 *   .ex-forms--auto   follow the design module's context variables (--ex-fg ...)
 * No external fonts, images or requests.
 */

.ex-forms {
	--exf-fg: #f4f0e7;
	--exf-soft: #bcc6be;
	--exf-rule: #3d4d43;
	--exf-field-bg: #182620;
	--exf-field-line: #7f9187;
	--exf-accent: #c3aa78;
	--exf-error: #f0a79e;
	--exf-focus: #c3aa78;
	--exf-btn-bg: #c3aa78;
	--exf-btn-fg: #101b18;
	--exf-btn-border: #c3aa78;
	--exf-btn-bg-hover: #f4f0e7;
	--exf-btn-fg-hover: #101b18;
	--exf-btn-border-hover: #f4f0e7;
	--exf-ghost-hover: rgba(244, 240, 231, 0.1);
	--exf-box-bg: rgba(244, 240, 231, 0.04);

	box-sizing: border-box;
	max-width: 760px;
	color-scheme: dark;
	margin-inline: auto;
	color: var(--exf-fg);
	font-family: inherit;
	font-size: 17px;
	line-height: 1.6;
}

.ex-forms--light {
	--exf-fg: #182620;
	--exf-soft: #3d4d43;
	--exf-rule: #d9d2c5;
	--exf-field-bg: #fbf9f4;
	--exf-field-line: #766f61;
	--exf-accent: #182620;
	--exf-error: #9b2c1f;
	--exf-focus: #182620;
	--exf-btn-bg: #182620;
	--exf-btn-fg: #f4f0e7;
	--exf-btn-border: #182620;
	--exf-btn-bg-hover: transparent;
	--exf-btn-fg-hover: #182620;
	--exf-btn-border-hover: #182620;
	--exf-ghost-hover: rgba(24, 38, 32, 0.07);
	--exf-box-bg: rgba(24, 38, 32, 0.04);
	color-scheme: light;
}

.ex-forms--auto {
	color-scheme: normal;
	--exf-fg: var(--ex-fg, #f4f0e7);
	--exf-soft: var(--ex-fg-soft, #bcc6be);
	--exf-rule: var(--ex-rule, #3d4d43);
	--exf-field-bg: var(--ex-field-bg, #182620);
	--exf-field-line: var(--ex-field-line, #7f9187);
	--exf-accent: var(--ex-accent, #c3aa78);
	--exf-error: var(--ex-error, #f0a79e);
	--exf-focus: var(--ex-focus, #c3aa78);
	--exf-btn-bg: var(--ex-btn-bg, #c3aa78);
	--exf-btn-fg: var(--ex-btn-fg, #101b18);
	--exf-btn-border: var(--ex-btn-border, #c3aa78);
	--exf-btn-bg-hover: var(--ex-btn-bg-hover, #f4f0e7);
	--exf-btn-fg-hover: var(--ex-btn-fg-hover, #101b18);
	--exf-btn-border-hover: var(--ex-btn-border-hover, #f4f0e7);
}

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

.ex-forms [hidden] {
	display: none !important;
}

.ex-forms__lead:empty {
	display: none;
}
.ex-forms__intro,
.ex-forms__review-note {
	margin: 0 0 24px;
	color: var(--exf-soft);
}

/* The sticky site header must never cover what focus or a link jumps to. */
.ex-forms__summary,
.ex-forms__success,
.ex-forms .ex-forms__input,
.ex-forms .ex-forms__fieldset {
	scroll-margin-top: calc(var(--ex-header-h, 88px) + 24px);
}

.ex-forms__required-note {
	margin: 0 0 24px;
	font-size: 14px;
	color: var(--exf-soft);
}

.ex-forms__noscript {
	margin: 0 0 24px;
	padding: 16px 20px;
	border: 1px solid var(--exf-error);
	border-radius: 2px;
	color: var(--exf-fg);
}

/* Error summary (focus moves here after a failed submit) */
.ex-forms__summary {
	margin: 0 0 32px;
	padding: 18px 20px;
	border: 1px solid var(--exf-error);
	border-inline-start-width: 4px;
	border-radius: 2px;
	background: var(--exf-box-bg);
	color: var(--exf-fg);
}
.ex-forms__summary:focus {
	outline: 2px solid var(--exf-focus);
	outline-offset: 2px;
}
.ex-forms__summary-title {
	margin: 0 0 8px;
	font-weight: 700;
}
.ex-forms__summary ul {
	margin: 0;
	padding-inline-start: 1.2em;
}
.ex-forms__summary li {
	margin: 4px 0;
}
/* Links inside messages (the summary, the inline errors, the success text, the code status, the notices: the
   support mailto and the error summary links). The .ex-forms prefix makes this beat Elementor's
   ".elementor a { text-decoration: none }", which loads later at the same strength, so a link is always
   underlined (WCAG 1.4.1: never colour alone). */
.ex-forms .ex-forms__summary a,
.ex-forms .ex-forms__error a,
.ex-forms .ex-forms__success-text a,
.ex-forms .ex-forms__verify-status a,
.ex-forms .ex-forms__notice a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.ex-forms .ex-forms__summary a:focus-visible,
.ex-forms .ex-forms__error a:focus-visible,
.ex-forms .ex-forms__success-text a:focus-visible,
.ex-forms .ex-forms__verify-status a:focus-visible,
.ex-forms .ex-forms__notice a:focus-visible,
.ex-forms .ex-forms__choice a:focus-visible {
	outline: 2px solid var(--exf-focus);
	outline-offset: 2px;
}

/* Rows, labels, controls */
.ex-forms__row {
	margin: 0 0 24px;
}

.ex-forms .ex-forms__label,
.ex-forms .ex-forms__legend {
	display: block;
	margin: 0 0 8px;
	padding: 0;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--exf-fg);
}
.ex-forms__star {
	font-weight: 400;
	color: var(--exf-soft);
}

.ex-forms .ex-forms__input {
	display: block;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 12px 14px;
	border: 1px solid var(--exf-field-line);
	border-radius: 2px;
	background: var(--exf-field-bg);
	color: var(--exf-fg);
	font: inherit;
	font-size: 17px;
	line-height: 1.4;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
}
.ex-forms .ex-forms__select {
	padding-inline-end: 40px;
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 22px) 55%, calc(100% - 16px) 55%;
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
}
.ex-forms .ex-forms__textarea {
	min-height: 160px;
	resize: vertical;
}
.ex-forms .ex-forms__input--code {
	max-width: 12em;
	letter-spacing: 0.3em;
	font-variant-numeric: tabular-nums;
}
.ex-forms .ex-forms__input:focus,
.ex-forms .ex-forms__button:focus-visible,
.ex-forms .ex-forms__choice input:focus-visible {
	outline: 2px solid var(--exf-focus);
	outline-offset: 2px;
}
.ex-forms .ex-forms__input:focus {
	border-color: var(--exf-fg);
}
.ex-forms .ex-forms__input[aria-invalid="true"],
.ex-forms .ex-forms__fieldset[aria-invalid="true"] .ex-forms__choice input {
	border-color: var(--exf-error);
}
.ex-forms .ex-forms__input[aria-invalid="true"] {
	box-shadow: inset 3px 0 0 var(--exf-error);
}

.ex-forms .ex-forms__error {
	margin: 8px 0 0;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.5;
	color: var(--exf-error);
}

/* Fieldsets, radio and checkbox groups */
.ex-forms .ex-forms__fieldset {
	min-width: 0;
	margin: 0 0 24px;
	padding: 0;
	border: 0;
}
.ex-forms__choices {
	display: flex;
	flex-wrap: wrap;
	gap: 0 32px;
}
.ex-forms__fieldset[data-ex-row="areas_of_interest"] .ex-forms__choices {
	flex-direction: column;
	gap: 0;
}
/* A choice row is at least 44px high (the label is the touch target; 10px above and below the first line of text). */
.ex-forms .ex-forms__choice {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
	padding-block: 10px;
	font-size: 16px;
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.55;
	text-transform: none;
	color: var(--exf-fg);
	cursor: pointer;
}
/*
 * Checkbox and radio drawn with CSS only (no image, no external file): a 24px box on the field colour with the
 * field border, quiet when unchecked, filled with the accent when checked (checkbox: tick, radio: ring and dot).
 * The tick and the dot use the button label colour, which is the contrast colour of the accent in every theme.
 * In forced colours mode the native controls come back (see the media query at the end).
 */
.ex-forms .ex-forms__choice input {
	display: inline-grid;
	place-content: center;
	flex: 0 0 24px;
	width: 24px;
	height: 24px;
	margin: 0;
	border: 1px solid var(--exf-field-line);
	border-radius: 2px;
	background: var(--exf-field-bg);
	color: var(--exf-btn-fg);
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	accent-color: var(--exf-accent);
	cursor: pointer;
}
.ex-forms .ex-forms__choice input[type="radio"] {
	border-radius: 50%;
}
.ex-forms .ex-forms__choice input::before {
	content: "";
	display: block;
	transform: scale(0);
	transition: transform 0.12s ease-in-out;
	background: currentColor;
}
.ex-forms .ex-forms__choice input[type="checkbox"]::before {
	width: 14px;
	height: 14px;
	clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
}
.ex-forms .ex-forms__choice input[type="radio"]::before {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--exf-accent);
}
.ex-forms .ex-forms__choice input:checked::before {
	transform: scale(1);
}
.ex-forms .ex-forms__choice input[type="checkbox"]:checked {
	border-color: var(--exf-accent);
	background: var(--exf-accent);
}
.ex-forms .ex-forms__choice input[type="radio"]:checked {
	border-color: var(--exf-accent);
}
.ex-forms .ex-forms__choice input:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
.ex-forms .ex-forms__choice input[aria-invalid="true"] {
	border-color: var(--exf-error);
	box-shadow: 0 0 0 1px var(--exf-error);
}
.ex-forms .ex-forms__choice span {
	min-width: 0;
}
.ex-forms .ex-forms__choice a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.ex-forms__row--check {
	margin-block-end: 8px;
}
.ex-forms__row--check .ex-forms__error {
	margin-block-start: 0;
}

/* The native list of a select follows the field colours (some browsers draw it from the option elements). */
.ex-forms .ex-forms__input option {
	background: var(--exf-field-bg);
	color: var(--exf-fg);
}

/* Service specific group */
.ex-forms .ex-forms__group {
	margin: 0 0 24px;
	padding: 20px 20px 4px;
	border: 1px solid var(--exf-rule);
	border-radius: 2px;
}
.ex-forms .ex-forms__group .ex-forms__legend {
	padding: 0 8px;
	margin: 0;
}

/* Fee notices */
.ex-forms__notices {
	margin: 0 0 24px;
}
.ex-forms .ex-forms__notice {
	margin: 0 0 12px;
	padding: 18px 20px;
	border: 1px solid var(--exf-rule);
	border-inline-start: 3px solid var(--exf-accent);
	border-radius: 2px;
	font-size: 16px;
	line-height: 1.6;
	color: var(--exf-fg);
}
.ex-forms .ex-forms__notice--scope {
	border-inline-start-color: var(--exf-error);
}

/* Member verification */
.ex-forms .ex-forms__verify {
	margin: 0 0 24px;
	padding: 18px 20px;
	border: 1px solid var(--exf-rule);
	border-radius: 2px;
	background: var(--exf-box-bg);
}
.ex-forms__verify-intro {
	margin: 0 0 12px;
	font-size: 16px;
	color: var(--exf-soft);
}
.ex-forms__verify-code {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px 16px;
	margin-block-start: 16px;
}
.ex-forms__verify-code .ex-forms__row {
	margin: 0;
}
.ex-forms__verify-status {
	margin: 12px 0 0;
	font-size: 15px;
}
.ex-forms__verify-status[data-state="error"] {
	color: var(--exf-error);
	font-weight: 700;
}
.ex-forms__verify-status[data-state="ok"] {
	font-weight: 700;
}

/* Buttons */
.ex-forms .ex-forms__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	margin: 0;
	padding: 0 24px;
	border: 1px solid var(--exf-btn-border);
	border-radius: 2px;
	background: var(--exf-btn-bg);
	color: var(--exf-btn-fg);
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.14em;
	line-height: 1.2;
	text-align: center;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: none;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
/* Hover: the label colour is its own token (--exf-btn-fg-hover). It used to fall back to the page text colour,
   which is ivory on the ivory hover fill (1:1). Dark: #101b18 on #f4f0e7 (15.49:1). Light: ink on ivory. */
.ex-forms .ex-forms__button:hover {
	background: var(--exf-btn-bg-hover);
	color: var(--exf-btn-fg-hover, var(--exf-btn-fg));
	border-color: var(--exf-btn-border-hover, var(--exf-btn-bg-hover));
}
.ex-forms--light .ex-forms__button:hover {
	color: var(--exf-fg);
	border-color: var(--exf-fg);
}
.ex-forms .ex-forms__button--secondary {
	background: transparent;
	color: var(--exf-fg);
	border-color: var(--exf-fg);
}
.ex-forms .ex-forms__button--secondary:hover {
	background: var(--exf-ghost-hover);
	color: var(--exf-fg);
	border-color: var(--exf-fg);
}
.ex-forms .ex-forms__button[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
}
/* A disabled or busy button never repaints on hover (the label "Submitting..." stays readable). */
.ex-forms .ex-forms__button[disabled]:hover {
	background: var(--exf-btn-bg);
	color: var(--exf-btn-fg);
	border-color: var(--exf-btn-border);
}
.ex-forms .ex-forms__button--secondary[disabled]:hover {
	background: transparent;
	color: var(--exf-fg);
	border-color: var(--exf-fg);
}
/* While a request runs the label "Submitting..." is a status the visitor reads, so it is dimmed less than a plain disabled button (label contrast stays above 4.5:1). */
.ex-forms .ex-forms__form[aria-busy="true"] .ex-forms__button[disabled] {
	opacity: 0.75;
	cursor: progress;
}
.ex-forms__actions {
	margin-block-start: 32px;
}
.ex-forms__status {
	margin: 20px 0 0;
	font-size: 17px;
	line-height: 1.6;
}
.ex-forms__status:empty {
	display: none;
}

/* Success */
.ex-forms__success {
	padding: 24px;
	border: 1px solid var(--exf-rule);
	border-inline-start: 3px solid var(--exf-accent);
	border-radius: 2px;
	background: var(--exf-box-bg);
}
.ex-forms__success:focus {
	outline: 2px solid var(--exf-focus);
	outline-offset: 2px;
}
.ex-forms__success-text {
	margin: 0 0 12px;
	font-size: 18px;
}
.ex-forms__success-ref {
	margin: 0;
	font-size: 15px;
	color: var(--exf-soft);
}

/* Honeypot: out of sight and out of the tab order, never display:none (some bots skip those) */
.ex-forms__hp {
	position: absolute !important;
	inset-inline-start: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Text for screen readers only (the loading announcement) */
.ex-forms .ex-forms__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Loading */
.ex-forms__form[aria-busy="true"] {
	cursor: progress;
}

@media (max-width: 600px) {
	.ex-forms__choices {
		flex-direction: column;
		gap: 0;
	}
	.ex-forms .ex-forms__group {
		padding: 16px 14px 2px;
	}
	.ex-forms .ex-forms__button {
		width: 100%;
	}
	.ex-forms__verify-code .ex-forms__input--code {
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ex-forms .ex-forms__button,
	.ex-forms .ex-forms__choice input::before {
		transition: none;
	}
}

/* Windows high contrast and other forced colours: give the checkboxes and radios back to the browser, so a checked box is always distinguishable. */
@media (forced-colors: active) {
	.ex-forms .ex-forms__choice input {
		display: inline-block;
		appearance: auto;
		-webkit-appearance: auto;
		border: revert;
		background: revert;
		box-shadow: none;
	}
	.ex-forms .ex-forms__choice input::before {
		display: none;
	}
}
