/*
 * Woo Separate Pages – Custom Styles
 * Applies to [wsp_login_form] and [wsp_register_form] shortcode pages.
 */

/* ── Reset & Variables ──────────────────────────────────── */
:root {
	/* Primary color is injected dynamically from the active theme.
	   Fallback is a neutral dark color that works on any site. */
	--wsp-primary: var(--wp--preset--color--primary, var(--theme-palette1, var(--accent-color, #333333)));
	--wsp-primary-hover: var(--wsp-primary);
	--wsp-primary-light: color-mix(in srgb, var(--wsp-primary) 10%, #ffffff);
	--wsp-bg: #f7f7f8;
	--wsp-card-bg: #ffffff;
	--wsp-text: #1a1a1a;
	--wsp-text-muted: #6b7280;
	--wsp-border: #e5e7eb;
	--wsp-input-border: #d1d5db;
	--wsp-input-focus: var(--wsp-primary);
	--wsp-radius: 12px;
	--wsp-radius-sm: 8px;
	--wsp-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
	--wsp-transition: 0.2s ease;
}

/* ── Wrapper ────────────────────────────────────────────── */
.wsp-form-wrapper {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 70vh;
	padding: 60px 24px;
	background: var(--wsp-bg);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
		Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ── Card ───────────────────────────────────────────────── */
.wsp-form-wrapper .wsp-form-card {
	width: 90%;
	max-width: 900px;
	background: var(--wsp-card-bg) !important;
	border-radius: var(--wsp-radius) !important;
	box-shadow: var(--wsp-shadow) !important;
	padding: 48px 56px;
	border: 1px solid var(--wsp-border) !important;
	box-sizing: border-box;
}

/* ── Header ─────────────────────────────────────────────── */
.wsp-form-header {
	text-align: center;
	margin-bottom: 32px;
}

.wsp-form-wrapper .wsp-icon {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50% !important;
	background: var(--wsp-primary-light) !important;
	color: var(--wsp-primary) !important;
	margin-bottom: 20px;
	overflow: hidden;
}

.wsp-form-wrapper .wsp-icon svg {
	width: 32px !important;
	height: 32px !important;
	display: block;
}

.wsp-form-header h2 {
	margin: 0 0 8px;
	font-size: 28px;
	font-weight: 700;
	color: var(--wsp-text);
	letter-spacing: -0.01em;
}

.wsp-subtitle {
	margin: 0;
	font-size: 15px;
	color: var(--wsp-text-muted);
}

/* ── Fields ─────────────────────────────────────────────── */
.wsp-field {
	margin-bottom: 20px;
}

.wsp-field label {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	font-size: 15px;
	font-weight: 600;
	color: var(--wsp-text);
}

.wsp-form-wrapper .wsp-field input[type="text"],
.wsp-form-wrapper .wsp-field input[type="email"],
.wsp-form-wrapper .wsp-field input[type="password"] {
	width: 100%;
	padding: 14px 16px;
	font-size: 16px;
	line-height: 1.4;
	color: var(--wsp-text);
	background: var(--wsp-card-bg);
	border: 1.5px solid var(--wsp-input-border);
	border-radius: var(--wsp-radius-sm);
	outline: none;
	transition: border-color var(--wsp-transition), box-shadow var(--wsp-transition);
	box-sizing: border-box;
}

.wsp-form-wrapper .wsp-field input[type="text"]:focus,
.wsp-form-wrapper .wsp-field input[type="email"]:focus,
.wsp-form-wrapper .wsp-field input[type="password"]:focus {
	border-color: var(--wsp-input-focus);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wsp-primary) 15%, transparent);
}

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

/* ── Forgot Link ────────────────────────────────────────── */
.wsp-forgot-link {
	font-size: 13px;
	font-weight: 500;
	color: var(--wsp-primary);
	text-decoration: none;
	transition: color var(--wsp-transition);
}

.wsp-forgot-link:hover {
	color: var(--wsp-primary-hover);
	text-decoration: underline;
}

/* ── Checkbox ───────────────────────────────────────────── */
.wsp-remember {
	margin-bottom: 24px;
}

.wsp-checkbox-label {
	display: flex !important;
	align-items: center;
	gap: 8px;
	font-weight: 500 !important;
	font-size: 14px;
	color: var(--wsp-text-muted);
	cursor: pointer;
}

.wsp-checkbox-label input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--wsp-primary);
	cursor: pointer;
}

/* ── Privacy ────────────────────────────────────────────── */
.wsp-privacy {
	margin-bottom: 24px;
}

.wsp-privacy-text {
	margin: 0;
	font-size: 13px;
	color: var(--wsp-text-muted);
	line-height: 1.5;
}

.wsp-privacy-text a {
	color: var(--wsp-primary);
	text-decoration: none;
	font-weight: 500;
}

.wsp-privacy-text a:hover {
	text-decoration: underline;
}

/* ── Button ─────────────────────────────────────────────── */
.wsp-form-wrapper .wsp-button {
	display: block;
	width: 100%;
	padding: 16px 24px;
	font-size: 16px;
	font-weight: 600;
	color: #ffffff !important;
	background: var(--wsp-primary) !important;
	border: none !important;
	border-radius: var(--wsp-radius-sm) !important;
	cursor: pointer;
	transition: background var(--wsp-transition), transform var(--wsp-transition), box-shadow var(--wsp-transition);
	letter-spacing: 0.01em;
}

.wsp-form-wrapper .wsp-button:hover {
	background: var(--wsp-primary-hover) !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	transform: translateY(-1px);
	filter: brightness(0.85);
}

.wsp-form-wrapper .wsp-button:active {
	transform: translateY(0);
	box-shadow: none;
}

/* ── Footer ─────────────────────────────────────────────── */
.wsp-form-footer {
	text-align: center;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--wsp-border);
}

