/**
 * Media accreditation form.
 *
 * All sizes are set in px on purpose: many themes reduce the root font size
 * (e.g. Bootstrap 3: html { font-size: 10px }), which would shrink rem based values.
 * Colours can be adjusted by overriding the custom properties on .echma.
 */

.echma {
	--echma-accent: #1d3879;
	--echma-accent-soft: #edf1f8;
	--echma-button: #da0a2c;
	--echma-button-hover: #1d3879;
	--echma-text: #1e1e1e;
	--echma-muted: #4d5566;
	--echma-border: #8a92a3;
	--echma-border-soft: #d9dde5;
	--echma-surface: #fff;
	--echma-surface-muted: #f4f6fa;
	--echma-placeholder: #6b7280;
	--echma-error: #b32d2e;
	--echma-success: #18692f;
	--echma-success-surface: #edf7ef;
	--echma-focus-ring: 0 0 0 3px rgba(29, 56, 121, 0.3);
	--echma-radius: 4px;
	--echma-control-height: 54px;

	box-sizing: border-box;
	position: relative;
	width: 100%;
	max-width: 1000px;
	margin: 0 auto 48px;
	color: var(--echma-text);
	font-family: inherit;
	font-size: 17px;
	font-weight: 400;
	line-height: 1.6;
	letter-spacing: normal;
	text-align: left;
}

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

