/* ######################################## */
/* General layout */
/* ######################################## */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

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

:root {
	--padding-desktop: 30px;
	--margin-desktop: 60px;
	--padding-mobile: 25px;
	--margin-mobile: 20px;
	--button-color: #2121214b;
	--highlight-color: rgb(178, 255, 252);
	--text-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
	--base-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

html, body {
	margin: 0;
	padding: 0;
	font-family: "Montserrat";
	font-size: 12pt;
	color: white;
	background: url('assets/bg.png') no-repeat center center fixed;
	background-size: cover;
}

.app {
	width: calc(100% - 2 * var(--margin-desktop));
	margin: var(--margin-desktop) auto 0;
	height: calc(100vh - 2 * var(--margin-desktop));
	min-height: 500px;
	background-color: #0000002a;
	backdrop-filter: blur(20px);
	box-shadow: 0 0 40px rgba(20, 20, 20, 0.6);
	border-radius: 1.5rem;
	display: grid;
	grid-template-areas:
		"header header"
		"inputs results";
	grid-template-rows: auto 1fr;
	grid-template-columns: 450px 1fr;
	overflow: hidden;
}

h1, h2, h3 {
	margin: 0;
	margin-bottom: 0.5rem;
	text-shadow: var(--text-shadow);
}

h1 {
	margin-top: 0;
}

h3 {
	margin-top: 0.5rem;
}

.link {
	display: inline-block;
	color: white;
	text-decoration: none;
	transition: all 0.2s;
}

.link:hover {
	font-weight: 500;
	color: var(--highlight-color);
}

/* ######################################## */
/* Sections */
/* ######################################## */

.header {
	grid-area: header;
	padding: var(--padding-desktop);
	padding-bottom: calc(var(--padding-desktop) / 2);
}

.inputs, .results {
	padding: var(--padding-desktop);
	padding-top: calc(var(--padding-desktop) / 2);
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

.inputs {
	grid-area: inputs;
	padding-right: calc(var(--padding-desktop) / 2);
}

.results {
	grid-area: results;
	padding-left: calc(var(--padding-desktop) / 2);
}

.boxes {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	scrollbar-gutter: stable;
	padding: 8px;
	margin: -8px;
}

.results_container {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

.footer {
	width: calc(100% - 2 * var(--margin-desktop));
	margin: 0 auto;
	height: var(--margin-desktop);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	text-shadow: var(--text-shadow);
}


/* ######################################## */
/* Input boxes */
/* ######################################## */

.box {
	font-size: 10pt;
	padding-bottom: 10px;
}

.box_top {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.box_label {
	text-shadow: var(--text-shadow);
}

.box_input {
	font-family: inherit;
	font-size: 10pt;
	margin-left: auto;
	align-self: center;
	border: none;
	border-radius: 0.4rem;
	width: 110px;
	text-align: center;
	outline: none;
	color: white;
	background-color: var(--button-color);
	box-shadow: var(--base-box-shadow);
	transition: box-shadow 0.5s;
}

.box_input:hover {
	box-shadow: var(--base-box-shadow), 0 0 5px rgba(255, 255, 255, 1);
}

.box_input:focus {
	box-shadow: var(--base-box-shadow), 0 0 5px 2px var(--highlight-color), 0 0 0 2px var(--highlight-color);
	font-weight: 600;
	transition: all 0.15s;
}

.box_error, #results_error {
	color: salmon;
	font-weight: 600;
	flex-shrink: 0;
	text-shadow: 0 0 5px rgba(0, 0, 0, 0.6);
}


/* ######################################## */
/* Results */
/* ######################################## */

.figure_container {
	flex: 0 1 auto;
	min-height: 0;
	min-width: 0;
}

#figure {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	margin: 0 auto;
	border-radius: 0.5rem;
}

#button {
	flex-shrink: 0;
	align-self: center;
	margin-top: calc(var(--padding-desktop) / 2);
	font: inherit;
	font-weight: 600;
	background-color: var(--button-color);
	box-shadow: var(--base-box-shadow);
	color: white;
	text-decoration: none;
	padding: 8px 10px;
	border-radius: 0.75rem;
	transition: box-shadow 0.25s;
}

#button:hover {
	box-shadow: var(--base-box-shadow), 0 0 10px rgba(255, 255, 255, 1);
}

#button:active {
	transform: scale(0.95);
}


/* ######################################## */
/* Mobile view */
/* ######################################## */

@media (max-width: 900px), (pointer: coarse) {

	body {
		background: none;
	}

	body::before {
		content: "";
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: url('/assets/bg.png') no-repeat center center;
		background-size: cover;
		z-index: -1;
	}

	.app {
		width: calc(100% - 2 * var(--margin-mobile));
		margin: var(--margin-mobile);
		margin-bottom: auto;
		height: auto;
		min-height: unset;
		grid-template-areas:
			"header"
			"inputs"
			"results";
		grid-template-columns: 1fr;
		grid-template-rows: auto auto auto;
		box-shadow: 0 0 20px rgba(20, 20, 20, 0.6)
	}

	.footer {
		width: calc(100% - 2 * var(--margin-mobile));
		height: 40px;
	}

	.header {
		padding: var(--padding-mobile);
		padding-bottom: 0;
		font-size: 10pt;
	}

	.results {
		padding: var(--padding-mobile);
	}

	.inputs {
		overflow: visible;
		min-height: unset;
		padding: var(--padding-mobile);
		padding-bottom: 0;
	}

	.boxes {
		overflow-y: visible;
	}
}