/* ── Coupon rescue: "Sorry, that coupon code isn't working" pop-up ──
   js/coupon-rescue.js. Matches the dark payment-plan modal styling. */

html.cf-rescue-open {
	overflow: hidden;
}

.cf-rescue {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.cf-rescue[hidden] {
	display: none;
}

.cf-rescue__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
}

.cf-rescue__panel {
	position: relative;
	background: #191919;
	color: #fff;
	border-radius: 20px;
	padding: 32px;
	max-width: 440px;
	width: 100%;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	font-family: 'Archivo', Arial, sans-serif;
	animation: cfRescueIn 0.25s ease;
}

@keyframes cfRescueIn {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: translateY(0); }
}

.cf-rescue__close {
	position: absolute;
	top: 14px;
	right: 14px;
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.5);
	font-size: 26px;
	line-height: 1;
	padding: 4px 8px;
	cursor: pointer;
}

.cf-rescue__close:hover,
.cf-rescue__close:focus-visible {
	color: #fff;
}

.cf-rescue__title {
	font-family: 'Archivo', Arial, sans-serif;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
	color: #fff;
	margin: 0 32px 8px 0;
	outline: none;
}

.cf-rescue__text {
	font-size: 15px;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.75);
	margin: 0 0 20px;
}

.cf-rescue__form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.cf-rescue__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cf-rescue__label {
	font-size: 13px;
	font-weight: 600;
	color: #fff;
}

.cf-rescue__optional {
	font-weight: 400;
	color: rgba(255, 255, 255, 0.5);
}

.cf-rescue__input {
	width: 100%;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 10px;
	padding: 12px 14px;
	font-family: inherit;
	font-size: 16px; /* 16px stops iOS zooming on focus */
	color: #fff;
}

.cf-rescue__input:focus {
	outline: none;
	border-color: #d5fb7b;
	box-shadow: 0 0 0 1px #d5fb7b;
}

.cf-rescue__field[hidden] {
	display: none;
}

.cf-rescue__select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23d5fb7b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	cursor: pointer;
}

.cf-rescue__select option {
	color: #191919;
}

.cf-rescue__input--error {
	border-color: #ff6b6b;
}

.cf-rescue__help {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.5);
}

.cf-rescue__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.cf-rescue__error {
	font-size: 13px;
	color: #ff6b6b;
	margin: 0;
}

.cf-rescue__submit {
	margin-top: 6px;
}

.cf-rescue__skip {
	align-self: center;
	background: none;
	border: none;
	padding: 4px;
	font-family: inherit;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.6);
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.cf-rescue__skip:hover,
.cf-rescue__skip:focus-visible {
	color: #fff;
}

@media (max-width: 480px) {
	.cf-rescue__panel {
		padding: 24px 20px;
	}

	.cf-rescue__title {
		font-size: 19px;
	}
}

/* Confirmation: highlighted discount */
.cf-rescue__deal {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	margin: 4px 0 18px;
	padding: 18px 16px;
	border-radius: 14px;
	background: rgba(213, 251, 123, 0.1);
	border: 1px solid rgba(213, 251, 123, 0.45);
	text-align: center;
}

.cf-rescue__deal[hidden] {
	display: none;
}

.cf-rescue__deal-amount {
	font-size: 40px;
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
	color: #d5fb7b;
}

.cf-rescue__deal-code {
	font-size: 14px;
	color: rgba(255, 255, 255, 0.8);
}

.cf-rescue__deal-code strong {
	display: inline-block;
	margin: 0 2px;
	padding: 2px 10px;
	border-radius: 999px;
	background: #d5fb7b;
	color: #191919;
	font-weight: 700;
	letter-spacing: 0.5px;
}

/* Confirmation: discount saved but no course in the basket yet */
.cf-rescue__courses[hidden] {
	display: none;
}

.cf-rescue__courses-label {
	margin: -8px 0 6px;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
}

.cf-rescue__courses-list {
	margin: 0 0 20px;
	padding-left: 18px;
	font-size: 14px;
	line-height: 1.5;
}

.cf-rescue__courses-list a {
	color: #d5fb7b;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Loading state after submitting ("Finding the latest coupons…") */
.cf-rescue__loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	min-height: 220px;
	text-align: center;
	outline: none;
}

.cf-rescue__loading[hidden] {
	display: none;
}

.cf-rescue__spinner {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 3px solid rgba(213, 251, 123, 0.2);
	border-top-color: #d5fb7b;
	animation: cfRescueSpin 0.8s linear infinite;
}

@keyframes cfRescueSpin {
	to { transform: rotate(360deg); }
}

.cf-rescue__loading-text {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #fff;
}

@media (prefers-reduced-motion: reduce) {
	.cf-rescue__spinner {
		animation-duration: 2.4s;
	}
}
