:root {
	--accent-base: #fc364d;
	--accent-shadow: #b8273a;
	--primary-color-base: #d32f3f;
	--white: #fff;
	--very-light-grey: #fafafa;
	--light-grey: #e4e4e7;
	--grey: #a1a1aa;
	--dark-grey: #3f3f46;
	--black: #18181b;
	--colored-background: radial-gradient(circle at center 150%, var(--accent-shadow) 0%, var(--accent-base) 110%);
	--dot-pattern: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMiIgY3k9IjIiIHI9IjIiIGZpbGw9IiNmZmZmZmYiLz48L3N2Zz4=');
}

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

[hidden] {
	display: none !important;
}

body {
	margin: 0;
	font-family: "Outfit", "Open Sans", sans-serif;
	color: var(--black);
	background: var(--light-grey);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
	font-weight: 700;
	margin: 0;
	line-height: 1.2;
}

p {
	margin: 0;
	color: var(--dark-grey);
}

a {
	color: var(--primary-color-base);
	font-weight: 600;
	text-decoration: none;

	&:hover {
		text-decoration: underline;
	}
}

button,
input,
textarea,
select {
	font: inherit;
}

:focus-visible {
	outline: 2px solid var(--accent-base);
	outline-offset: 2px;
}

body > a {
	position: fixed;
	top: -5rem;
	left: 1rem;
	z-index: 80;
	background: var(--black);
	color: var(--white);
	padding: 0.6rem 1.2rem;
	border-radius: 99rem;
	font-weight: 600;
	transition: top 0.2s;

	&:focus {
		top: 1rem;
		color: var(--white);
	}
}

body > header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--light-grey);

	& nav {
		max-width: 1060px;
		margin: 0 auto;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
		padding: 0.65rem 1rem;
		flex-wrap: wrap;

		& > a {
			display: flex;
			align-items: center;
			color: var(--black);
			font-weight: 700;
			font-size: 1.02rem;
			text-decoration: none;

			&:hover {
				text-decoration: none;
			}

			& svg {
				width: 30px;
				height: 30px;
				border-radius: 0.55rem;
				background: var(--colored-background);
				padding: 6px;
				color: var(--white);
				flex-shrink: 0;
				margin-right: 0.55rem;
			}

			& span {
				color: var(--primary-color-base);
			}
		}

		& ul {
			display: flex;
			gap: 1.1rem;
			align-items: center;
			flex-wrap: wrap;
			margin: 0;
			padding: 0;
			list-style: none;

			& a {
				font-size: 0.88rem;
				font-weight: 600;
				color: var(--dark-grey);

				&:hover {
					color: var(--primary-color-base);
					text-decoration: none;
				}
			}

			& [aria-current="page"] {
				color: var(--primary-color-base);
			}
		}

		@media (max-width: 880px) {
			justify-content: center;
		}
	}
}

#nav-auth {
	display: inline-flex;
}

[data-open],
[data-edit],
[data-cancel],
[data-action],
#nav-auth button {
	border: 1.5px solid var(--light-grey);
	background: var(--white);
	color: var(--dark-grey);
	border-radius: 99rem;
	padding: 0.5rem 1rem;
	font-weight: 700;
	font-size: 0.8rem;
	cursor: pointer;
	transition: border-color 0.2s, color 0.2s;

	&:hover {
		border-color: var(--primary-color-base);
		color: var(--primary-color-base);
	}
}

[data-open] {
	width: 100%;
	margin-top: auto;
}

[data-edit],
[data-cancel],
[data-action] {
	padding: 0.25rem 0.8rem;
	font-size: 0.72rem;
}

[data-action="delete"]:hover {
	border-color: var(--accent-shadow);
	color: var(--accent-shadow);
}

.row-actions {
	white-space: nowrap;
	text-align: right;

	& button + button {
		margin-left: 0.35rem;
	}
}

#nav-auth button {
	padding: 0.42rem 1rem;
	font-size: 0.82rem;
}

button[type="submit"] {
	border: 0;
	background: var(--black);
	color: var(--white);
	border-radius: 99rem;
	padding: 0.6rem 1.3rem;
	font-weight: 700;
	font-size: 0.85rem;
	cursor: pointer;
	transition: background 0.2s;

	&:hover {
		background: #000;
	}
}

