/* =========================================================
   Edu Light Activation — Modal Design
   ========================================================= */

:root {
	--ela-primary: #6d28d9;
	--ela-primary-dark: #5b21b6;
	--ela-primary-light: #ede9fe;
	--ela-accent: #10b981;
	--ela-text: #1f2937;
	--ela-text-muted: #6b7280;
	--ela-border: #e5e7eb;
	--ela-bg: #ffffff;
	--ela-danger: #dc2626;
	--ela-radius: 16px;
	--ela-shadow: 0 24px 60px -12px rgba(76, 29, 149, 0.35), 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* ---- Trigger button ---- */
.ela-trigger-wrap {
	display: flex;
	justify-content: center;
	width: 100%;
}

.ela-trigger-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 13px 26px;
	background: linear-gradient(135deg, var(--ela-primary) 0%, #8b5cf6 100%);
	color: #fff;
	border: none;
	border-radius: 999px;
	font-size: 26px;
	font-weight: 600;
	letter-spacing: 0.01em;
	cursor: pointer;
	box-shadow: 0 8px 20px -6px rgba(109, 40, 217, 0.55);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ela-trigger-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 26px -6px rgba(109, 40, 217, 0.6);
}

.ela-trigger-btn:active {
	transform: translateY(0);
}

.ela-trigger-icon {
	display: inline-flex;
	width: 18px;
	height: 18px;
}

/* ---- Overlay ---- */
.ela-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(17, 12, 34, 0.6);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 20px;
	animation: elaFadeIn 0.2s ease;
}

.ela-modal-overlay[hidden] {
	display: none;
}

@keyframes elaFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* ---- Modal shell ---- */
.ela-modal {
	position: relative;
	background: var(--ela-bg);
	border-radius: var(--ela-radius);
	width: 100%;
	max-width: 480px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 40px 36px 36px;
	box-shadow: var(--ela-shadow);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--ela-text);
	animation: elaPopIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.ela-modal-close {
	position: absolute;
	top: 18px;
	right: 18px;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #f3f4f6;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	color: var(--ela-text-muted);
	transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.ela-modal-close:hover {
	background: #ede9fe;
	color: var(--ela-primary);
	transform: rotate(90deg);
}

/* ---- Progress indicator ---- */
.ela-progress {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-bottom: 28px;
}

.ela-progress-dot {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #f3f4f6;
	color: var(--ela-text-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.ela-progress-dot.ela-progress-active {
	background: var(--ela-primary);
	color: #fff;
	transform: scale(1.15);
}

.ela-progress-dot.ela-progress-done {
	background: var(--ela-accent);
	color: #fff;
}

.ela-progress-line {
	flex: 1;
	max-width: 60px;
	height: 2px;
	background: var(--ela-border);
	border-radius: 2px;
}

/* ---- Steps ---- */
.ela-step {
	display: none;
}

.ela-step-active {
	display: block;
}

.ela-step-icon {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--ela-primary-light);
	color: var(--ela-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px;
}

.ela-step-icon-success {
	background: #d1fae5;
	color: #059669;
}

.ela-step h2 {
	font-size: 20px;
	font-weight: 700;
	text-align: center;
	margin: 0 0 8px;
	color: var(--ela-text);
}

.ela-step-sub {
	text-align: center;
	color: var(--ela-text-muted);
	font-size: 14px;
	margin: 0 0 24px;
}

/* ---- Input label ---- */
.ela-input-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--ela-text);
	margin-bottom: 7px;
}

/* ---- Code form ---- */
#ela-code-form input[type="text"] {
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--ela-border);
	border-radius: 10px;
	font-size: 15px;
	color: var(--ela-text);
	background: #fafafa;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
	box-sizing: border-box;
	outline: none;
}

#ela-code-form input[type="text"]:focus {
	border-color: var(--ela-primary);
	background: #fff;
	box-shadow: 0 0 0 3px var(--ela-primary-light);
}

/* ---- Buttons ---- */
.ela-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 28px;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
	width: 100%;
	margin-top: 16px;
	font-family: inherit;
}

.ela-btn-primary {
	background: linear-gradient(135deg, var(--ela-primary) 0%, #8b5cf6 100%);
	color: #fff;
	box-shadow: 0 6px 18px -4px rgba(109, 40, 217, 0.5);
}

.ela-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 22px -4px rgba(109, 40, 217, 0.55);
}

