/* ============================================================
   Whop Checkout — Styles
   ============================================================ */

/* ── Page wrapper ─────────────────────────────────────────── */
.whop-checkout-page {
	max-width: 520px;
	margin: 48px auto;
	padding: 0 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Card ─────────────────────────────────────────────────── */
.whop-card {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 36px 32px;
	box-shadow: 0 4px 28px rgba(0, 0, 0, 0.07);
}

.whop-card__title {
	font-size: 22px;
	font-weight: 700;
	color: #111827;
	margin: 0 0 26px;
	line-height: 1.3;
}

/* ── Form fields ──────────────────────────────────────────── */
.whop-field {
	margin-bottom: 18px;
}

.whop-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #374151;
	margin-bottom: 6px;
}

.whop-required {
	color: #ef4444;
	margin-left: 2px;
}

.whop-input {
	width: 100%;
	padding: 11px 14px;
	font-size: 15px;
	color: #111827;
	background: #f9fafb;
	border: 1.5px solid #d1d5db;
	border-radius: 8px;
	box-sizing: border-box;
	transition: border-color 0.18s, box-shadow 0.18s;
	outline: none;
}

.whop-input:focus {
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
	background: #ffffff;
}

.whop-input::placeholder {
	color: #9ca3af;
}

/* ── Error message ────────────────────────────────────────── */
.whop-error {
	display: none;
	padding: 10px 14px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	color: #b91c1c;
	font-size: 14px;
	margin-bottom: 16px;
}

/* ── CTA button ───────────────────────────────────────────── */
.whop-btn {
	display: block;
	width: 100%;
	padding: 13px 24px;
	font-size: 16px;
	font-weight: 600;
	color: #ffffff;
	background: #6366f1;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.1s ease;
	text-align: center;
	margin-top: 8px;
	letter-spacing: 0.01em;
}

.whop-btn:hover {
	background: #4f46e5;
}

.whop-btn:active {
	transform: scale(0.98);
}

.whop-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ── Modal overlay ────────────────────────────────────────── */

/*
 * The modal is always in the DOM (not display:none) so that the Whop
 * loader.js can find and initialise the checkout iframe in the background.
 * Visibility is toggled via opacity + pointer-events.
 */
.whop-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	/* Hidden by default — NOT display:none so Whop loader can initialise iframe */
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.whop-modal.is-open {
	opacity: 1;
	pointer-events: all;
}

/* Backdrop */
.whop-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

/* Content box */
.whop-modal__content {
	position: relative;
	background: #ffffff;
	border-radius: 14px;
	width: 100%;
	max-width: 580px;
	max-height: 92vh;
	overflow-y: auto;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
	z-index: 1;
	-webkit-overflow-scrolling: touch;
}

/* Close button */
.whop-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	background: #f3f4f6;
	border: none;
	border-radius: 50%;
	font-size: 20px;
	line-height: 32px;
	cursor: pointer;
	color: #6b7280;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.18s, color 0.18s;
	z-index: 2;
}

.whop-modal__close:hover {
	background: #e5e7eb;
	color: #111827;
}

/* ── Whop embed container ─────────────────────────────────── */
.whop-embed {
	min-height: 500px;
	width: 100%;
	overflow: hidden;
}

/* The iframe Whop injects */
.whop-embed iframe {
	width: 100% !important;
	border: none !important;
	display: block !important;
}

/* ── Config warning (no plan set) ─────────────────────────── */
.whop-config-notice {
	padding: 24px;
	margin: 16px;
	color: #92400e;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.5;
}

.whop-config-notice a {
	color: #d97706;
}

/* ── Utility ──────────────────────────────────────────────── */
body.whop-modal-open {
	overflow: hidden;
}

.whop-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
