* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: Arial, sans-serif;
	color: #1d2428;
	background: #f4f1ea;
}

.calendar {
	width: min(1080px, calc(100% - 40px));
	margin: 0 auto;
	padding: 48px 0;
}

.calendar__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 24px;
}

.calendar__eyebrow {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: uppercase;
	color: #4b6f83;
}

h1 {
	margin: 0;
	font-size: 42px;
	line-height: 1.05;
}

.calendar__controls {
	display: grid;
	justify-items: end;
	gap: 8px;
}

.year-switcher {
	display: grid;
	grid-template-columns: 40px 88px 40px;
	align-items: center;
	gap: 8px;
}

.year-switcher__button {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid #c8d2d5;
	border-radius: 50%;
	font-size: 30px;
	line-height: 1;
	color: #315768;
	background: #fffdf8;
	cursor: pointer;
	transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.year-switcher__button:hover {
	border-color: #789aa6;
	background: #e7f0f2;
	transform: translateY(-1px);
}

.year-switcher__year {
	text-align: center;
	font-size: 30px;
	font-weight: 700;
	line-height: 1;
	color: #1d2428;
}

.calendar__status {
	min-width: 140px;
	margin: 0;
	text-align: right;
	font-size: 14px;
	color: #5a6469;
}

.calendar__status.is-error {
	color: #b42318;
}

.months {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}

.month {
	position: relative;
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 16px;
	min-height: 96px;
	padding: 24px;
	border: 1px solid #d8d0c2;
	border-radius: 8px;
	background: #fffdf8;
	cursor: pointer;
	transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.month:hover {
	border-color: #789aa6;
	box-shadow: 0 10px 24px rgba(34, 45, 50, 0.08);
	transform: translateY(-1px);
}

.month__number {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	font-weight: 700;
	color: #315768;
	background: #e7f0f2;
}

.month__name {
	font-size: 20px;
	font-weight: 700;
}

.month__checkbox {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.month__check {
	display: inline-grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border: 2px solid #9aa5a9;
	border-radius: 6px;
	background: #fff;
}

.month__checkbox:checked + .month__check {
	border-color: #23704d;
	background: #2f8f63;
}

.month__checkbox:checked + .month__check::before {
	content: "";
	width: 12px;
	height: 7px;
	border-left: 3px solid #fff;
	border-bottom: 3px solid #fff;
	transform: rotate(-45deg) translate(1px, -1px);
}

.month:has(.month__checkbox:checked) {
	border-color: #8dbf9e;
	background: #f6fff8;
}

@media (max-width: 760px) {
	.calendar {
		width: min(100% - 24px, 520px);
		padding: 28px 0;
	}

	.calendar__header {
		display: block;
	}

	.calendar__controls {
		justify-items: start;
		margin-top: 16px;
	}

	.calendar__status {
		text-align: left;
	}

	h1 {
		font-size: 34px;
	}

	.months {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.month {
		grid-template-columns: 1fr auto;
		gap: 10px;
		min-height: 112px;
		padding: 14px;
		align-content: space-between;
	}

	.month__number {
		width: 34px;
		height: 34px;
		font-size: 14px;
	}

	.month__name {
		grid-column: 1 / -1;
		grid-row: 2;
		font-size: 17px;
	}

	.month__check {
		width: 28px;
		height: 28px;
	}
}
