/**
 * Styles for [crpf_form] — Dark theme matching playdium.lk style.
 * Built with CSS custom properties so the look can be customized per-site
 * by overriding these variables in your theme's CSS (no need to edit this file).
 */
.crpf-wrapper {
	--crpf-primary: #d6249f;
	--crpf-primary-dark: #b01d85;
	--crpf-error: #ff6b6b;
	--crpf-text: #ffffff;
	--crpf-muted: #9ca3af;
	--crpf-border: rgba(255, 255, 255, 0.2);
	--crpf-border-focus: rgba(255, 255, 255, 0.5);
	--crpf-bg: #1a1a1a;
	--crpf-input-bg: transparent;
	--crpf-radius: 50px;
	--crpf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	max-width: 640px;
	margin: 2rem auto;
	padding: 3rem 2.5rem;
	background: var(--crpf-bg);
	border-radius: 12px;
	font-family: var(--crpf-font);
	color: var(--crpf-text);
}

/* Stepper */
.crpf-stepper {
	display: flex;
	align-items: center;
	margin-bottom: 2.5rem;
}
.crpf-step-dot {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
}
.crpf-step-dot span {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: transparent;
	color: var(--crpf-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 14px;
	border: 2px solid var(--crpf-border);
	transition: all 0.3s ease;
}
.crpf-step-dot label {
	font-size: 12px;
	color: var(--crpf-muted);
	letter-spacing: 0.5px;
}
.crpf-step-dot.is-active span {
	background: var(--crpf-primary);
	border-color: var(--crpf-primary);
	color: #fff;
}
.crpf-step-dot.is-active label {
	color: var(--crpf-text);
}
.crpf-step-dot.is-done span {
	background: var(--crpf-primary);
	border-color: var(--crpf-primary);
	color: #fff;
}
.crpf-step-line {
	flex: 1 1 auto;
	height: 2px;
	background: var(--crpf-border);
	margin: 0 12px;
	margin-bottom: 22px;
	transition: background 0.3s ease;
}
.crpf-step-line.is-done {
	background: var(--crpf-primary);
}

/* Fields */
.crpf-field { margin-bottom: 2rem; position: relative; }
.crpf-field label {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 17px;
	font-weight: 400;
	margin-bottom: 12px;
	color: var(--crpf-text);
}
.crpf-field label .crpf-icon {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	opacity: 0.9;
}
.crpf-field input[type="text"],
.crpf-field input[type="tel"],
.crpf-field input[type="email"],
.crpf-field input[type="number"],
.crpf-field input[type="date"],
.crpf-field select,
.crpf-field textarea {
	width: 100%;
	padding: 8px 0;
	font-size: 16px;
	color: var(--crpf-text);
	background: var(--crpf-input-bg);
	border: none;
	border-bottom: 1px solid var(--crpf-border);
	border-radius: 0;
	box-sizing: border-box;
	transition: border-color 0.3s ease;
	font-family: inherit;
}
.crpf-field input::placeholder,
.crpf-field textarea::placeholder {
	color: var(--crpf-muted);
}
.crpf-field textarea { min-height: 60px; resize: vertical; }
.crpf-field input:focus,
.crpf-field select:focus,
.crpf-field textarea:focus {
	outline: none;
	border-bottom-color: var(--crpf-border-focus);
}
.crpf-field select {
	cursor: pointer;
}
.crpf-field select option {
	background: var(--crpf-bg);
	color: var(--crpf-text);
}

/* File input */
.crpf-field input[type="file"] {
	width: 100%;
	padding: 12px 0;
	font-size: 14px;
	color: var(--crpf-muted);
	background: transparent;
	border: none;
	box-sizing: border-box;
}
.crpf-field input[type="file"]::file-selector-button {
	padding: 8px 18px;
	margin-right: 12px;
	font-size: 14px;
	color: var(--crpf-text);
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid var(--crpf-border);
	border-radius: 50px;
	cursor: pointer;
	transition: background 0.3s ease;
}
.crpf-field input[type="file"]::file-selector-button:hover {
	background: rgba(255, 255, 255, 0.2);
}

/* Error states */
.crpf-field.has-error input,
.crpf-field.has-error select,
.crpf-field.has-error textarea {
	border-bottom-color: var(--crpf-error);
}
.crpf-field-error {
	display: block;
	color: var(--crpf-error);
	font-size: 13px;
	margin-top: 6px;
	min-height: 1em;
}

/* Photo preview */
.crpf-photo-preview {
	margin-top: 12px;
	max-width: 120px;
	border-radius: 8px;
	border: 1px solid var(--crpf-border);
}

/* Buttons */
.crpf-actions {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 2.5rem;
}
.crpf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 16px 38px;
	font-size: 16px;
	font-weight: 600;
	font-family: inherit;
	border: none;
	border-radius: var(--crpf-radius);
	cursor: pointer;
	transition: all 0.3s ease;
}
.crpf-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.crpf-btn-primary {
	background: var(--crpf-button-bg, #fdd008);
	color: var(--crpf-button-text, #000000);
	font-weight: 600;
}
.crpf-btn-primary:hover:not(:disabled) {
	background: var(--crpf-button-bg, #fdd008);
	filter: brightness(0.9);
	transform: translateY(-1px);
}
.crpf-btn-link {
	background: transparent;
	color: var(--crpf-muted);
	padding: 16px 20px;
	border-radius: var(--crpf-radius);
}
.crpf-btn-link:hover {
	color: var(--crpf-text);
}

/* Consent checkbox */
.crpf-consent {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 1.5rem;
	font-size: 15px;
	color: var(--crpf-text);
}
.crpf-consent input[type="checkbox"] {
	width: 20px;
	height: 20px;
	accent-color: var(--crpf-primary);
	cursor: pointer;
}

/* Payment summary */
.crpf-summary {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--crpf-border);
	border-radius: 12px;
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}
.crpf-summary-row {
	display: flex;
	justify-content: space-between;
	padding: 8px 0;
	color: var(--crpf-text);
}
.crpf-summary-row.crpf-total {
	border-top: 1px solid var(--crpf-border);
	margin-top: 8px;
	padding-top: 16px;
	font-size: 18px;
	font-weight: 600;
}

/* Gateway selection */
.crpf-gateway-options {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 1.5rem 0;
}
.crpf-gateway-option {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 20px;
	border: 1px solid var(--crpf-border);
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.3s ease;
}
.crpf-gateway-option:hover {
	border-color: var(--crpf-border-focus);
	background: rgba(255, 255, 255, 0.03);
}
.crpf-gateway-option.is-selected {
	border-color: var(--crpf-primary);
	background: rgba(214, 36, 159, 0.1);
}
.crpf-gateway-option input[type="radio"] {
	width: 20px;
	height: 20px;
	accent-color: var(--crpf-primary);
}

/* Messages */
.crpf-message {
	padding: 1.5rem;
	border-radius: 12px;
	margin: 1rem 0;
	text-align: center;
	font-size: 16px;
}
.crpf-message.crpf-success {
	background: rgba(46, 204, 113, 0.1);
	border: 1px solid rgba(46, 204, 113, 0.3);
	color: #2ecc71;
}
.crpf-message.crpf-error-msg {
	background: rgba(255, 107, 107, 0.1);
	border: 1px solid rgba(255, 107, 107, 0.3);
	color: var(--crpf-error);
}

/* Loading spinner */
.crpf-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: crpf-spin 0.7s linear infinite;
}

/* Hide payment confirmation spinner */
#crpf-confirm-spinner {
	display: none !important;
}

