/**
 * Test Engine Pro - Purchase System Stylesheet
 * Scoped styles for high compatibility with Astra, Elementor, and standard WordPress themes.
 */

:root {
	--te-primary: #2563eb;
	--te-primary-hover: #1d4ed8;
	--te-primary-dark: #1e40af;
	--te-secondary: #0f172a;
	--te-accent: #f59e0b;
	--te-success: #10b981;
	--te-error: #ef4444;
	--te-text: #1e293b;
	--te-text-muted: #64748b;
	--te-border: #e2e8f0;
	--te-bg-subtle: #f8fafc;
	--te-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
	--te-card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
	--te-radius: 12px;
}

.te-purchase-container {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	max-width: 1140px;
	margin: 40px auto;
	padding: 0 20px;
	box-sizing: border-box;
	color: var(--te-text);
}

.te-purchase-container *,
.te-purchase-container *::before,
.te-purchase-container *::after {
	box-sizing: inherit;
}

/* Admin Warning */
.te-purchase-admin-warning {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
	padding: 14px 18px;
	border-radius: var(--te-radius);
	margin-bottom: 30px;
	font-size: 14px;
	line-height: 1.5;
}

/* Header */
.te-purchase-header {
	text-align: center;
	margin-bottom: 48px;
}

.te-purchase-title {
	font-size: 32px;
	font-weight: 800;
	color: var(--te-secondary);
	margin: 0 0 12px 0;
	letter-spacing: -0.025em;
	line-height: 1.2;
}

.te-purchase-subtitle {
	font-size: 16px;
	color: var(--te-text-muted);
	max-width: 620px;
	margin: 0 auto;
	line-height: 1.6;
}

/* Pricing Grid */
.te-pricing-grid {
	display: grid;
	grid-template-columns: repeat(1, 1fr);
	gap: 24px;
	align-items: stretch;
	margin-bottom: 48px;
}

@media (min-width: 768px) {
	.te-pricing-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Plan Card */
.te-plan-card {
	background: #ffffff;
	border: 1px solid var(--te-border);
	border-radius: var(--te-radius);
	padding: 32px 28px;
	display: flex;
	flex-direction: column;
	position: relative;
	box-shadow: var(--te-card-shadow);
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.te-plan-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--te-card-shadow-hover);
	border-color: #cbd5e1;
}

/* Featured Card */
.te-plan-card.te-card-featured {
	border: 2px solid var(--te-primary);
	background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
	transform: scale(1.02);
	z-index: 2;
}

.te-plan-card.te-card-featured:hover {
	transform: scale(1.02) translateY(-4px);
}

/* Badge */
.te-plan-badge {
	position: absolute;
	top: -14px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--te-primary);
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 4px 14px;
	border-radius: 9999px;
	box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.te-plan-card:nth-child(3) .te-plan-badge {
	background: var(--te-accent);
	box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

/* Plan Header */
.te-plan-header {
	margin-bottom: 20px;
}

.te-plan-name {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 6px 0;
	color: var(--te-secondary);
}

.te-plan-desc {
	font-size: 13px;
	color: var(--te-text-muted);
	margin: 0;
	line-height: 1.4;
	min-height: 36px;
}

/* Price Box */
.te-plan-price-box {
	display: flex;
	align-items: baseline;
	margin-bottom: 24px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--te-border);
}

.te-currency-symbol {
	font-size: 24px;
	font-weight: 600;
	color: var(--te-secondary);
	margin-right: 2px;
}

.te-price-amount {
	font-size: 42px;
	font-weight: 800;
	color: var(--te-secondary);
	letter-spacing: -0.03em;
	line-height: 1;
}

.te-billing-cycle {
	font-size: 13px;
	color: var(--te-text-muted);
	margin-left: 8px;
	font-weight: 500;
}

/* Features */
.te-feature-list {
	list-style: none;
	padding: 0;
	margin: 0 0 32px 0;
	flex-grow: 1;
}

.te-feature-list li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 14px;
	color: #334155;
	margin-bottom: 12px;
	line-height: 1.5;
}

.te-check-icon {
	color: var(--te-success);
	flex-shrink: 0;
	margin-top: 2px;
}

/* Buttons */
.te-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 13px 20px;
	font-size: 15px;
	font-weight: 600;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	border: 1px solid transparent;
	text-decoration: none;
	text-align: center;
	line-height: 1.2;
}

.te-btn:focus-visible {
	outline: 2px solid var(--te-primary);
	outline-offset: 2px;
}