[data-kind] {
	display: inline-block;
	padding: 0.2rem 0.6rem;
	border-radius: 99rem;
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;

	&[data-kind="workout"] {
		background: rgba(24, 24, 27, 0.08);
		color: var(--black);
	}

	&[data-kind="note"] {
		background: var(--very-light-grey);
		color: var(--grey);
	}

	&[data-kind="type"] {
		background: rgba(211, 47, 63, 0.12);
		color: var(--primary-color-base);
	}

	&[data-kind="meas"] {
		background: rgba(38, 147, 128, 0.1);
		color: #1f7a68;
		margin: 0.15rem 0.1rem;

		& em {
			font-style: normal;
			text-transform: none;
			font-weight: 400;
			opacity: 0.7;
		}
	}
}

#dash-metric,
#dash-workout,
#dash-medical {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

main {
	max-width: 1060px;
	margin: 0 auto;
	padding: 1.4rem 1rem 3rem;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;

	& h1,
	& h2 {
		font-size: 1.3rem;
	}

	& h3 {
		font-size: 0.95rem;
	}

	& label {
		display: block;
		font-size: 0.68rem;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.07em;
		color: var(--grey);
		margin-bottom: 0.15rem;
	}

	& input,
	& textarea {
		border: 1px solid var(--light-grey);
		border-radius: 0.65rem;
		padding: 0.55rem 0.8rem;
		font-size: 0.9rem;
		color: var(--black);
		width: 100%;

		&::placeholder {
			color: var(--grey);
		}

		&:focus {
			outline: none;
			border-color: var(--primary-color-base);
			box-shadow: 0 0 0 2px rgba(211, 47, 63, 0.15);
		}
	}

	& textarea {
		min-height: 4.5rem;
		resize: vertical;
	}

	& input[type="search"] {
		border-radius: 99rem;
		padding: 0.5rem 1rem;
		width: min(280px, 100%);
	}

	& section > p {
		font-size: 0.8rem;
		color: var(--grey);
		margin: 0.35rem 0 0.9rem;
	}

	& span:has(+ :is(h1, h2)) {
		display: inline-block;
		padding: 0.3rem 0.85rem;
		background: rgba(211, 47, 63, 0.1);
		color: var(--primary-color-base);
		border-radius: 99rem;
		font-size: 0.7rem;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.08em;
		margin-bottom: 0.55rem;
	}

	& :is(div, header):has(> div > :is(h1, h2)) {
		display: flex;
		justify-content: space-between;
		align-items: flex-end;
		gap: 1rem;
		flex-wrap: wrap;
		margin-bottom: 0.9rem;

		& > a {
			display: inline-block;
			border: 1.5px solid var(--primary-color-base);
			color: var(--primary-color-base);
			border-radius: 99rem;
			padding: 0.55rem 1.15rem;
			font-weight: 700;
			font-size: 0.85rem;
			cursor: pointer;
			background: var(--white);
			transition: background 0.2s, color 0.2s;

			&:hover {
				background: var(--primary-color-base);
				color: var(--white);
				text-decoration: none;
			}
		}

		& > p {
			font-size: 0.8rem;
			color: var(--grey);
		}

		@media (max-width: 580px) {
			align-items: flex-start;
			flex-direction: column;
		}
	}

	& section:has(> div > strong) {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
		gap: 1rem;

		& > div {
			background: var(--white);
			border: 1px solid var(--light-grey);
			border-radius: 1rem;
			padding: 1.05rem 1.2rem;
		}

		& > div > span {
			display: block;
			font-size: 0.68rem;
			font-weight: 700;
			text-transform: uppercase;
			letter-spacing: 0.08em;
			color: var(--grey);
			margin-bottom: 0.3rem;
		}

		& strong {
			display: block;
			font-size: 1.55rem;
			color: var(--black);
			font-variant-numeric: tabular-nums;
			line-height: 1.2;

			&[data-delta="down"] {
				color: var(--primary-color-base);
			}

			& span {
				display: inline;
				font-size: 0.85rem;
				font-weight: 600;
				color: var(--grey);
				text-transform: none;
				letter-spacing: normal;
			}
		}

		& > div > small {
			display: block;
			font-size: 0.75rem;
			color: var(--grey);
			margin-top: 0.25rem;
		}

		@media (max-width: 880px) {
			grid-template-columns: repeat(2, 1fr);
		}
	}

	& div:has(> table) {
		border: 1px solid var(--light-grey);
		border-radius: 1rem;
		overflow-x: auto;
		background: var(--white);
	}

	& table {
		width: 100%;
		border-collapse: collapse;

		& th {
			background: var(--very-light-grey);
			color: var(--dark-grey);
			font-size: 0.7rem;
			font-weight: 700;
			text-transform: uppercase;
			letter-spacing: 0.08em;
			text-align: left;
			padding: 0.7rem 1rem;
			border-bottom: 1px solid var(--light-grey);
			white-space: nowrap;
		}

		& td {
			padding: 0.75rem 1rem;
			font-size: 0.85rem;
			color: var(--dark-grey);
			border-bottom: 1px solid var(--light-grey);
			vertical-align: top;
		}

		& tr:last-child td {
			border-bottom: none;
		}

		& tr:hover td {
			background: var(--very-light-grey);
		}

		& th:first-child,
		& td:first-child {
			width: 7.5rem;
			white-space: nowrap;
			font-variant-numeric: tabular-nums;
		}

		& td:first-child {
			font-weight: 600;
			color: var(--black);
		}

		&:has([data-kind]) {
			& td:nth-child(2) {
				white-space: nowrap;
				width: 8.5rem;
			}
		}
	}
}

