/* ==========================================================================
   Allinonefreelancing — payment.css
   Checkout modal: 4 steps, premium progress, payment cards, confirm panel.
   ========================================================================== */

.afl-checkout-overlay {
	position: fixed;
	inset: 0;
	z-index: 300;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: calc(16px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
	background: rgba(3, 4, 7, 0.72);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	animation: afl-overlay-in .25s ease;
	overflow-y: auto;
}
.afl-checkout-overlay[hidden] { display: none; }
@keyframes afl-overlay-in { from { opacity: 0; } to { opacity: 1; } }

.afl-checkout {
	position: relative;
	width: min(720px, 100%);
	max-height: min(88dvh, 860px);
	overflow-y: auto;
	border-radius: 26px;
	border: 1px solid rgba(212, 175, 55, 0.28);
	background:
		radial-gradient(520px 220px at 50% -12%, rgba(212, 175, 55, 0.12), transparent 70%),
		linear-gradient(170deg, #10151d, #0a0d13 65%);
	box-shadow: 0 40px 120px rgba(0, 0, 0, 0.65), 0 0 60px rgba(212, 175, 55, 0.07);
	padding: clamp(22px, 4vw, 40px);
	animation: afl-modal-in .35s cubic-bezier(0.22, 0.61, 0.36, 1);
	overscroll-behavior: contain;
}
@keyframes afl-modal-in {
	from { opacity: 0; transform: translateY(26px) scale(.97); }
	to { opacity: 1; transform: none; }
}

.afl-checkout-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: rgba(255, 255, 255, 0.05);
	color: var(--afl-muted);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: color .2s, border-color .2s;
	z-index: 2;
}
.afl-checkout-close:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }

.afl-checkout-head { margin-bottom: 26px; padding-right: 44px; }
.afl-checkout-title {
	font-size: clamp(19px, 3vw, 24px);
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
	margin-bottom: 20px;
}

/* Progress steps ----------------------------------------------------------- */
.afl-checkout-steps {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
	counter-reset: step;
}
.afl-step {
	position: relative;
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 10px 12px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.035);
	border: 1px solid rgba(255, 255, 255, 0.06);
	color: var(--afl-muted-2);
	transition: border-color .3s, background-color .3s, color .3s;
	min-width: 0;
}
.afl-step-num { font-family: var(--afl-font-head); font-size: 12px; font-weight: 800; color: inherit; }
.afl-step-label { font-size: 11px; font-weight: 700; letter-spacing: .14em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.afl-step.is-active {
	border-color: rgba(212, 175, 55, 0.5);
	background: rgba(212, 175, 55, 0.1);
	color: var(--afl-gold-3);
	box-shadow: 0 0 24px rgba(212, 175, 55, 0.12);
}
.afl-step.is-done { color: #7BE49F; border-color: rgba(37, 211, 102, 0.35); background: rgba(37, 211, 102, 0.07); }

/* Steps --------------------------------------------------------------------- */
.afl-checkout-step { border: 0; padding: 0; margin: 0; min-width: 0; }
.afl-step-legend {
	font-family: var(--afl-font-head);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--afl-soft);
	margin-bottom: 18px;
	padding: 0;
}

/* Step 1: course cards */
.afl-checkout-courses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.afl-checkout-course { position: relative; display: block; min-width: 0; }
.afl-checkout-course input { position: absolute; opacity: 0; pointer-events: none; }
.afl-checkout-course-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	height: 100%;
	padding: 20px 18px;
	border-radius: 16px;
	border: 1px solid rgba(255, 255, 255, 0.09);
	background: rgba(255, 255, 255, 0.04);
	cursor: pointer;
	transition: border-color .25s, background-color .25s, transform .25s, box-shadow .25s;
}
.afl-checkout-course input:focus-visible + .afl-checkout-course-card { outline: 2px solid var(--afl-gold-3); outline-offset: 2px; }
.afl-checkout-course input:checked + .afl-checkout-course-card {
	border-color: rgba(212, 175, 55, 0.65);
	background: rgba(212, 175, 55, 0.1);
	box-shadow: 0 0 30px rgba(212, 175, 55, 0.12);
	transform: translateY(-2px);
}
.afl-checkout-course-badge { font-size: 10px; font-weight: 800; letter-spacing: .18em; color: var(--afl-muted-2); }
.afl-checkout-course-premium .afl-checkout-course-badge { color: var(--afl-gold-3); }
.afl-checkout-course-title { font-family: var(--afl-font-head); font-size: 15px; font-weight: 700; color: var(--afl-soft); }
.afl-checkout-course-price { font-family: var(--afl-font-head); font-size: 24px; font-weight: 800; color: var(--afl-gold-3); }
.afl-checkout-course-note { font-size: 12px; color: #7BE49F; font-weight: 600; }

/* Step 2: fields */
.afl-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.afl-checkout .afl-field label { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--afl-muted); margin-bottom: 8px; }
.afl-checkout .afl-field label span { color: var(--afl-gold-3); }
.afl-checkout .afl-field input {
	width: 100%;
	min-height: 52px;
	padding: 13px 16px;
	border-radius: 13px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: rgba(255, 255, 255, 0.05);
	color: var(--afl-soft);
	font-size: 15.5px;
	transition: border-color .25s, box-shadow .25s;
	-webkit-appearance: none;
	appearance: none;
}
.afl-checkout .afl-field input:focus {
	outline: none;
	border-color: rgba(212, 175, 55, 0.6);
	box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
.afl-checkout .afl-field input[aria-invalid="true"] { border-color: rgba(255, 99, 99, 0.65); }
.afl-field-error { margin-top: 7px; color: #ff9d9d; font-size: 12.5px; }

/* Step 3: payment methods */
.afl-payment-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.afl-payment-card { position: relative; display: block; min-width: 0; }
.afl-payment-card input { position: absolute; opacity: 0; pointer-events: none; }
.afl-payment-card-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px;
	border-radius: 15px;
	border: 1px solid rgba(255, 255, 255, 0.09);
	background: rgba(255, 255, 255, 0.04);
	cursor: pointer;
	transition: border-color .25s, background-color .25s, transform .25s;
}
.afl-payment-card input:focus-visible + .afl-payment-card-body { outline: 2px solid var(--afl-gold-3); outline-offset: 2px; }
.afl-payment-card input:checked + .afl-payment-card-body {
	border-color: rgba(212, 175, 55, 0.65);
	background: rgba(212, 175, 55, 0.1);
	transform: translateY(-2px);
	animation: afl-pay-select .3s ease;
}
@keyframes afl-pay-select {
	0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.35); }
	100% { box-shadow: 0 0 0 12px rgba(212, 175, 55, 0); }
}
.afl-payment-icon { color: var(--afl-gold-3); margin-bottom: 6px; }
.afl-payment-icon .afl-icon { width: 22px; height: 22px; }
.afl-payment-label { font-family: var(--afl-font-head); font-size: 14.5px; font-weight: 700; color: var(--afl-soft); }
.afl-payment-number { font-size: 13px; color: var(--afl-muted); letter-spacing: .04em; }