.te-btn-primary {
	background: var(--te-primary);
	color: #ffffff;
	box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.te-btn-primary:hover:not(:disabled) {
	background: var(--te-primary-hover);
	color: #ffffff;
}

.te-btn-secondary {
	background: #f1f5f9;
	color: var(--te-secondary);
	border-color: #e2e8f0;
}

.te-btn-secondary:hover:not(:disabled) {
	background: #e2e8f0;
	color: var(--te-secondary);
}

.te-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* Trust Badges */
.te-trust-badges {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 32px;
	padding: 24px 0;
	border-top: 1px solid var(--te-border);
	color: var(--te-text-muted);
	font-size: 13px;
	font-weight: 500;
}

.te-trust-item {
	display: flex;
	align-items: center;
	gap: 8px;
}

.te-trust-item svg {
	color: #059669;
}

/* Modal Backdrop & Dialog */
.te-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 16px;
	animation: teFadeIn 0.2s ease-out;
}

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

.te-modal-dialog {
	background: #ffffff;
	border-radius: var(--te-radius);
	width: 100%;
	max-width: 480px;
	padding: 32px;
	position: relative;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	animation: teSlideUp 0.25s ease-out;
}

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

.te-modal-close {
	position: absolute;
	top: 18px;
	right: 18px;
	background: transparent;
	border: none;
	font-size: 26px;
	line-height: 1;
	color: #94a3b8;
	cursor: pointer;
	padding: 4px;
}

.te-modal-close:hover {
	color: #334155;
}

.te-modal-header {
	margin-bottom: 24px;
}

.te-modal-title {
	font-size: 22px;
	font-weight: 700;
	color: var(--te-secondary);
	margin: 0 0 12px 0;
}

.te-order-summary-box {
	background: var(--te-bg-subtle);
	border: 1px solid var(--te-border);
	padding: 12px 16px;
	border-radius: 8px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 14px;
}

.te-summary-plan {
	font-weight: 600;
	color: var(--te-secondary);
}

.te-summary-price {
	font-weight: 700;
	color: var(--te-primary);
	font-size: 16px;
}

/* Form Groups */
.te-form-group {
	margin-bottom: 20px;
}

.te-form-group label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #334155;
	margin-bottom: 6px;
}

.te-required {
	color: var(--te-error);
}

.te-input {
	width: 100%;
	padding: 11px 14px;
	font-size: 14px;
	border: 1px solid var(--te-border);
	border-radius: 6px;
	color: var(--te-text);
	transition: border-color 0.2s, box-shadow 0.2s;
	background: #ffffff;
}

.te-input:focus {
	outline: none;
	border-color: var(--te-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.te-help-text {
	display: block;
	font-size: 12px;
	color: var(--te-text-muted);
	margin-top: 5px;
}

.te-field-error {
	font-size: 12px;
	color: var(--te-error);
	margin-top: 5px;
}

.te-modal-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 13px;
	margin-bottom: 18px;
}

/* Modal Footer */
.te-modal-footer {
	margin-top: 24px;
}

.te-secure-footer-note {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 11px;
	color: #94a3b8;
	margin-top: 12px;
	text-align: center;
}

/* Spinner */
.te-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #ffffff;
	border-radius: 50%;
	display: inline-block;
	animation: teSpin 0.7s linear infinite;
	margin-left: 8px;
}

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

/* Success Screen */
.te-success-screen {
	max-width: 600px;
	margin: 20px auto;
	animation: teFadeIn 0.3s ease-out;
}

.te-success-card {
	background: #ffffff;
	border: 1px solid var(--te-border);
	border-radius: var(--te-radius);
	padding: 44px 36px;
	text-align: center;
	box-shadow: var(--te-card-shadow);
}

.te-success-icon-wrap {
	width: 68px;
	height: 68px;
	background: #d1fae5;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px auto;
}

.te-success-check {
	width: 36px;
	height: 36px;
	color: #059669;
}

.te-success-heading {
	font-size: 24px;
	font-weight: 800;
	color: var(--te-secondary);
	margin: 0 0 14px 0;
	line-height: 1.3;
}

.te-success-body {
	font-size: 15px;
	color: var(--te-text-muted);
	margin: 0 0 28px 0;
	line-height: 1.6;
}

.te-highlight-email {
	color: var(--te-secondary);
	font-weight: 600;
}

.te-success-instructions {
	background: var(--te-bg-subtle);
	border: 1px solid var(--te-border);
	border-radius: 8px;
	padding: 20px;
	text-align: left;
	margin-bottom: 28px;
}

.te-success-instructions h4 {
	margin: 0 0 10px 0;
	font-size: 14px;
	color: var(--te-secondary);
}

.te-success-instructions ol {
	margin: 0;
	padding-left: 20px;
	color: #475569;
	font-size: 13px;
	line-height: 1.7;
}

.te-success-actions {
	display: flex;
	justify-content: center;
}

.te-success-actions .te-btn {
	width: auto;
	padding: 10px 24px;
}