#quickadd {
	position: relative;
	background: var(--colored-background);
	border-radius: 1.4rem;
	padding: 2rem 1.4rem;
	text-align: center;
	color: var(--white);
	box-shadow: 0 25px 50px -12px rgba(184, 39, 58, 0.45);
	overflow: hidden;

	&::before {
		content: "";
		position: absolute;
		inset: 0;
		background-image: var(--dot-pattern);
		opacity: 0.08;
		mix-blend-mode: overlay;
		pointer-events: none;
	}

	& > * {
		position: relative;
		z-index: 1;
	}

	& > span {
		display: inline-block;
		padding: 0.4rem 1rem;
		border: 1px solid rgba(255, 255, 255, 0.25);
		background: rgba(0, 0, 0, 0.12);
		border-radius: 99rem;
		font-size: 0.75rem;
		font-weight: 600;
		text-transform: uppercase;
		letter-spacing: 0.08em;
		color: var(--white);
		white-space: nowrap;
		margin-bottom: 1.2rem;
	}

	& h1 {
		font-size: clamp(1.5rem, 3.5vw, 2.1rem);
		color: var(--white);
	}

	& > p {
		margin: 0.35rem 0 0;
		color: rgba(255, 255, 255, 0.85);
		font-size: 0.92rem;
	}

	& > div {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 0.45rem;
		margin: 1.3rem auto 0.4rem;
		max-width: 560px;

		& button {
			border: 1px solid rgba(255, 255, 255, 0.35);
			background: rgba(0, 0, 0, 0.14);
			color: var(--white);
			border-radius: 99rem;
			padding: 0.45rem 0.95rem;
			font-size: 0.8rem;
			font-weight: 600;
			cursor: pointer;
			transition: background 0.2s, border-color 0.2s;

			&:hover {
				background: rgba(0, 0, 0, 0.28);
			}

			&[aria-pressed="true"] {
				background: var(--white);
				border-color: var(--white);
				color: var(--primary-color-base);
			}
		}
	}

	& #qa-single-row,
	& #qa-bp-row {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 0.9rem;
		margin: 1.6rem 0 1.4rem;
	}

	& #qa-single-row > div,
	& #qa-bp-row > div {
		position: relative;
		display: inline-flex;
		align-items: center;
		background: var(--white);
		border-radius: 1rem;
		padding: 0.15rem 3.4rem 0.15rem 1.2rem;
		box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
		transition: box-shadow 0.2s;

		&:focus-within {
			box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.65), 0 10px 30px rgba(0, 0, 0, 0.22);
		}

		@media (max-width: 580px) {
			padding: 0.15rem 2.9rem 0.15rem 0.8rem;
		}
	}

	& #qa-value,
	& #qa-sys,
	& #qa-dia {
		border: 0;
		background: transparent;
		font-weight: 700;
		color: var(--black);
		font-size: clamp(2.3rem, 7vw, 3.2rem);
		line-height: 1.15;
		width: clamp(6.5ch, 45vw, 8.5ch);
		text-align: center;
		font-variant-numeric: tabular-nums;
		padding: 0.25rem 0;
	}

	& #qa-bp-row {
		& > div {
			padding: 0.15rem 1.2rem;

			& input {
				width: 4.5ch;
				font-size: 2rem;
			}
		}

		& > span {
			font-size: 2rem;
			font-weight: 700;
			color: var(--white);
			opacity: 0.9;
		}

		& > small {
			font-size: 0.85rem;
			font-weight: 600;
			color: rgba(255, 255, 255, 0.85);
			margin-left: 0.3rem;
		}
	}

	& #qa-unit {
		position: absolute;
		right: 1rem;
		font-size: 1.05rem;
		font-weight: 600;
		color: var(--grey);
	}

	& #qa-minus,
	& #qa-plus {
		width: 56px;
		height: 56px;
		border-radius: 50%;
		border: 0;
		background: var(--white);
		color: var(--primary-color-base);
		font-size: 1.7rem;
		font-weight: 700;
		cursor: pointer;
		display: grid;
		place-items: center;
		box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
		transition: transform 0.15s;

		&:hover {
			transform: scale(1.06);
		}

		&:active {
			transform: scale(0.94);
		}

		@media (max-width: 580px) {
			width: 46px;
			height: 46px;
			font-size: 1.4rem;
		}
	}

	& #qa-workout,
	& #qa-medical {
		margin: 1.6rem 0 1.4rem;
		display: flex;
		flex-direction: column;
		align-items: center;

		& input,
		& textarea {
			border: 0;
			border-radius: 0.8rem;
			padding: 0.75rem 1rem;
			font-size: 0.95rem;
			width: min(480px, 100%);
			color: var(--black);
			background: var(--white);
			box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
			margin-top: 0.55rem;
		}

		& textarea {
			min-height: 74px;
			resize: vertical;
		}
	}

	& #qa-workout input {
		margin-top: 0;
	}

	& #qa-workout {
		gap: 0.55rem;
	}

	& #qa-date-row {
		display: flex;
		justify-content: center;
		margin: 1.4rem 0 0;

		& input {
			border: 0;
			border-radius: 0.8rem;
			padding: 0.5rem 0.9rem;
			font-size: 0.9rem;
			color: var(--black);
			background: var(--white);
			box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
		}
	}

	& #qa-medical > div {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 0.55rem;
		width: min(480px, 100%);

		& input {
			width: auto;
			flex: 1 1 180px;
			margin-top: 0;
		}

		& input[type="date"] {
			flex: 0 1 150px;
		}
	}

	& #qa-save {
		padding: 0.95rem 2.6rem;
		font-size: 1.05rem;
		box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
		transition: transform 0.15s, background 0.2s;

		&:hover {
			transform: translateY(-1px);
		}

		&:active {
			transform: translateY(0);
		}

		& kbd {
			margin-left: 0.55rem;
			font-size: 0.72rem;
			font-weight: 600;
			border: 1px solid rgba(255, 255, 255, 0.35);
			border-radius: 0.45rem;
			padding: 0.02rem 0.5rem;
			vertical-align: middle;
			opacity: 0.85;
		}

		@media (max-width: 580px) {
			width: 100%;
		}
	}

	& #qa-cancel {
		border: 1px solid rgba(255, 255, 255, 0.5);
		background: rgba(0, 0, 0, 0.18);
		color: var(--white);
		border-radius: 99rem;
		padding: 0.95rem 1.8rem;
		font-size: 0.95rem;
		font-weight: 700;
		cursor: pointer;
		margin-left: 0.6rem;
		transition: background 0.2s, border-color 0.2s;

		&:hover {
			background: rgba(0, 0, 0, 0.32);
			border-color: var(--white);
		}

		@media (max-width: 580px) {
			width: 100%;
			margin: 0.6rem 0 0;
		}
	}

	& #qa-editing {
		margin-top: 0.9rem;
		font-size: 0.8rem;
		font-weight: 600;
		color: rgba(255, 255, 255, 0.9);
	}

	@media (max-width: 580px) {
		padding: 1.6rem 1rem;
	}
}