.echma a[href] {
	color: var(--echma-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.echma a[href]:hover {
	color: var(--echma-accent);
	text-decoration-thickness: 2px;
}

.echma a[href]:focus-visible {
	border-radius: 2px;
	outline: 3px solid var(--echma-accent);
	outline-offset: 2px;
}

/* Notice above the form */

.echma .echma-notice {
	margin: 0 0 24px;
	padding: 20px 24px;
	color: var(--echma-text);
	font-size: 17px;
	font-weight: 500;
	line-height: 1.6;
	background: var(--echma-accent-soft);
	border-left: 5px solid var(--echma-accent);
	border-radius: 0 var(--echma-radius) var(--echma-radius) 0;
}

.echma .echma-notice p {
	margin: 0 0 8px;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

.echma .echma-notice p:last-child {
	margin-bottom: 0;
}

/* Form card */

.echma .echma-form {
	container: echma-form / inline-size;
	margin: 0;
	padding: 40px;
	color: var(--echma-text);
	background: var(--echma-surface);
	border: 1px solid var(--echma-border-soft);
	border-radius: 6px;
	box-shadow: 0 2px 12px rgba(29, 56, 121, 0.06);
}

.echma .echma-required-note {
	margin: 0 0 28px;
	color: var(--echma-muted);
	font-size: 15px;
	line-height: 1.5;
}

/* Sections */

.echma .echma-fieldset {
	min-width: 0;
	margin: 0 0 16px;
	padding: 0;
	border: 0;
}

.echma .echma-legend {
	display: block;
	float: left;
	width: 100%;
	margin: 0 0 24px;
	padding: 0 0 10px;
	color: var(--echma-accent);
	font-family: inherit;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	border: 0;
	border-bottom: 2px solid var(--echma-accent);
}

.echma .echma-legend + * {
	clear: both;
}

/* Grid: one column, two columns as soon as the form is wide enough */

.echma .echma-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	column-gap: 32px;
}

@container echma-form (min-width: 560px) {

	.echma .echma-row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@container echma-form (max-width: 859px) {

	.echma .echma-row--media {
		grid-template-columns: minmax(0, 1fr);
	}
}

@supports not (container-type: inline-size) {

	@media (min-width: 640px) {

		.echma .echma-row {
			grid-template-columns: repeat(2, minmax(0, 1fr));
		}
	}
}

/* Fields */

.echma .echma-field {
	min-width: 0;
	margin: 0 0 24px;
	padding: 0;
	border: 0;
}

.echma .echma-label {
	display: block;
	float: none;
	width: auto;
	max-width: none;
	margin: 0 0 8px;
	padding: 0;
	color: var(--echma-text);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: normal;
	text-transform: none;
	border: 0;
}

.echma legend.echma-label {
	float: left;
	width: 100%;
}

.echma legend.echma-label + * {
	clear: both;
}

.echma .echma-hint {
	margin: 0 0 10px;
	color: var(--echma-muted);
	font-size: 15px;
	line-height: 1.5;
}

/* Text inputs */

.echma input.echma-input[type="text"],
.echma input.echma-input[type="email"],
.echma input.echma-input[type="tel"],
.echma input.echma-input[type="date"] {
	display: block;
	width: 100%;
	max-width: 100%;
	height: var(--echma-control-height);
	min-height: var(--echma-control-height);
	margin: 0;
	padding: 0 16px;
	color: var(--echma-text);
	font-family: inherit;
	font-size: 17px;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: normal;
	text-align: left;
	text-transform: none;
	background: var(--echma-surface);
	border: 1px solid var(--echma-border);
	border-radius: var(--echma-radius);
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.echma input.echma-input[type="text"],
.echma input.echma-input[type="email"],
.echma input.echma-input[type="tel"] {
	-webkit-appearance: none;
	appearance: none;
}

.echma input.echma-input[type="date"]::-webkit-date-and-time-value {
	min-height: 1.3em;
	text-align: left;
}

.echma input.echma-input::placeholder {
	color: var(--echma-placeholder);
	opacity: 1;
}

.echma input.echma-input:not([type="file"]):hover {
	border-color: var(--echma-accent);
}

.echma input.echma-input:not([type="file"]):focus {
	background: var(--echma-surface);
	border-color: var(--echma-accent);
	outline: 2px solid transparent !important;
	box-shadow: var(--echma-focus-ring);
}

/*
 * File upload: a box with button and file name. Without JavaScript the native
 * file input is shown inside the box; with JavaScript (.is-enhanced) the native
 * input covers the whole box invisibly, so clicking or dropping a file works anywhere.
 */

.echma .echma-file {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	min-height: 72px;
	padding: 12px 14px;
	background: var(--echma-surface-muted);
	border: 2px dashed var(--echma-border);
	border-radius: var(--echma-radius);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.echma .echma-file input[type="file"] {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	color: var(--echma-text);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.4;
	background: transparent;
	border: 0;
	cursor: pointer;
}

.echma .echma-file input[type="file"]::file-selector-button {
	margin: 0 16px 0 0;
	padding: 10px 20px;
	color: #fff;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	background: var(--echma-accent);
	border: 0;
	border-radius: var(--echma-radius);
	cursor: pointer;
}

.echma .echma-file input[type="file"]::-webkit-file-upload-button {
	margin: 0 16px 0 0;
	padding: 10px 20px;
	color: #fff;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	background: var(--echma-accent);
	border: 0;
	border-radius: var(--echma-radius);
	cursor: pointer;
}

.echma .echma-file__button,
.echma .echma-file__name {
	display: none;
}

.echma .echma-file.is-enhanced input[type="file"] {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	opacity: 0;
}

.echma .echma-file.is-enhanced .echma-file__button {
	display: inline-flex;
	flex: none;
	align-items: center;
	min-height: 44px;
	padding: 10px 20px;
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	background: var(--echma-accent);
	border-radius: var(--echma-radius);
	transition: background-color 0.15s ease;
}

.echma .echma-file.is-enhanced .echma-file__name {
	display: block;
	flex: 1 1 180px;
	min-width: 0;
	color: var(--echma-muted);
	font-size: 16px;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.echma .echma-file.is-enhanced.has-file .echma-file__name {
	color: var(--echma-text);
	font-weight: 600;
}

.echma .echma-file.is-enhanced:hover,
.echma .echma-file.is-enhanced.is-dragover {
	background: var(--echma-accent-soft);
	border-color: var(--echma-accent);
}

.echma .echma-file.is-enhanced:hover .echma-file__button {
	background: #142a5c;
}

.echma .echma-file.is-enhanced:focus-within {
	border-color: var(--echma-accent);
	box-shadow: var(--echma-focus-ring);
}

/* Type of medium */

.echma .echma-choice {
	min-width: 0;
	margin: 0 0 24px;
	padding: 0;
	border: 0;
}

.echma .echma-choice__options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
}

@container echma-form (min-width: 440px) {

	.echma .echma-choice__options {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.echma .echma-choice__option {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 0;
	min-height: var(--echma-control-height);
	max-width: none;
	margin: 0;
	padding: 8px 10px;
	color: var(--echma-text);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	background: var(--echma-surface);
	border: 1px solid var(--echma-border);
	border-radius: var(--echma-radius);
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.echma .echma-choice__option input[type="radio"] {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--echma-accent);
	cursor: pointer;
}

.echma .echma-choice__option:hover {
	border-color: var(--echma-accent);
}

.echma .echma-choice__option:has(input:checked) {
	background: var(--echma-accent-soft);
	border-color: var(--echma-accent);
	box-shadow: inset 0 0 0 1px var(--echma-accent);
}

.echma .echma-choice__option:focus-within {
	outline: 3px solid var(--echma-accent);
	outline-offset: 2px;
}

/* Privacy */

.echma .echma-privacy-text {
	margin: 0 0 20px;
	color: var(--echma-text);
	font-size: 16px;
	line-height: 1.65;
}

.echma .echma-checkbox__row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.echma .echma-checkbox__row input[type="checkbox"] {
	flex: none;
	width: 22px;
	height: 22px;
	margin: 1px 0 0;
	accent-color: var(--echma-accent);
	cursor: pointer;
}

.echma .echma-checkbox__row input[type="checkbox"]:focus-visible {
	outline: 3px solid var(--echma-accent);
	outline-offset: 2px;
}

.echma .echma-checkbox__row label {
	display: block;
	max-width: none;
	margin: 0;
	padding: 0;
	color: var(--echma-text);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.5;
	cursor: pointer;
}

/* Errors */

.echma .echma-error-message {
	margin: 0 0 8px;
	color: var(--echma-error);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
}

.echma .echma-field--error input.echma-input[type="text"],
.echma .echma-field--error input.echma-input[type="email"],
.echma .echma-field--error input.echma-input[type="tel"],
.echma .echma-field--error input.echma-input[type="date"],
.echma .echma-field--error .echma-file,
.echma .echma-field--error .echma-choice__option {
	border: 2px solid var(--echma-error);
}

.echma .echma-error-summary {
	margin: 0 0 24px;
	padding: 20px 24px;
	color: var(--echma-text);
	font-size: 16px;
	line-height: 1.5;
	background: var(--echma-surface);
	border: 3px solid var(--echma-error);
	border-radius: var(--echma-radius);
}

.echma .echma-error-summary:focus {
	outline: 3px solid var(--echma-accent);
	outline-offset: 2px;
}

.echma .echma-error-summary__title {
	margin: 0 0 10px;
	padding: 0;
	color: var(--echma-error);
	font-family: inherit;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
}

.echma .echma-error-summary__list {
	margin: 0;
	padding: 0 0 0 22px;
	list-style: disc;
}

.echma .echma-error-summary__list li {
	margin: 6px 0;
	padding: 0;
	font-size: 16px;
	line-height: 1.5;
	list-style: disc;
}

.echma .echma-error-summary__list li::before {
	content: none;
}

.echma .echma-error-summary__list a[href] {
	color: var(--echma-error);
	font-weight: 600;
}

.echma .echma-error-summary__hint {
	margin: 12px 0 0;
	font-size: 16px;
	line-height: 1.5;
}

/* Success */

.echma .echma-success {
	padding: 24px 28px;
	color: var(--echma-text);
	font-size: 17px;
	line-height: 1.6;
	background: var(--echma-success-surface);
	border-left: 5px solid var(--echma-success);
	border-radius: 0 var(--echma-radius) var(--echma-radius) 0;
}

.echma .echma-success:focus {
	outline: 3px solid var(--echma-accent);
	outline-offset: 2px;
}

.echma .echma-success__title {
	margin: 0 0 8px;
	padding: 0;
	color: var(--echma-success);
	font-family: inherit;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
}

.echma .echma-success p {
	margin: 0 0 8px;
	font-size: 17px;
	line-height: 1.6;
}

.echma .echma-success p:last-child {
	margin-bottom: 0;
}

/* Submit */

.echma .echma-actions {
	margin: 8px 0 0;
}

.echma .echma-submit {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 56px;
	max-width: 100%;
	margin: 0;
	padding: 12px 40px;
	color: #fff;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 1px;
	text-align: center;
	text-transform: uppercase;
	background: var(--echma-button) !important;
	border: 2px solid var(--echma-button);
	border-radius: var(--echma-radius);
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.echma .echma-submit::before,
.echma .echma-submit::after {
	content: none !important;
	display: none !important;
}

.echma .echma-submit:hover,
.echma .echma-submit:focus-visible {
	color: #fff;
	background: var(--echma-button-hover) !important;
	border-color: var(--echma-button-hover);
}

.echma .echma-submit:focus-visible {
	outline: 3px solid var(--echma-accent) !important;
	outline-offset: 3px;
}

.echma .echma-submit[aria-disabled="true"] {
	opacity: 0.8;
	cursor: progress;
}

/* Small screens */

@media (max-width: 767px) {

	.echma .echma-form {
		padding: 28px 24px;
	}

	.echma .echma-notice {
		padding: 16px 20px;
	}
}

@media (max-width: 479px) {

	.echma {
		font-size: 16px;
	}

	.echma .echma-form {
		padding: 24px 16px;
	}

	.echma input.echma-input[type="text"],
	.echma input.echma-input[type="email"],
	.echma input.echma-input[type="tel"],
	.echma input.echma-input[type="date"] {
		padding: 0 12px;
		font-size: 16px;
	}

	.echma .echma-notice {
		font-size: 16px;
	}

	.echma .echma-legend {
		font-size: 19px;
	}

	.echma .echma-submit {
		width: 100%;
		padding: 12px 20px;
	}
}

@media (prefers-reduced-motion: reduce) {

	.echma input.echma-input,
	.echma .echma-file,
	.echma .echma-file__button,
	.echma .echma-choice__option,
	.echma .echma-submit {
		transition: none;
	}
}

/* Helpers */

.echma .echma-hp {
	position: absolute !important;
	top: auto;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.echma .echma-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (forced-colors: active) {

	.echma .echma-choice__option:has(input:checked) {
		outline: 2px solid CanvasText;
	}
}