@keyframes crpf-spin {
	to { transform: rotate(360deg); }
}

/* Step content */
.crpf-step-content { animation: crpf-fade 0.4s ease; }
@keyframes crpf-fade {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 600px) {
	.crpf-wrapper {
		padding: 2rem 1.5rem;
		margin: 1rem;
	}
	.crpf-actions {
		flex-direction: column-reverse;
		align-items: stretch;
	}
	.crpf-btn {
		width: 100%;
	}
}

/* Fee confirmation modal */
.crpf-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 1rem;
	animation: crpf-fade 0.2s ease;
}
/* In-modal error message + tappable fallback redirect link. */
.crpf-modal-error:empty {
	display: none;
}
.crpf-modal-error {
	margin: 4px 0 0;
	text-align: center;
}
.crpf-modal-redirect {
	display: none;
	width: 100%;
	margin-top: 14px;
	text-decoration: none;
}
.crpf-modal-redirect.is-visible {
	display: inline-flex;
}
body.crpf-modal-open {
	overflow: hidden;
}
.crpf-modal {
	background: var(--crpf-bg);
	border: 1px solid var(--crpf-border);
	border-radius: 16px;
	max-width: 420px;
	width: 100%;
	padding: 2rem;
	text-align: center;
	color: var(--crpf-text);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.crpf-modal h3 {
	margin: 0 0 0.5rem;
	font-size: 18px;
	font-weight: 600;
	color: var(--crpf-text);
}
.crpf-success-icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 0.75rem;
	border-radius: 50%;
	background: #1a6e5b;
	color: #fff;
	font-size: 30px;
	line-height: 56px;
	font-weight: 700;
}
.crpf-modal-amount {
	font-size: 34px;
	font-weight: 700;
	color: var(--crpf-primary);
	margin: 0.5rem 0;
}
.crpf-modal-note {
	font-size: 14px;
	color: var(--crpf-muted);
	margin: 0.5rem 0 1.5rem;
	line-height: 1.5;
}
.crpf-modal-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	align-items: center;
}
.crpf-modal-actions .crpf-btn-primary {
	flex: 1 1 auto;
}
@media (max-width: 480px) {
	.crpf-modal-actions {
		flex-direction: column-reverse;
	}
	.crpf-modal-actions .crpf-btn {
		width: 100%;
	}
}