#trend {
	background: var(--white);
	border: 1px solid var(--light-grey);
	border-radius: 1.1rem;
	padding: 1.3rem 1.4rem;

	& :is(h1, h2) {
		font-size: 1.15rem;
	}

	& > div {
		align-items: center;
		margin-bottom: 0;
	}

	& [role="group"] {
		display: flex;
		gap: 0.4rem;

		& button {
			border: 1px solid var(--light-grey);
			background: var(--white);
			color: var(--grey);
			font-size: 0.75rem;
			font-weight: 700;
			padding: 0.3rem 0.85rem;
			border-radius: 99rem;
			cursor: pointer;
			transition: border-color 0.2s, color 0.2s;

			&:hover {
				border-color: var(--grey);
				color: var(--black);
			}

			&[aria-pressed="true"] {
				background: var(--primary-color-base);
				border-color: var(--primary-color-base);
				color: var(--white);
			}
		}
	}

	& svg {
		width: 100%;
		height: auto;
		display: block;

		& text {
			font-size: 10px;
			fill: var(--grey);
		}
	}
}

#log {
	& > div:last-child {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: 1rem;

		@media (max-width: 580px) {
			grid-template-columns: 1fr;
		}

		& > div {
			background: var(--white);
			border: 1px solid var(--light-grey);
			border-radius: 1.1rem;
			padding: 1.15rem 1.2rem;
			display: flex;
			flex-direction: column;
			gap: 0.9rem;
			transition: border-color 0.2s;

			&:hover {
				border-color: rgba(211, 47, 63, 0.45);
			}

			& > div {
				display: flex;
				align-items: center;
				gap: 0.7rem;

				& svg {
					width: 38px;
					height: 38px;
					border-radius: 0.7rem;
					background: rgba(211, 47, 63, 0.1);
					color: var(--primary-color-base);
					padding: 9px;
					flex-shrink: 0;
				}

				& p {
					font-size: 0.75rem;
					line-height: 1.35;
				}
			}

			& form {
				display: flex;
				flex-direction: column;
				gap: 0.5rem;
				margin-top: auto;

				& button {
					padding: 0.5rem 1rem;
					font-size: 0.8rem;
				}
			}
		}
	}
}