.ela-btn-primary:active {
	transform: translateY(0);
}

.ela-btn-primary:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.ela-btn-full {
	width: 100%;
}

/* ---- Error message ---- */
.ela-error {
	font-size: 13px;
	color: var(--ela-danger);
	margin: 8px 0 0;
	padding: 8px 12px;
	background: #fef2f2;
	border-radius: 7px;
	border: 1px solid #fecaca;
}

/* ===============================================================
   Membership Card
   =============================================================== */
#ela-step-card {
	padding-top: 4px;
}

.ela-membership-card {
	position: relative;
	overflow: hidden;
	border-radius: 18px;
	background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 45%, #8b5cf6 100%);
	color: #fff;
	padding: 24px 24px 20px;
	box-shadow: 0 16px 40px -8px rgba(76, 29, 149, 0.55), 0 6px 16px rgba(0,0,0,0.12);
	margin-bottom: 20px;
	animation: elaCardIn 0.36s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes elaCardIn {
	from { opacity: 0; transform: translateY(12px) scale(0.97); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Decorative circles */
.ela-card-decor {
	position: absolute;
	border-radius: 50%;
	opacity: 0.12;
	pointer-events: none;
}

.ela-card-decor-1 {
	width: 180px;
	height: 180px;
	background: #fff;
	top: -60px;
	right: -50px;
}

.ela-card-decor-2 {
	width: 120px;
	height: 120px;
	background: #fff;
	bottom: -50px;
	left: -30px;
}

/* Card header */
.ela-card-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 20px;
}

.ela-card-logo {
	width: 32px;
	height: 32px;
	background: rgba(255,255,255,0.18);
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.ela-card-title {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	flex: 1;
	opacity: 0.9;
}

.ela-card-badge {
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.14em;
	background: rgba(16, 185, 129, 0.28);
	color: #6ee7b7;
	border: 1px solid rgba(16, 185, 129, 0.5);
	border-radius: 999px;
	padding: 3px 9px;
	text-transform: uppercase;
}

/* Card body (avatar + info) */
.ela-card-body {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 20px;
}

.ela-card-avatar-wrap {
	flex-shrink: 0;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	overflow: hidden;
	background: rgba(255,255,255,0.15);
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2.5px solid rgba(255,255,255,0.35);
}

.ela-card-avatar {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: none;
}

.ela-card-avatar-placeholder {
	color: rgba(255,255,255,0.7);
	display: flex;
	align-items: center;
	justify-content: center;
}

.ela-card-info {
	flex: 1;
	min-width: 0;
}

.ela-card-name {
	font-size: 17px;
	font-weight: 700;
	margin: 0 0 3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ela-card-email {
	font-size: 12px;
	opacity: 0.75;
	margin: 0 0 3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ela-card-address {
	font-size: 11px;
	opacity: 0.6;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Card footer */
.ela-card-footer {
	display: flex;
	justify-content: space-between;
	border-top: 1px solid rgba(255,255,255,0.18);
	padding-top: 14px;
	gap: 12px;
}

.ela-card-code-wrap,
.ela-card-price-wrap {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ela-card-price-wrap {
	text-align: right;
}

.ela-card-code-label,
.ela-card-price-label {
	font-size: 10px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	opacity: 0.55;
	font-weight: 600;
}

.ela-card-code {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.12em;
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.ela-card-price {
	font-size: 15px;
	font-weight: 700;
}

/* Card hint text */
.ela-card-hint {
	text-align: center;
	color: var(--ela-text-muted);
	font-size: 13px;
	margin: 0 0 4px;
}

/* ---- Verifying spinner ---- */
.ela-verify-spinner {
	width: 80px;
	height: 80px;
	margin: 8px auto 18px;
	position: relative;
}

.ela-verify-spinner svg:first-child {
	width: 80px;
	height: 80px;
	animation: elaSpinnerRotate 2s linear infinite;
}

@keyframes elaSpinnerRotate {
	from { transform: rotate(-90deg); }
	to   { transform: rotate(270deg); }
}

.ela-verify-track {
	stroke: var(--ela-primary-light);
}

.ela-verify-arc {
	stroke: var(--ela-primary);
	stroke-dasharray: 125.6;
	stroke-dashoffset: 94.2;
	stroke-linecap: round;
	transition: stroke-dashoffset 0.4s ease;
}

.ela-verify-check {
	position: absolute;
	inset: 50%;
	transform: translate(-50%, -50%);
	width: 32px;
	height: 32px;
	color: var(--ela-accent);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.ela-verify-spinner.ela-verify-complete .ela-verify-arc {
	stroke: var(--ela-accent);
	stroke-dashoffset: 0;
	animation: none;
}

.ela-verify-spinner.ela-verify-complete svg:first-child {
	animation: none;
}

.ela-verify-spinner.ela-verify-complete .ela-verify-check {
	opacity: 1;
}

.ela-verify-text {
	text-align: center;
	font-size: 15px;
	font-weight: 600;
	color: var(--ela-text);
	margin-bottom: 20px;
}

.ela-verify-substeps {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ela-verify-substeps span {
	font-size: 13px;
	color: var(--ela-text-muted);
	display: flex;
	align-items: center;
	gap: 8px;
	transition: color 0.25s ease;
}

.ela-verify-substeps span::before {
	content: '';
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--ela-border);
	flex-shrink: 0;
	transition: background 0.25s ease;
}

.ela-verify-substeps span.ela-substep-active {
	color: var(--ela-primary);
	font-weight: 600;
}

.ela-verify-substeps span.ela-substep-active::before {
	background: var(--ela-primary);
}

.ela-verify-substeps span.ela-substep-done {
	color: var(--ela-accent);
}

.ela-verify-substeps span.ela-substep-done::before {
	background: var(--ela-accent);
}

/* ---- Checkout step ---- */
#ela-step-checkout h2 {
	font-size: 18px;
	font-weight: 700;
	margin-bottom: 20px;
	text-align: center;
	color: var(--ela-text);
}

/* ---- Checkout loading dots ---- */
.ela-checkout-loading {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 6px;
	padding: 40px 0;
}

.ela-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--ela-primary);
	opacity: 0.3;
	animation: elaDotPulse 1.4s ease-in-out infinite;
}

.ela-dot:nth-child(1) { animation-delay: 0s; }
.ela-dot:nth-child(2) { animation-delay: 0.2s; }
.ela-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes elaDotPulse {
	0%, 80%, 100% { opacity: 0.3; transform: scale(1); }
	40%           { opacity: 1; transform: scale(1.3); }
}

/* ---- WooCommerce checkout overrides ---- */
#ela-checkout-fragment .woocommerce,
#ela-checkout-fragment .woocommerce-page {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

#ela-checkout-fragment .woocommerce-checkout h3 {
	font-size: 15px !important;
	font-weight: 600 !important;
	margin-top: 20px !important;
	color: var(--ela-text) !important;
}

#ela-checkout-fragment .woocommerce-checkout input,
#ela-checkout-fragment .woocommerce-checkout select,
#ela-checkout-fragment .woocommerce-checkout textarea {
	border-radius: 8px !important;
	border: 1.5px solid var(--ela-border) !important;
	padding: 10px 12px !important;
}

#ela-checkout-fragment .woocommerce-checkout input:focus,
#ela-checkout-fragment .woocommerce-checkout select:focus,
#ela-checkout-fragment .woocommerce-checkout textarea:focus {
	border-color: var(--ela-primary) !important;
	outline: none;
	box-shadow: 0 0 0 3px var(--ela-primary-light) !important;
}

#ela-checkout-fragment #place_order {
	background: linear-gradient(135deg, var(--ela-primary) 0%, #8b5cf6 100%) !important;
	border-radius: 10px !important;
	border: none !important;
	font-weight: 600 !important;
	padding: 14px !important;
}

/* ---- Thank-you step ---- */
#ela-step-thankyou #ela-thankyou-content {
	font-size: 15px;
	line-height: 1.6;
	color: var(--ela-text);
}

/* ---- Status badges (admin list table) ---- */
.ela-status-active {
	color: #1a7f37;
	font-weight: 600;
}

.ela-status-used {
	color: #666;
}

.ela-status-disabled {
	color: #b32d2e;
	font-weight: 600;
}

/* ---- Small screens ---- */
@media (max-width: 480px) {
	.ela-modal {
		padding: 32px 20px 28px;
		border-radius: 14px;
	}

	.ela-membership-card {
		padding: 20px 18px 16px;
	}

	.ela-card-name {
		font-size: 15px;
	}

	.ela-card-avatar-wrap {
		width: 52px;
		height: 52px;
	}
}
