/* GLOBAL STUFF */

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--bg-color: #e6e6e6;
	--font-color: #222;
	--primary-color: #e00;
	--inverted-font-color: #fff;
	--border-color: #ddd;
	--disabled-text-color: #fee;
	--input-bg-color: #fff;
	--gray-color: #666;
	--width: 42rem;
}

body {
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
		Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue",
		sans-serif;
	line-height: 1.5;
	color: var(--font-color);
	background-color: var(--bg-color);
}

main {
	max-width: var(--width);
	margin-inline: auto;
	padding: 1rem 0.75rem;
}

/* RESETS */

button,
input,
textarea {
	font: inherit;
	background: none;
	border: none;
	color: inherit;
}

button {
	cursor: pointer;
}

a {
	color: inherit;
}

/* HEADINGS */

h1,
h2 {
	font-weight: 600;
}

/* LINKS */

.link {
	text-decoration: underline;
	text-underline-offset: 0.2rem;
}

.link:focus-visible {
	outline: 0.1rem solid currentColor;
	outline-offset: 0.1rem;
}

/* BUTTONS */

.button {
	background-color: var(--primary-color);
	color: var(--inverted-font-color);
	border-radius: 0.25rem;
}

.button:not(.small) {
	font-weight: 500;
	padding: 0.4rem 0.8rem;
}

.button.small {
	padding: 0.25rem 0.5rem;
	font-size: 0.75rem;
}

.button:focus-visible {
	outline: 2px solid var(--gray-color);
	outline-offset: 2px;
}

/* TEXT INPUTS */

.input,
.textarea {
	border: 1px solid var(--border-color);
	border-radius: 0.25rem;
	outline: none;
	background-color: var(--input-bg-color);
	transition: color 150ms, border-color 150ms, background-color 150ms;
}

:is(.input, .textarea):focus-visible {
	border-color: var(--gray-color);
}

.input {
	padding: 0.2rem 0.4rem;
}

.textarea {
	width: 100%;
	height: 20rem;
	padding: 1rem;
	resize: vertical;
}

.input[disabled],
.textarea[disabled] {
	cursor: not-allowed;
	color: var(--gray-color);
	background-color: var(--disabled-text-color);
}

.label {
	font-weight: 500;
}

/* HOME PAGE */

.header {
	padding-block: 2rem 1rem;
	text-align: center;
}

.header h1 {
	font-size: 3rem;
}

.header p {
	font-size: 1.25rem;
}

.generate_form {
	display: flex;
	justify-content: center;
}

.recent_docs {
	margin-top: 2rem;
}

.recent_docs ul {
	margin: 0.5rem 0rem 1rem 1.5rem;
}

footer {
	margin-top: 2rem;
	padding-inline: 0.75rem;
	text-align: center;
	text-wrap: balance;
	color: var(--gray-color);
}

footer p {
	margin-block: 0.5rem;
}

/* NAVIGATION */

.nav {
	background-color: var(--primary-color);
	color: var(--inverted-font-color);
}

.nav_content {
	padding: 0.5rem 1rem;
	max-width: var(--width);
	margin-inline: auto;
	display: flex;
	align-items: center;
	gap: 1.5rem;
}

.nav_content h1 {
	margin-right: auto;
}

.nav button:focus-visible {
	outline: 1px solid var(--inverted-font-color);
	outline-offset: 2px;
}

.nav_el {
	display: flex;
	align-items: center;
}

.icon {
	height: 1.125rem;
}

/* COPY BUTTON */

.copy_button {
	position: relative;
}

.copy_button span {
	pointer-events: none;
	z-index: 10;
	position: absolute;
	white-space: nowrap;
	top: calc(100% + 1.25rem);
	right: 0;
	padding: 0.2rem 0.4rem;
	background-color: var(--primary-color);
	border-radius: 0.2rem;
	box-shadow: 0.2rem 0.2rem 0.4rem #0003;
	opacity: 0;
	transition: opacity 150ms, transform 150ms;
	transform: translateY(-0.5rem);
}

.copy_button.copied span {
	opacity: 1;
	transform: translateY(0rem);
}

/* TITLE INPUT */

.title_input {
	font-size: 2rem;
	font-weight: 500;
	margin-top: 0.5rem;
	width: 100%;
	padding: 0.4rem 0.8rem;
}

/* USER BLOCK */

.user_block {
	display: grid;
	gap: 1rem;
	margin-block: 0.5rem 1rem;
}

@media (min-width: 38rem) {
	.user_block {
		grid-template-columns: 1fr auto;
	}
}

.input_group {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.name_input {
	width: 10rem;
}

/* STATUS MESSAGES */

.status {
	font-size: 0.75rem;
	color: var(--gray-color);
	margin-top: 0.25rem;
}

.status_bar {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}

/* ERROR PAGE */

.error_page {
	padding: 1rem;
}