#med-add {
	background: var(--white);
	border: 1px solid var(--light-grey);
	border-radius: 1.1rem;
	padding: 1.3rem 1.4rem;

	& h2 {
		font-size: 1.15rem;
	}

	& form {
		display: flex;
		flex-direction: column;
		gap: 0.65rem;
		margin-top: 0.6rem;

		& > div:has(> div) {
			display: grid;
			grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
			gap: 0.65rem;
		}
	}

	& > p {
		font-size: 0.72rem;
		color: var(--grey);
		margin: 0.7rem 0 0;
	}

	& #attach-btn {
		border: 1.5px dashed var(--light-grey);
		border-radius: 0.65rem;
		padding: 0.55rem 0.8rem;
		background: var(--very-light-grey);
		color: var(--grey);
		font-size: 0.8rem;
		font-weight: 600;
		cursor: pointer;
		width: 100%;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 0.45rem;
		transition: border-color 0.2s, color 0.2s;

		&:hover {
			border-color: var(--grey);
			color: var(--dark-grey);
		}

		& svg {
			width: 14px;
			height: 14px;
		}
	}
}

#med-records {
	display: flex;
	flex-direction: column;
	gap: 0.8rem;

	& p {
		font-size: 0.88rem;
		color: var(--dark-grey);
		white-space: pre-line;

		&:has([data-kind]) {
			white-space: normal;
			line-height: 1.7;
			margin: 0.5rem 0 0;
		}

		&:has(> strong) {
			font-size: 0.78rem;
			white-space: normal;
			margin: 0.55rem 0 0;

			& strong {
				display: block;
				font-size: 0.68rem;
				text-transform: uppercase;
				letter-spacing: 0.08em;
				color: var(--primary-color-base);
				margin-bottom: 0.25rem;
			}

			& a {
				display: block;
				width: fit-content;
				max-width: 100%;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				color: var(--dark-grey);
				line-height: 1.5;

				&:hover {
					color: var(--primary-color-base);
				}
			}
		}
	}

	& > p {
		font-size: 0.85rem;
		color: var(--grey);
		padding: 1.2rem 0;
		text-align: center;
		margin: 0;
		white-space: normal;

		& code {
			background: var(--very-light-grey);
			border: 1px solid var(--light-grey);
			border-radius: 0.4rem;
			padding: 0.05rem 0.4rem;
			font-size: 0.78rem;
		}
	}

	& article {
		background: var(--white);
		border: 1px solid var(--light-grey);
		border-radius: 1rem;
		padding: 1.05rem 1.2rem;

		&[data-editing] {
			border-color: rgba(211, 47, 63, 0.5);
		}

		& > header {
			display: flex;
			align-items: center;
			gap: 0.7rem;
			flex-wrap: wrap;
			margin-bottom: 0.35rem;

			& > span:first-child {
				font-weight: 700;
				color: var(--black);
				font-variant-numeric: tabular-nums;
				margin-right: auto;
			}
		}

		& h3 {
			margin-bottom: 0.25rem;
		}

		& footer {
			margin-top: 0.5rem;
			font-size: 0.78rem;
			color: var(--grey);
		}
	}

	& form {
		display: flex;
		flex-direction: column;
		gap: 0.65rem;

		& > div:has(> div) {
			display: grid;
			grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
			gap: 0.65rem;
		}

		& > div:has(> button) {
			display: flex;
			gap: 0.6rem;
		}
	}
}