/* Manual panel */
.afl-manual-panel, .afl-card-panel {
	padding: 20px;
	border-radius: 16px;
	border: 1px dashed rgba(212, 175, 55, 0.4);
	background: rgba(212, 175, 55, 0.05);
	animation: afl-panel-in .3s ease;
}
@keyframes afl-panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.afl-manual-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.afl-manual-method { font-family: var(--afl-font-head); font-weight: 800; font-size: 17px; color: var(--afl-gold-3); letter-spacing: .06em; }
.afl-manual-number {
	font-family: var(--afl-font-head);
	font-size: 17px;
	font-weight: 800;
	letter-spacing: .08em;
	padding: 8px 16px;
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.35);
	border: 1px solid rgba(212, 175, 55, 0.4);
	color: #fff;
	user-select: all;
}
.afl-manual-instructions { list-style: decimal; padding-left: 20px; color: var(--afl-muted); font-size: 14px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.afl-manual-instructions strong { color: var(--afl-gold-3); }
.afl-manual-amount { font-size: 14.5px; color: var(--afl-soft); margin-bottom: 16px; }
.afl-manual-amount strong { color: var(--afl-gold-3); font-size: 18px; font-family: var(--afl-font-head); }
.afl-manual-note, .afl-card-note {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin-top: 16px;
	padding: 12px 14px;
	border-radius: 12px;
	background: rgba(69, 109, 255, 0.08);
	border: 1px solid rgba(69, 109, 255, 0.25);
	color: #b9c6ff;
	font-size: 12.5px;
	line-height: 1.6;
}
.afl-manual-note .afl-icon, .afl-card-note .afl-icon { width: 17px; height: 17px; margin-top: 2px; flex: none; }
.afl-card-unconfigured { margin-top: 12px; color: #ff9d9d; font-size: 13.5px; font-weight: 600; }

/* Step 4: confirm */
.afl-confirm-panel { text-align: center; padding: 8px 0; }
.afl-confirm-status {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 20px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .16em;
	margin-bottom: 18px;
}
.afl-confirm-status.is-pending { background: rgba(212, 175, 55, 0.12); border: 1px solid rgba(212, 175, 55, 0.4); color: var(--afl-gold-3); }
.afl-confirm-title { font-size: clamp(19px, 3vw, 25px); font-weight: 800; letter-spacing: .03em; margin-bottom: 10px; }
.afl-confirm-sub { color: var(--afl-muted); font-size: 14.5px; max-width: 460px; margin: 0 auto 22px; }
.afl-confirm-details {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	text-align: left;
	margin-bottom: 24px;
}
.afl-confirm-details > div { padding: 12px 15px; border-radius: 12px; background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(255, 255, 255, 0.08); }
.afl-confirm-details dt { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--afl-muted-2); margin-bottom: 4px; }
.afl-confirm-details dd { margin: 0; font-size: 14.5px; font-weight: 600; word-break: break-word; }
.afl-confirm-actions { display: flex; flex-direction: column; gap: 12px; }

/* Alert + nav */
.afl-checkout-alert {
	margin: 14px 0 0;
	padding: 13px 16px;
	border-radius: 12px;
	background: rgba(255, 99, 99, 0.1);
	border: 1px solid rgba(255, 99, 99, 0.35);
	color: #ffb3b3;
	font-size: 13.5px;
}
.afl-checkout-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.afl-checkout-nav .afl-btn { min-width: 130px; }
.afl-checkout-nav #afl-checkout-next { margin-left: auto; }
.afl-btn.is-loading { opacity: .65; pointer-events: none; }

/* Mobile checkout */
@media (max-width: 640px) {
	.afl-checkout-overlay { padding: 0; align-items: stretch; }
	.afl-checkout {
		width: 100%;
		max-height: none;
		height: 100dvh;
		border-radius: 0;
		border: 0;
		padding: calc(20px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
	}
	.afl-checkout-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
	.afl-step { padding: 9px 8px; justify-content: center; }
	.afl-step-label { display: none; }
	.afl-step-num { font-size: 13px; }
	.afl-checkout-courses, .afl-payment-methods, .afl-field-grid, .afl-confirm-details { grid-template-columns: minmax(0, 1fr); }
	.afl-checkout-nav { flex-direction: column-reverse; }
	.afl-checkout-nav .afl-btn { width: 100%; min-width: 0; margin-left: 0; }
	.afl-manual-head { flex-direction: column; align-items: flex-start; }
}