/* Full-width centered button */
.crpf-btn-block {
	display: flex;
	width: 100%;
	margin-top: 0.5rem;
	text-align: center;
}

/* Payment method section */
.crpf-pay-methods {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--crpf-border);
}
.crpf-pay-methods-title {
	font-size: 16px;
	font-weight: 600;
	color: var(--crpf-text);
	margin: 0 0 1rem;
}
.crpf-gateway-name {
	font-size: 15px;
	color: var(--crpf-text);
}

/* Radio button groups */
.crpf-radio-group {
	border: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.crpf-radio-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
	font-size: 0.95rem;
	color: var(--crpf-text, #fff);
}

.crpf-radio-label input[type="radio"] {
	cursor: pointer;
	width: 18px;
	height: 18px;
	accent-color: var(--crpf-primary, #d6249f);
}

.crpf-radio-label:hover {
	color: var(--crpf-primary, #d6249f);
}

.crpf-radio-label input[type="radio"]:focus {
	outline: 2px solid var(--crpf-primary, #d6249f);
	outline-offset: 2px;
}

/* Membership Fee Highlight Section */
.crpf-fee-section {
	background: var(--crpf-fee-bg, #d6249f);
	border-radius: 12px;
	padding: 2rem 1.5rem;
	margin: 2rem 0;
	text-align: center;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
	border: 1px solid rgba(255, 255, 255, 0.15);
}

.crpf-fee-label {
	font-size: 14px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.85);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 0.75rem;
}

.crpf-fee-amount {
	font-size: 36px;
	font-weight: 700;
	color: var(--crpf-fee-text, #ffffff);
	line-height: 1.2;
}

@media (max-width: 600px) {
	.crpf-fee-section {
		padding: 1.5rem 1.25rem;
		margin: 1.5rem 0;
	}

	.crpf-fee-amount {
		font-size: 28px;
	}
}