#login {
	& > main {
		max-width: none;
		margin: 0;
		padding: 1.5rem 1rem;
		gap: 0;
		min-height: 100vh;
		display: flex;
		align-items: center;
		justify-content: center;
		background: var(--colored-background);
		position: relative;
		overflow: hidden;

		&::before {
			content: "";
			position: absolute;
			inset: 0;
			background-image: var(--dot-pattern);
			opacity: 0.08;
			mix-blend-mode: overlay;
			pointer-events: none;
		}

		& > div {
			position: relative;
			z-index: 1;
			background: var(--white);
			border-radius: 1.6rem;
			padding: 2.2rem 2rem 1.8rem;
			width: min(380px, 100%);
			text-align: center;
			box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);

			& h1 {
				font-size: 1.5rem;
			}

			& > p {
				font-size: 0.85rem;
				color: var(--grey);
				margin: 0.3rem 0 0;
			}

			& .auth-status {
				margin-top: 1rem;
				padding: 0.55rem 0.8rem;
				border-radius: 0.7rem;
				background: rgba(38, 147, 128, 0.1);
				color: #1f7a68;
				font-size: 0.78rem;
				font-weight: 600;
			}

			& .field-error {
				display: block;
				margin-top: 0.35rem;
				font-size: 0.72rem;
				font-weight: 600;
				color: var(--primary-color-base);
			}

			& .remember {
				display: flex;
				align-items: center;
				gap: 0.5rem;
				margin: 0.1rem 0 0;
				font-size: 0.8rem;
				font-weight: 600;
				text-transform: none;
				letter-spacing: normal;
				color: var(--dark-grey);
				cursor: pointer;

				& input {
					width: auto;
					margin: 0;
					border: 0;
					padding: 0;
					accent-color: var(--primary-color-base);
				}
			}

			& > a:first-child {
				display: flex;
				align-items: center;
				justify-content: center;
				gap: 0.55rem;
				font-weight: 700;
				color: var(--black);
				margin-bottom: 1.2rem;
				text-decoration: none;

				& svg {
					width: 30px;
					height: 30px;
					border-radius: 0.55rem;
					background: var(--colored-background);
					padding: 6px;
					color: var(--white);
				}

				& span {
					color: var(--primary-color-base);
				}
			}

			& > a:last-child:not(:first-child) {
				display: inline-block;
				margin-top: 1.2rem;
				font-size: 0.8rem;
				color: var(--grey);

				&:hover {
					color: var(--primary-color-base);
				}
			}

			& form {
				display: flex;
				flex-direction: column;
				gap: 0.7rem;
				margin-top: 1.4rem;
				text-align: left;
			}

			& button[type="submit"] {
				width: 100%;
				padding: 0.75rem 1rem;
				font-size: 0.95rem;
				margin-top: 0.3rem;
				transition: background 0.2s, transform 0.15s;

				&:hover {
					transform: translateY(-1px);
				}
			}

			& #forgot-btn {
				margin-top: 1rem;
				background: none;
				border: none;
				color: var(--grey);
				font-size: 0.8rem;
				font-weight: 600;
				cursor: pointer;
				text-decoration: underline dotted;
				text-underline-offset: 3px;

				&:hover {
					color: var(--dark-grey);
				}
			}
		}
	}
}