.wsp-form-footer p {
	margin: 0;
	font-size: 14px;
	color: var(--wsp-text-muted);
}

.wsp-form-footer a {
	color: var(--wsp-primary);
	text-decoration: none;
	font-weight: 600;
}

.wsp-form-footer a:hover {
	text-decoration: underline;
}

/* ── Already Logged In ──────────────────────────────────── */
.wsp-already-logged {
	text-align: center;
	padding: 40px 20px;
	font-size: 15px;
	color: var(--wsp-text-muted);
}

.wsp-already-logged a {
	color: var(--wsp-primary);
	font-weight: 600;
	text-decoration: none;
}

.wsp-already-logged a:hover {
	text-decoration: underline;
}

/* ── WooCommerce Notices Override ────────────────────────── */
.wsp-form-card .woocommerce-error,
.wsp-form-card .woocommerce-message,
.wsp-form-card .woocommerce-info {
	margin: 0 0 20px;
	padding: 12px 16px;
	border-radius: var(--wsp-radius-sm);
	font-size: 14px;
	list-style: none;
}

.wsp-form-card .woocommerce-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
}

.wsp-form-card .woocommerce-message {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #166534;
}

.wsp-form-card .woocommerce-info {
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	color: #1e40af;
}

/* ── Responsive (single-page forms) ─────────────────────── */
@media (max-width: 600px) {
	.wsp-form-card {
		width: 95%;
		max-width: 100%;
		padding: 32px 24px;
	}

	.wsp-form-header h2 {
		font-size: 22px;
	}

	.wsp-icon {
		width: 52px;
		height: 52px;
	}

	.wsp-icon svg {
		width: 26px;
		height: 26px;
	}
}

/* ══════════════════════════════════════════════════════════
   COMBINED PAGE – Login & Register side-by-side
   High-specificity selectors to override theme styles.
   ══════════════════════════════════════════════════════════ */

/* ── Combined Wrapper ───────────────────────────────────── */
.wsp-form-wrapper.wsp-combined-wrapper {
	display: block !important;
	min-height: 70vh;
	padding: 48px 24px;
	background: var(--wsp-bg);
}

/* ── Combined Container ─────────────────────────────────── */
.wsp-combined-wrapper .wsp-combined-container {
	width: 92% !important;
	max-width: 1140px !important;
	margin: 0 auto !important;
	box-sizing: border-box;
}

