:root {
	--colour-white: #FFF;
	--colour-orange: #EB6A34;
	--colour-grey75: #686E74;
	--colour-grey50: #9A9EA3;
	--colour-grey25: #CDCFD1;
	--colour-grey5: #F4F4F4;
	--colour-black: #222222;

	--colour-result-unknown: #9D9D9D;
	--colour-result-unknown-border: #9D9D9D;
	--colour-result-valid: #7FB964;
	--colour-result-valid-border: #7FB964;
	--colour-result-invalid: #CA4242;
	--colour-result-invalid-border: #CA4242;

	--colour-index-button: #61686B;

	--height-banner: 54px;
	--height-large: 72px;

	--width-break: 800px;

	--padding-internal: 30px;

	--result-section-gap: 10px;

	--corner-radius: 7px;
	--dark-color: #222;
	--section-corner-radius: 7px;
	--section-padding: 12px;
}

/* resets */
/* Box sizing rules */
*, *::before, *::after { box-sizing: border-box; }
/* Prevent font size inflation */
html { -moz-text-size-adjust: none; -webkit-text-size-adjust: none; text-size-adjust: none; }
/* Remove default margin in favour of better control in authored CSS */
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin-block-end: 0; }
/* Set core body defaults */
body { min-height: 100vh; line-height: 1.5; }
/* Set shorter line heights on headings and interactive elements */
h1, h2, h3, h4, button, input, label { line-height: 1.1; }
/* Balance text wrapping on headings */
h1, h2, h3, h4 { text-wrap: balance; }
/* A elements that don't have a class get default styles */
a:not([class]) { text-decoration-skip-ink: auto; }
/* Make images easier to work with */
img, picture { max-width: 100%; display: block; }
/* Inherit fonts for inputs and buttons */
input, button, textarea, select { font-family: inherit; font-size: inherit; }
/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) { min-height: 10em; }
/* Anything that has been anchored to should have extra scroll margin */
:target { scroll-margin-block: 5ex; }
/* end resets */

body {
	background: var(--colour-grey5);
	color: var(--colour-grey75);
	font-family: Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif;
	font-size: 18px;
	font-weight: normal;
	line-height: 1.7;
	margin: 0;
}
a, a:visited, a:active {
	color: var(--colour-grey75);
	text-underline-offset: 4px;
}

select {
	width: 100%;
	border: 0;
	color: inherit;
	background-color: inherit;
}

/* wraps the entire page to avoid grid on body */
.page {
	display: grid;
	grid-template-rows: var(--height-banner) 1fr 100px;
	height: 100vh;
}

header.site {
	display: grid;
	grid-template-columns: 1fr 150px;
	background-color: var(--colour-white);
	.branding {
		img {
			max-height: var(--height-banner);
			object-fit: contain;
			padding: 8px;
		}
	}
	.settings {
		font-weight: 700;
		text-decoration: none;
	}
}

/* constrain the width of main content */
main,
footer.site {
	max-width: var(--width-break);
	margin-left: auto;
	margin-right: auto;
}
.icon img {
	object-fit: contain;
}

.with-icon {
	display: flex;
	align-items: center;
	gap: 10px;
	.icon {
		/* width: 1lh; */
		/* height: 1lh; */
	}
	.content {
	}
}
.title h2 {
	font-size: 25px;
}

footer.site {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	margin-top: 100px;
	text-align: center;
	.version {
		color: var(--colour-grey50);
	}
}