body > footer {
	background: var(--colored-background);
	color: var(--white);
	padding: 1.1rem 1rem;
	position: relative;
	overflow: hidden;

	&::before {
		content: "";
		position: absolute;
		inset: 0;
		background-image: var(--dot-pattern);
		opacity: 0.08;
		mix-blend-mode: overlay;
		pointer-events: none;
	}

	& > div {
		max-width: 1060px;
		margin: 0 auto;
		display: flex;
		flex-direction: column;
		position: relative;
		z-index: 1;

		& strong {
			font-weight: 700;
			font-size: 0.95rem;
			color: var(--white);
		}

		& span {
			color: rgba(255, 255, 255, 0.75);
			font-size: 0.72rem;
		}
	}
}

[role="status"] {
	position: fixed;
	left: 50%;
	bottom: 1.4rem;
	transform: translate(-50%, 12px);
	background: var(--black);
	color: var(--white);
	padding: 0.7rem 1.35rem;
	border-radius: 99rem;
	font-size: 0.88rem;
	font-weight: 600;
	box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s, transform 0.25s;
	z-index: 70;
	max-width: calc(100vw - 2rem);
	text-align: center;

	&[data-open] {
		opacity: 1;
		transform: translate(-50%, 0);
	}

	&[data-error] {
		background: var(--accent-shadow);
	}
}

body[data-modal-open] {
	overflow: hidden;
}

#pin-overlay {
	position: fixed;
	inset: 0;
	background: rgba(24, 24, 27, 0.55);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 60;
	padding: 1rem;

	& [role="dialog"] {
		background: var(--white);
		border-radius: 1.4rem;
		padding: 1.8rem 1.6rem 1.3rem;
		width: min(320px, 100%);
		text-align: center;
		box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);

		& h2 {
			font-size: 1.25rem;
		}

		& p {
			font-size: 0.85rem;
			color: var(--grey);
			margin-top: 0.3rem;
		}

		& #pin-error {
			color: var(--primary-color-base);
			font-weight: 600;
			font-size: 0.78rem;
			margin-bottom: 0.4rem;
		}

		& small {
			display: block;
			font-size: 0.72rem;
			color: var(--grey);
			margin-top: 0.8rem;
		}

		& #pin-dots {
			display: flex;
			gap: 0.7rem;
			justify-content: center;
			margin: 1.2rem 0 1rem;

			& span {
				width: 14px;
				height: 14px;
				border-radius: 50%;
				border: 2px solid var(--light-grey);
				background: var(--white);
				transition: background 0.15s, border-color 0.15s;

				&[data-filled] {
					background: var(--primary-color-base);
					border-color: var(--primary-color-base);
				}
			}

			&[data-shake] {
				animation: shake 0.4s;
			}
		}

		& #keypad {
			display: grid;
			grid-template-columns: repeat(3, 1fr);
			gap: 0.6rem;
			margin-bottom: 0.9rem;

			& button {
				border: 1px solid var(--light-grey);
				background: var(--very-light-grey);
				border-radius: 0.9rem;
				padding: 0.75rem 0;
				font-size: 1.25rem;
				font-weight: 700;
				color: var(--black);
				cursor: pointer;
				transition: background 0.15s, border-color 0.15s, transform 0.1s;

				&:hover {
					border-color: var(--grey);
				}

				&:active {
					transform: scale(0.96);
					background: var(--light-grey);
				}

				&[data-del] {
					color: var(--dark-grey);
					font-size: 1.05rem;
				}
			}

			& span {
				visibility: hidden;
			}
		}

		& #pin-cancel {
			margin-top: 0.9rem;
			background: none;
			border: none;
			color: var(--grey);
			font-weight: 600;
			font-size: 0.82rem;
			cursor: pointer;
			text-decoration: underline dotted;
			text-underline-offset: 3px;

			&:hover {
				color: var(--dark-grey);
			}
		}
	}
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-6px); }
	75% { transform: translateX(6px); }
}

@media (prefers-reduced-motion: reduce) {
	*,
	::before,
	::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
