/* =========================================================
   GRADES CALCULATORS
   ========================================================= */

.homepage-calculator--grades {
	width: 100%;
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
}

.homepage-calculator--grades,
.homepage-calculator--grades *,
.homepage-calculator--grades *::before,
.homepage-calculator--grades *::after {
	box-sizing: border-box;
}

.homepage-calculator--grades .form-control {
	display: block;
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid #e2e5e8;
	border-radius: 12px;
	background: #f9fafb;
	color: #2f3438;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	box-sizing: border-box;
	transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.homepage-calculator--grades .form-control:focus {
	outline: none;
	background: #fff;
	border-color: #ff485b;
	box-shadow: 0 0 0 3px rgba(255, 72, 91, .12);
}

.homepage-calculator--grades .form-control::placeholder {
	color: #a0a6ab;
	font-weight: 600;
}

.grades-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	margin-bottom: 16px;
}

.grades-thresholds {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 18px;
}

.grades-field {
	margin-bottom: 16px;
}

.grades-field label {
	display: block;
	margin-bottom: 7px;
	color: #404549;
	font-size: 14px;
	font-weight: 800;
	line-height: 1.35;
}

.grades-hint {
	margin-top: 8px;
	color: #767d83;
	font-size: 13px;
	line-height: 1.55;
}

.grades-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 18px;
}

.grades-actions--between {
	justify-content: space-between;
	align-items: center;
}

.homepage-calculator--grades .calculator-submit,
.homepage-calculator--grades .calculator-reset {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 18px;
	border-radius: 12px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .08s ease, box-shadow .15s ease;
}

.homepage-calculator--grades .calculator-submit {
	border: 1px solid #ff485b;
	background: #ff485b;
	color: #fff;
	box-shadow: 0 8px 22px rgba(255, 72, 91, 0.22);
}

.homepage-calculator--grades .calculator-submit:hover {
	background: #e93d50;
	border-color: #e93d50;
	color: #fff;
}

.homepage-calculator--grades .calculator-reset {
	border: 1px solid #e2e5e8;
	background: #f4f6f7;
	color: #404549;
}

.homepage-calculator--grades .calculator-reset:hover {
	background: #404549;
	border-color: #404549;
	color: #fff;
}

.homepage-calculator--grades .calculator-submit:active,
.homepage-calculator--grades .calculator-reset:active,
.grades-quick-button:active,
.needed-grade-button:active {
	transform: translateY(1px);
}

.grades-result {
	margin-top: 18px;
	padding: 16px 18px;
	border-radius: 14px;
	background: #f9fafb;
	border: 1px solid #e2e5e8;
	color: #404549;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.6;
}

.grades-result strong {
	color: #ff485b;
}

.grades-result.is-error {
	background: #fff0f2;
	border-color: rgba(255, 72, 91, .28);
	color: #c72f42;
}

.grades-result.is-success {
	background: #f9fafb;
	border-color: #e2e5e8;
	color: #404549;
}


/* =========================================================
   AVERAGE GRADE CALCULATOR
   ========================================================= */

.grades-entry {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 10px;
}

.grades-quick-buttons {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
	margin: 14px 0 18px;
}

.grades-quick-button {
	min-height: 44px;
	border: 1px solid #e2e5e8;
	border-radius: 12px;
	background: #fff;
	color: #404549;
	font-family: inherit;
	font-size: 17px;
	font-weight: 900;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .08s ease;
}

.grades-quick-button:hover {
	background: #ff485b;
	border-color: #ff485b;
	color: #fff;
}

.grades-selected {
	margin-top: 16px;
	padding: 14px;
	border-radius: 14px;
	background: #f9fafb;
	border: 1px solid #e2e5e8;
}

.grades-selected-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
	color: #404549;
	font-size: 14px;
	font-weight: 800;
}

.grades-clear-list {
	padding: 0;
	border: 0;
	background: transparent;
	color: #ff485b;
	font-family: inherit;
	font-size: 13px;
	font-weight: 800;
	cursor: pointer;
}

.grades-clear-list:hover {
	text-decoration: underline;
}

.grades-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.grades-tags span:not(.grades-empty) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	min-height: 32px;
	padding: 0 10px;
	border-radius: 999px;
	background: #fff;
	border: 1px solid #e2e5e8;
	color: #404549;
	font-weight: 900;
}

.grades-empty {
	color: #94999e;
	font-size: 14px;
}


/* =========================================================
   NEEDED GRADE POINTS CALCULATOR
   ========================================================= */

.needed-grade-buttons {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.needed-grade-button {
	min-height: 44px;
	border: 1px solid #e2e5e8;
	border-radius: 12px;
	background: #fff;
	color: #404549;
	font-family: inherit;
	font-size: 15px;
	font-weight: 900;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .08s ease;
}

.needed-grade-button:hover,
.needed-grade-button.is-active {
	background: #ff485b;
	border-color: #ff485b;
	color: #fff;
}

.needed-grade-scale {
	margin-top: 18px;
	padding: 16px;
	border-radius: 16px;
	background: #f9fafb;
	border: 1px solid #e2e5e8;
}

.needed-grade-scale-title {
	margin-bottom: 14px;
	color: #404549;
	font-size: 15px;
	font-weight: 900;
}


/* =========================================================
   WEIGHTED GRADE CALCULATOR
   ========================================================= */

.weighted-grade-list {
	display: grid;
	gap: 12px;
	margin-bottom: 14px;
}

.weighted-grade-row {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(90px, .7fr) minmax(90px, .7fr) 38px;
	gap: 10px;
	align-items: end;
	padding: 14px;
	border-radius: 16px;
	background: #f9fafb;
	border: 1px solid #e2e5e8;
}

.weighted-grade-row .grades-field {
	margin-bottom: 0;
}

.grades-row-remove {
	width: 38px;
	height: 38px;
	border: 1px solid rgba(255, 72, 91, .25);
	border-radius: 12px;
	background: #fff0f2;
	color: #ff485b;
	font-family: inherit;
	font-size: 22px;
	font-weight: 900;
	line-height: 1;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.grades-row-remove:hover {
	background: #ff485b;
	border-color: #ff485b;
	color: #fff;
}

.weighted-grade-hint {
	margin-bottom: 16px;
}

.weighted-grade-main-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media only screen and (max-width: 767px) {
	.homepage-calculator--grades {
		max-width: 100%;
	}

	.grades-grid,
	.grades-thresholds {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.grades-actions,
	.grades-actions--between,
	.weighted-grade-main-actions {
		flex-direction: column;
		align-items: stretch;
		width: 100%;
	}

	.homepage-calculator--grades .calculator-submit,
	.homepage-calculator--grades .calculator-reset {
		width: 100%;
	}

	.grades-entry {
		grid-template-columns: 1fr;
	}

	.weighted-grade-row {
		grid-template-columns: 1fr;
	}

	.grades-row-remove {
		width: 100%;
	}

	.grades-selected-header {
		align-items: flex-start;
		flex-direction: column;
	}
}

@media only screen and (max-width: 420px) {
	.homepage-calculator--grades .form-control {
		height: 44px;
		font-size: 15px;
	}

	.grades-result {
		padding: 14px;
		font-size: 14px;
	}

	.needed-grade-buttons,
	.grades-quick-buttons {
		gap: 8px;
	}

	.needed-grade-button,
	.grades-quick-button {
		min-height: 42px;
		border-radius: 10px;
	}
}