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

.material-symbols-outlined {
	font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
}

:root {
	--bg: #f9fafb;
	--card: #ffffff;
	--text: #1f2937;
	--accent: #8cc7c3;
	--accent-hover: #1d4ed8;
	--highlight: #f77351;
	--highlight-hover: #e86d4e;
	--border: #e5e7eb;
	--card-hover: #f1f5f9;
	--selected: #d7f2f0;
	--font-size: 17px;
}

@media (max-width: 768px) {
	:root {
		--font-size: 16px;
	}
}

@media (max-width: 480px) {
	:root {
		--font-size: 15px;
	}
}

* {
	box-sizing: border-box;
}

#pre-checkout {
	padding: 60px 20px 80px;
}

body {
	font-family: "Montserrat", system-ui, sans-serif;
	background-color: var(--bg);
	color: var(--text);
}

#kaari-logo {
	max-width: 120px;
	margin: 0 auto 20px;
	display: block;
	@media (max-width: 480px) {
		display: none;
	}
}

#pre-checkout .card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: calc(var(--font-size) * 1.85);
	padding-bottom: 0;
	margin: 0 auto;
	max-width: 620px;
	width: 100%;
	font-size: var(--font-size);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
	flex: 1;
	@media (max-width: 600px) {
		padding: calc(var(--font-size) * 1.5) calc(var(--font-size) * 1.25);
		padding-bottom: 0;
	}
}

#pre-checkout {
	h1 {
		font-size: calc(var(--font-size) * 1.75);
		margin-bottom: 1.5em;
		text-align: center;
		font-weight: 600;
	}
	.section {
		margin-bottom: 32px;
	}

	.label {
		font-weight: 500;
		margin-bottom: 0.5em;
		display: block;
		font-size: var(--font-size);
	}

	.radio-card-group {
		display: flex;
		flex-direction: column;
		gap: 0.75em;
	}

	.radio-card-group.horizontal {
		flex-direction: row;
		justify-content: space-between;
		text-align: center;
		.radio-card {
			flex-direction: column;
			flex: 1;
			gap: 6px;
			font-size: var(--font-size);
			padding: 20px;
			.material-symbols-outlined {
				font-size: calc(var(--font-size) * 1.6);
			}
			input {
				display: none;
			}
			@media (max-width: 600px) {
				padding: 15px 5px;
			}
		}
	}

	.radio-card {
		display: flex;
		align-items: center;
		border: 2px solid var(--border);
		border-radius: 8px;
		font-size: var(--font-size);
		padding: 0.75em 1em;
		background: white;
		cursor: pointer;
		transition: background 0.2s, border 0.2s;
		input {
			margin-top: 0;
		}
	}

	.radio-card:hover {
		background: var(--card-hover);
	}

	.radio-card input[type="radio"] {
		margin-right: 0.75rem;
	}

	.radio-card.selected {
		border-color: var(--accent);
		background: var(--selected);
	}

	.radio-group label,
	.checkbox-group label {
		display: flex;
		align-items: center;
		gap: 0.5em;
		margin-top: 0.5em;
		font-weight: normal;
		cursor: pointer;
		font-size: var(--font-size);
	}

	.checkbox-group label {
		align-items: flex-start;
		font-size: calc(var(--font-size) * 0.95);
		line-height: 1.4;
		input {
			width: 20px;
			height: 20px;
			min-width: 20px;
			min-height: 20px;
		}
	}

	button {
		width: 100%;
		background: var(--highlight);
		color: white;
		border: none;
		padding: 0.75em;
		font-size: var(--font-size);
		border-radius: 80px;
		cursor: pointer;
		transition: background 0.2s;
		margin-top: 1rem;
		font-family: "Montserrat", system-ui, sans-serif;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		font-weight: 500;
		.material-symbols-outlined {
			font-size: calc(var(--font-size) * 1.35);
		}
	}

	button:hover:enabled {
		background: var(--highlight-hover);
	}

	button:disabled {
		/*   background: #e2dbd9; */
		opacity: 0.4;
		cursor: not-allowed;
	}

	.hidden {
		display: none;
	}

	.button-wrapper {
		display: flex;
		flex-direction: column;
		gap: 6px;
		margin-top: 16px;
	}

	.hsa-checkbox-wrapper {
		display: grid;
		grid-template-columns: 3fr 2fr;
		gap: 20px;
		@media (max-width: 600px) {
			grid-template-columns: 1fr;
		}
		img {
			width: 100%;
			height: auto;
			@media (max-width: 600px) {
				display: none;
			}
		}
	}

	#hsa-checkout {
		background: #0b0077;
		&:hover:enabled {
			background: #09015b;
		}
	}

	.button-under {
		display: flex;
		justify-content: center;
		gap: 10px;
		.payment-cards {
			display: flex;
			justify-content: center;
			img {
				width: 48px;
				margin: 0 -1px;
			}
		}
		.secure {
			display: flex;
			align-items: center;
			gap: 6px;
			img {
				width: 16px;
			}
			span {
				font-size: calc(var(--font-size) * 0.75);
				white-space: nowrap;
			}
		}
	}

	#pay-with-flex {
		width: 100%;
		margin: 6px auto 0;
		svg {
			max-height: calc(var(--font-size) * 1.2);
		}
	}

	/* Custom Radio Buttons */
	input[type="radio"] {
		appearance: none;
		-webkit-appearance: none;
		width: 20px;
		height: 20px;
		margin: 0;
		margin-right: 0.75rem;
		border: 2px solid var(--border);
		border-radius: 50%;
		background: white;
		position: relative;
		cursor: pointer;
		transition: all 0.2s ease;
	}

	input[type="radio"]:checked {
		background-color: var(--accent);
		border-color: var(--accent);
	}

	input[type="radio"]::after {
		content: "";
		position: absolute;
		top: 50%;
		left: 50%;
		width: 8px;
		height: 8px;
		background: white;
		border-radius: 50%;
		transform: translate(-50%, -50%) scale(0);
		transition: transform 0.2s ease;
	}

	input[type="radio"]:checked::after {
		transform: translate(-50%, -50%) scale(1);
	}

	/* Custom Checkbox */
	input[type="checkbox"] {
		appearance: none;
		-webkit-appearance: none;
		width: 20px;
		height: 20px;
		margin: 0;
		margin-right: 0.5em;
		border: 2px solid var(--border);
		border-radius: 4px;
		background: white;
		position: relative;
		cursor: pointer;
		display: inline-block;
		vertical-align: middle;
		transition: all 0.2s ease;
		font-size: 14px;
		line-height: 1;
		text-align: center;
	}

	input[type="checkbox"]:checked {
		background-color: var(--accent);
		border-color: var(--accent);
		color: white;
	}

	input[type="checkbox"]::after {
		content: "";
		position: absolute;
		top: 0;
		left: 0;
		display: grid;
		place-items: center;
		width: 100%;
		height: 100%;
		font-size: 14px;
		font-weight: bold;
	}

	input[type="checkbox"]:checked::after {
		content: "✔";
		color: white;
	}
}
