/* Copyright © 2024 Apeleg Limited. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License") with LLVM
 * exceptions; you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at
 *
 * http://llvm.org/foundation/relicensing/LICENSE.txt
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

:classname(SR_ONLY_CLASSNAME_) {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

:classname(PAGE_TITLE_CLASSNAME_) {
	font-size: 1.5em;
	font-weight: bold;
	text-transform: uppercase;
	margin-bottom: 0.5em;
}

:classname(MAIN_CLASSNAME_) {
	width: 100%;
	height: auto;
	background-color: #f2f0f0;
	color: #333;
	padding: 1em;
	flex-grow: 1;
}

@media not (writing-mode: tb-lr) {
	:classname(MAIN_CLASSNAME_) {
		inline-size: 100%;
		block-size: auto;
	}
}

:classname(INNER_CLASSNAME_) {
	display: block;
	width: 100%;
	height: auto;
	max-width: 800px;
	max-height: none;
	margin: 0 auto;
}

@media not (writing-mode: tb-lr) {
	:classname(INNER_CLASSNAME_) {
		inline-size: 100%;
		block-size: auto;
		max-inline-size: 800px;
		max-block-size: none;
		margin-inline: auto;
		margin-block: 0;
	}
}

:classname(FIELDSET_CLASSNAME_) {
	display: block;
	padding: 0.25em 0;
}

@media not (writing-mode: tb-lr) {
	:classname(FIELDSET_CLASSNAME_) {
		padding-inline: 0;
		padding-block: 0.25em;
	}
}

:classname(FIELDSET_CLASSNAME_) + :classname(FIELDSET_CLASSNAME_)::before {
	display: block;
	content: '';
	width: 100%;
	height: 2px;
	margin: 0 0 0.125em 0;
	background: transparent;
}

@media not (writing-mode: tb-lr) {
	:classname(FIELDSET_CLASSNAME_) + :classname(FIELDSET_CLASSNAME_)::before {
		inline-size: 100%;
		block-size: 2px;
		margin-inline: 0;
		margin-block: 0 0.125em;
	}
}

:classname(LABEL_CLASSNAME_),
:classname(CHECKBOX_CLASSNAME_) {
	display: block;
	padding: 0.25em 0;
}

@media not (writing-mode: tb-lr) {
	:classname(LABEL_CLASSNAME_),
	:classname(CHECKBOX_CLASSNAME_) {
		padding-inline: 0;
		padding-block: 0.25em;
	}
}

:classname(LABEL_CLASSNAME_) span,
:classname(CHECKBOX_CLASSNAME_) span {
	display: block;
	font-size: 0.875em;
	text-transform: uppercase;
	color: #a26135;
	cursor: pointer;
}

:classname(CHECKBOX_CLASSNAME_) input {
	/* Make it visible for tab navigation */
	position: absolute;
	transform: scale(0);
}

:classname(CHECKBOX_CLASSNAME_) input + span::before {
	content: '☐ ';
	color: #431c01;
}

:classname(CHECKBOX_CLASSNAME_) input:checked + span::before {
	content: '☑ ';
	color: #006400;
}

:classname(CHECKBOX_CLASSNAME_) input:focus + span {
	outline: auto;
}

:classname(CHECKBOX_CLASSNAME_) input:active + span {
	color: #333;
}

:classname(CHECKBOX_CLASSNAME_) input:disabled + span {
	cursor: not-allowed;
}

:classname(LABEL_CLASSNAME_) input,
:classname(LABEL_CLASSNAME_) textarea {
	display: block;
	padding: 0.25em;
	background-color: #fff;
	color: #431c01;
	border-style: solid;
	border-width: 2px;
	border-color: currentColor;
	width: 24em;
	height: auto;
	max-width: 85%;
	max-width: calc(100vw - 2rem);
	max-height: none;
	font-size: 0.8em;
	transition: font-size 0.2s ease-out;
}

@media not (writing-mode: tb-lr) {
	:classname(LABEL_CLASSNAME_) input,
	:classname(LABEL_CLASSNAME_) textarea {
		inline-size: 24em;
		block-size: auto;
		max-inline-size: 85%;
		max-inline-size: calc(100vw - 2rem);
		max-inline-size: calc(100vi - 2rem);
		max-block-size: none;
	}
}

:classname(LABEL_CLASSNAME_) input:focus,
:classname(LABEL_CLASSNAME_) textarea:focus {
	font-size: 1em;
	transition: font-size 0.2s ease-in;
}

:classname(LABEL_CLASSNAME_) input:disabled,
:classname(LABEL_CLASSNAME_) textarea:disabled {
	cursor: not-allowed;
	color: #333;
	background-color: #ddd;
}

:classname(LABEL_CLASSNAME_) textarea {
	width: 24em;
	height: 5em;
}

@media not (writing-mode: tb-lr) {
	:classname(LABEL_CLASSNAME_) textarea {
		inline-size: 24em;
		block-size: 5em;
	}
}

:classname(LABEL_CLASSNAME_) input:invalid {
	border-color: red;
}

:classname(PRIMARY_BUTTON_CLASSNAME_) {
	display: inline-block;
	padding: 0.25em;
	margin: 0.5em 1%;
	text-transform: uppercase;
	max-width: 48%;
	max-height: none;
	width: 48%;
	height: auto;
	cursor: pointer;
	border: 2px solid currentColor;
	color: #fff;
	background-color: #431c01;
	appearance: button;
	user-select: none;
}

@media not (writing-mode: tb-lr) {
	:classname(PRIMARY_BUTTON_CLASSNAME_) {
		margin-inline: 1%;
		margin-block: 0.5em;
		max-inline-size: 48%;
		max-block-size: none;
		inline-size: 48%;
		block-size: auto;
	}
}

:classname(PRIMARY_BUTTON_CLASSNAME_):disabled {
	cursor: not-allowed;
	color: #fff;
	background-color: #61574f;
}

:classname(SECONDARY_BUTTON_CLASSNAME_) {
	display: inline-block;
	padding: 0.25em;
	margin: 0.5em 1%;
	max-width: 48%;
	max-height: none;
	width: 48%;
	height: auto;
	text-transform: uppercase;
	cursor: pointer;
	border: 2px solid currentColor;
	color: #a26135;
	background-color: white;
	user-select: none;
}

@media not (writing-mode: tb-lr) {
	:classname(SECONDARY_BUTTON_CLASSNAME_) {
		margin-inline: 1%;
		margin-block: 0.5em;
		max-inline-size: 48%;
		max-block-size: none;
		inline-size: 48%;
		block-size: auto;
	}
}

:classname(SECONDARY_BUTTON_CLASSNAME_):disabled {
	cursor: not-allowed;
	background-color: #ddd;
}