body.index {
	header .branding img {
		display: none;
	}
	main {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		gap: 50px;
		margin-top: 60px;
		.logo {
			width: 800px;
		}
		.input-area {
			display: flex;
			flex-direction: column;
			width: 100%;
			align-items: center;
			justify-content: center;
		}
		form {
			width: 100%;
		}
		.errors {
			font-size: 1.25rem;
			color: var(--colour-result-invalid);
			ul {
				margin: 0;
			}
		}
	}
	.scan-buttons {
		display: grid;
		grid-template-columns: 1fr 1fr;
		column-gap: var(--result-section-gap);
		row-gap: var(--result-section-gap);
		width: 100%;
		button {
			align-items: center;
			background-color: var(--colour-white);
			border-radius: 8px;
			border: 1px solid var(--colour-grey25);
			color: var(--colour-index-button);
			display: flex;
			font-size: 20px;
			height: var(--height-large);
			justify-content: center;
		}
		button:disabled {
			opacity: .3;
		}
	}

	form input {
		flex: 1;
		background-color: var(--colour-white);
		border: 1px solid var(--colour-grey25);
	}

	form.digsig {
		display: flex;
		input:focus-visible {
			outline: none;
		}
		input {
			flex: 1;
			background-color: var(--colour-white);
			border-top: 3px solid var(--colour-orange);
			border-left: 3px solid var(--colour-orange);
			border-bottom: 3px solid var(--colour-orange);
			border-top-left-radius: 8px;
			border-bottom-left-radius: 8px;
			border-right: 0;
			line-height: var(--height-large);
			padding-left: 20px;
		}
		button {
			background-color: var(--colour-white);
			border-top: 3px solid var(--colour-orange);
			border-right: 3px solid var(--colour-orange);
			border-bottom: 3px solid var(--colour-orange);
			border-top-right-radius: 8px;
			border-bottom-right-radius: 8px;
			border-left: 0;
			padding-right: 20px;
		}
	}
	form.datasnips {
		display: flex;
		flex-direction: column;
		gap: 20px;
		align-items: center;
		justify-content: center;
		input {
			line-height: 2;
			padding-left: 10px;
			padding-right: 10px;
		}
		button {
			background-color: var(--colour-white);
			border: 3px solid var(--colour-orange);
			border-radius: 8px;
			min-width: 200px;
			padding: 20px;
		}
	}
}

body.result {
	.result {
		background-color: var(--colour-result-unknown);
		border-radius: 8px;
		border: 1px solid var(--colour-result-unknown-border);
		color: var(--colour-white);
		font-size: 20px;
		font-weight: 700;
		height: var(--height-large);
		margin-bottom: calc(2*var(--result-section-gap));
		margin-top: 60px;
		padding: 15px;
		display: flex;
		align-items: start;
		gap: 10px;

		.message {
			line-height: 1.25lh;
		}
		.summary {
			text-transform: uppercase;
		}
		.postverify {
			margin-left: 10px;
		}
		&.invalid {
			background-color: var(--colour-result-invalid);
			border: 1px solid var(--colour-result-invalid-border);
		}
		&.valid {
			background-color: var(--colour-result-valid);
			border: 1px solid var(--colour-result-valid-border);
		}
	}
	.details {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: var(--result-section-gap);
		row-gap: var(--result-section-gap);
		section {
			background-color: var(--colour-white);
			border: 1px solid var(--colour-grey25);
			border-radius: 8px;
			padding-left: var(--padding-internal);
			padding-right: var(--padding-internal);
			.title {
				display: flex;
				color: var(--colour-orange);
				h2 {
					flex-grow: 1;
				}
				select, button {
					background-color: white;
					border-radius: 8px;
					border: 1px solid var(--colour-grey25);
					color: inherit;
					margin-top: 1rem;
					margin-left: 1rem;
					padding: 0 10px;
					text-decoration: none;
					width: auto;
				}
			}
		}
	}
}
.fieldlist ol, .fieldlist ul {
	list-style: none;
	padding-left: 0;
	li.field {
		border-top: 1px solid var(--colour-grey25);
		display: flex;
		flex-direction: column;
		font-weight: 400;
		overflow-wrap: anywhere;
		padding-bottom: 20px;
		padding-top: 20px;
		.label {
			font-weight: 700;
		}
	}
	.field.structureddocuri .value a {
		display: inline-block;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		width: 100%;
	}
}

dialog#cameraModal {
	.video {
		display: grid;
		grid-template-rows: var(--height-banner) 1fr;
	}
	.close {
		display: block;
		background-color: white;
		padding: 5px;
		text-align: right;
		text-decoration: none;
	}
	video {
		margin-left: auto;
		margin-right: auto;
	}
}

.language {
	display: none;
	&.current {
		display: inherit;
	}
}

dialog {
	min-width: 400px;
	max-width: 85%;
	border: 1 px solid var(--colour-grey50);
	border-radius: 8px;
	color: var(--colour-grey75);
	.close {
		float: right;
	}
	.title h2 {
		font-size: 18px;
	}
	pre {
		font-size: .75rem;
	}
	.field {
		border-top: 0;
	}
	.label {
		border-bottom: 1px solid var(--colour-grey25);
	}
}

@media  (width <= 800px) {
	header.site {
		grid-template-columns: 1fr 50px;
		.settings.with-icon {
			.content {
				display: none;
			}
		}
	}
	main {
		margin-left: var(--result-section-gap);
		margin-right: var(--result-section-gap);
	}
	body.result {
		.result {
			margin-top: 30px;
		}
		.details {
			grid-template-columns: 1fr;
		}
	}
	body.index {
		.scan-buttons {
			grid-template-columns: 1fr;
		}
	}
}