/* ── Tabs ───────────────────────────────────────────────── */
.wsp-combined-wrapper .wsp-tabs {
	display: none;
	gap: 4px;
	background: var(--wsp-card-bg);
	border: 1px solid var(--wsp-border);
	border-radius: var(--wsp-radius);
	padding: 6px;
	margin-bottom: 24px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.wsp-combined-wrapper .wsp-tab {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 20px;
	font-size: 15px;
	font-weight: 600;
	color: var(--wsp-text-muted);
	background: transparent;
	border: 2px solid transparent;
	border-radius: var(--wsp-radius-sm);
	cursor: pointer;
	transition: all var(--wsp-transition);
	font-family: inherit;
	line-height: 1;
}

.wsp-combined-wrapper .wsp-tab svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	display: inline-block;
}

.wsp-combined-wrapper .wsp-tab:hover {
	color: var(--wsp-text);
	background: var(--wsp-bg);
}

.wsp-combined-wrapper .wsp-tab.wsp-tab--active {
	color: #ffffff;
	background: var(--wsp-primary);
	border-color: var(--wsp-primary);
}

.wsp-combined-wrapper .wsp-tab.wsp-tab--active svg {
	color: #ffffff;
}

/* ── Panels grid (desktop = side-by-side) ───────────────── */
.wsp-combined-wrapper .wsp-combined-panels {
	display: grid !important;
	grid-template-columns: 1fr 60px 1fr !important;
	gap: 0 !important;
	align-items: stretch !important;
}

.wsp-combined-wrapper .wsp-panel {
	display: block !important;
	width: 100% !important;
	min-width: 0;
}

/* ── Cards inside combined panels ───────────────────────── */
.wsp-combined-wrapper .wsp-panel .wsp-form-card {
	width: 100% !important;
	max-width: 100% !important;
	padding: 40px 32px !important;
	background: var(--wsp-card-bg) !important;
	border-radius: var(--wsp-radius) !important;
	box-shadow: var(--wsp-shadow) !important;
	border: 1px solid var(--wsp-border) !important;
	box-sizing: border-box !important;
}

/* Icons inside combined */
.wsp-combined-wrapper .wsp-icon {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 56px !important;
	height: 56px !important;
	border-radius: 50% !important;
	background: var(--wsp-primary-light) !important;
	color: var(--wsp-primary) !important;
	margin-bottom: 16px;
}

.wsp-combined-wrapper .wsp-icon svg {
	width: 28px !important;
	height: 28px !important;
}

/* ── Vertical Divider ───────────────────────────────────── */
.wsp-combined-wrapper .wsp-divider {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 60px;
	position: relative;
}

.wsp-combined-wrapper .wsp-divider::before {
	content: '';
	position: absolute;
	top: 40px;
	bottom: 40px;
	left: 50%;
	width: 1px;
	background: var(--wsp-border);
	transform: translateX(-50%);
}

.wsp-combined-wrapper .wsp-divider span {
	position: relative;
	z-index: 1;
	padding: 12px 0;
	background: var(--wsp-bg);
	font-size: 12px;
	font-weight: 700;
	color: var(--wsp-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.1em;
}

/* ── Desktop: hide tabs, show both panels ───────────────── */
@media (min-width: 769px) {
	.wsp-combined-wrapper .wsp-tabs {
		display: none !important;
	}

	.wsp-combined-wrapper .wsp-panel {
		display: block !important;
	}
}

/* ── Tablet & Mobile: show tabs, stack panels ───────────── */
@media (max-width: 768px) {
	.wsp-combined-wrapper .wsp-tabs {
		display: flex !important;
	}

	.wsp-combined-wrapper .wsp-combined-panels {
		display: block !important;
	}

	.wsp-combined-wrapper .wsp-panel {
		display: none !important;
	}

	.wsp-combined-wrapper .wsp-panel.wsp-panel--active {
		display: block !important;
	}

	.wsp-combined-wrapper .wsp-divider {
		display: none !important;
	}

	.wsp-combined-wrapper .wsp-panel .wsp-form-card {
		padding: 32px 24px !important;
	}

	.wsp-combined-wrapper .wsp-combined-container {
		width: 95% !important;
	}
}

@media (max-width: 480px) {
	.wsp-combined-wrapper .wsp-tab {
		padding: 12px 12px;
		font-size: 14px;
		gap: 6px;
	}

	.wsp-combined-wrapper .wsp-tab svg {
		width: 16px;
		height: 16px;
	}

	.wsp-combined-wrapper .wsp-panel .wsp-form-card {
		padding: 24px 18px !important;
	}
}
