/* =========================================================
   Wolf Custom Auth (wcauth) — scoped styles
   Namespaced under .wcauth-scope with resets on primitives so
   theme CSS (buttons, inputs, headings) cannot leak in.
   Design language: shadcn/ui-inspired tokens (radius, ring, muted...).
   ========================================================= */

.wcauth-scope {
	--wcauth-radius: 0.85rem;
	--wcauth-radius-sm: 0.6rem;
	--wcauth-bg: #ffffff;
	--wcauth-fg: #0f0f12;
	--wcauth-muted: #71717a;
	--wcauth-muted-bg: #f4f4f6;
	--wcauth-border: #e4e4e7;
	--wcauth-input: #f7f6fa;
	--wcauth-ring: #683ea4;
	--wcauth-primary: #683ea4;
	--wcauth-primary-fg: #ffffff;
	--wcauth-primary-hover: #59318d;
	--wcauth-destructive: #e5484d;
	--wcauth-shadow: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.08);
	--wcauth-shadow-lg: 0 25px 50px -12px rgba(0,0,0,.35);
	--wcauth-font: "Tajawal", "Inter", ui-sans-serif, system-ui, -apple-system, Segoe UI, Tahoma, Arial, sans-serif;
}

html.wp-dark-mode-active .wcauth-scope {
	--wcauth-bg: #121214;
	--wcauth-fg: #fafafa;
	--wcauth-muted: #a1a1aa;
	--wcauth-muted-bg: #1c1c1f;
	--wcauth-border: #2a2a2e;
	--wcauth-input: #19191c;
}

/* ---- Reset primitives inside our scope so theme styles cannot bleed in ---- */
.wcauth-scope, .wcauth-scope * {
	box-sizing: border-box;
}
.wcauth-scope button,
.wcauth-scope input,
.wcauth-scope select,
.wcauth-scope a {
	all: unset;
	box-sizing: border-box;
	font-family: var(--wcauth-font);
	color: var(--wcauth-fg);
}
.wcauth-scope button { cursor: pointer; }
.wcauth-scope h3, .wcauth-scope p, .wcauth-scope strong, .wcauth-scope span, .wcauth-scope label, .wcauth-scope nav, .wcauth-scope div {
	font-family: var(--wcauth-font);
	margin: 0;
}

/* ---- Overlay / Modal shell ---- */
.wcauth-overlay {
	position: fixed;
	inset: 0;
	background: rgba(10, 8, 15, .6);
	backdrop-filter: blur(2px);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 16px;
}
.wcauth-overlay.is-open { display: flex; }

.wcauth-modal {
	position: relative;
	width: 100%;
	max-width: 408px;
	background: var(--wcauth-bg);
	color: var(--wcauth-fg);
	border: 1px solid var(--wcauth-border);
	border-radius: calc(var(--wcauth-radius) + 0.35rem);
	padding: 28px 24px 26px;
	box-shadow: var(--wcauth-shadow-lg);
	max-height: 92vh;
	overflow-y: auto;
	animation: wcauth-pop .18s ease-out;
}
@keyframes wcauth-pop {
	from { opacity: 0; transform: translateY(6px) scale(.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.wcauth-close {
	position: absolute;
	top: 14px;
	left: 14px;
	width: 30px; height: 30px;
	display: flex; align-items: center; justify-content: center;
	border-radius: 999px;
	color: var(--wcauth-muted);
	background: var(--wcauth-muted-bg);
	font-size: 16px;
}
.wcauth-close:hover { color: var(--wcauth-fg); }

.wcauth-step { display: none; }
.wcauth-step[data-wcauth-active="1"] { display: block; }

.wcauth-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 20px;
}
.wcauth-head h3 { font-size: 18px; font-weight: 700; line-height: 1.3; }
.wcauth-sub { color: var(--wcauth-muted); font-size: 13px; margin-top: 2px; }

.wcauth-badge {
	width: 40px; height: 40px;
	flex: none;
	border-radius: 999px;
	background: var(--wcauth-muted-bg);
	color: var(--wcauth-primary);
	display: flex; align-items: center; justify-content: center;
	font-size: 20px;
}

.wcauth-back {
	width: 32px; height: 32px;
	flex: none;
	border-radius: 999px;
	background: var(--wcauth-muted-bg);
	display: flex; align-items: center; justify-content: center;
	font-size: 17px;
}
.wcauth-back:hover { background: var(--wcauth-border); }

.wcauth-label {
	display: block;
	font-size: 13.5px;
	font-weight: 600;
	margin: 16px 0 7px;
}
.wcauth-optional { font-weight: 400; color: var(--wcauth-muted); font-size: 12px; }

.wcauth-input-wrap { position: relative; }
.wcauth-input-icon {
	position: absolute;
	top: 50%; right: 13px;
	transform: translateY(-50%);
	color: var(--wcauth-muted);
	font-size: 16px;
	pointer-events: none;
}
.wcauth-input-wrap .wcauth-input { padding-right: 38px; }

.wcauth-input {
	display: block;
	width: 100%;
	background: var(--wcauth-input);
	border: 1px solid var(--wcauth-border);
	border-radius: var(--wcauth-radius-sm);
	padding: 11px 14px;
	font-size: 14.5px;
	line-height: 1.4;
	direction: ltr;
	text-align: right;
	transition: border-color .15s, box-shadow .15s;
}
.wcauth-input::placeholder { color: var(--wcauth-muted); }
.wcauth-input:focus {
	border-color: var(--wcauth-ring);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wcauth-ring) 22%, transparent);
}

.wcauth-select {
	flex: 0 0 96px;
	background: var(--wcauth-input);
	border: 1px solid var(--wcauth-border);
	border-radius: var(--wcauth-radius-sm);
	padding: 11px 10px;
	font-size: 13.5px;
	text-align: center;
}
.wcauth-select:focus {
	border-color: var(--wcauth-ring);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wcauth-ring) 22%, transparent);
}

.wcauth-phone-row { display: flex; gap: 8px; }
.wcauth-phone-row .wcauth-input-wrap { flex: 1; }

.wcauth-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	border-radius: var(--wcauth-radius-sm);
	padding: 12px 14px;
	font-size: 14.5px;
	font-weight: 700;
	margin-top: 18px;
	transition: background .15s, opacity .15s, transform .05s;
}
.wcauth-btn:active { transform: scale(.99); }
.wcauth-btn-primary {
	background: var(--wcauth-primary);
	color: var(--wcauth-primary-fg);
}
.wcauth-btn-primary:hover { background: var(--wcauth-primary-hover); }
.wcauth-btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.wcauth-divider {
	display: flex; align-items: center; gap: 10px;
	margin: 20px 0 14px;
	color: var(--wcauth-muted);
	font-size: 12.5px;
}
.wcauth-divider::before, .wcauth-divider::after {
	content: ""; flex: 1; height: 1px; background: var(--wcauth-border);
}

.wcauth-social-row { display: flex; gap: 10px; }
.wcauth-social-btn {
	flex: 1;
	display: flex; align-items: center; justify-content: center; gap: 8px;
	height: 42px;
	border: 1px solid var(--wcauth-border);
	border-radius: var(--wcauth-radius-sm);
	background: var(--wcauth-bg);
	font-size: 13.5px;
	font-weight: 600;
}
.wcauth-social-btn i { font-size: 16px; }
.wcauth-social-btn:hover { background: var(--wcauth-muted-bg); }

.wcauth-error {
	color: var(--wcauth-destructive);
	font-size: 12px;
	min-height: 15px;
	margin-top: 5px;
}

.wcauth-otp-row {
	display: flex;
	gap: 8px;
	direction: ltr;
	margin-top: 4px;
}
.wcauth-otp-box {
	width: 100%;
	aspect-ratio: 1 / 1;
	text-align: center;
	font-size: 19px;
	font-weight: 700;
	background: var(--wcauth-input);
	border: 1px solid var(--wcauth-border);
	border-radius: var(--wcauth-radius-sm);
	display: flex; align-items: center; justify-content: center;
}
.wcauth-otp-box:focus {
	border-color: var(--wcauth-ring);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wcauth-ring) 22%, transparent);
}

.wcauth-resend { text-align: center; font-size: 12.5px; color: var(--wcauth-muted); margin-top: 14px; }
.wcauth-link {
	color: var(--wcauth-primary);
	font-weight: 700;
	font-size: 12.5px;
}
.wcauth-link:disabled { color: var(--wcauth-muted); cursor: default; }

.wcauth-avatars { display: flex; gap: 10px; flex-wrap: wrap; }
.wcauth-avatar-btn {
	width: 54px; height: 54px;
	border-radius: 999px;
	overflow: hidden;
	border: 2px solid transparent;
	background: var(--wcauth-muted-bg);
	padding: 0;
}
.wcauth-avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wcauth-avatar-btn.is-selected {
	border-color: var(--wcauth-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wcauth-primary) 18%, transparent);
}

.wcauth-checkbox-row {
	display: flex; align-items: flex-start; gap: 9px;
	margin-top: 18px;
	font-size: 13px;
	cursor: pointer;
}
.wcauth-checkbox-row input {
	width: 17px; height: 17px;
	border: 1.5px solid var(--wcauth-border);
	border-radius: 5px;
	margin-top: 2px;
	flex: none;
	accent-color: var(--wcauth-primary);
	appearance: auto;
}
.wcauth-terms-link { color: var(--wcauth-primary); font-weight: 700; text-decoration: underline; }

.wcauth-loading {
	position: absolute; inset: 0;
	background: color-mix(in srgb, var(--wcauth-bg) 70%, transparent);
	display: none;
	align-items: center; justify-content: center;
	border-radius: inherit;
}
.wcauth-loading.is-active { display: flex; }
.wcauth-spinner {
	width: 30px; height: 30px;
	border: 3px solid var(--wcauth-border);
	border-top-color: var(--wcauth-primary);
	border-radius: 999px;
	animation: wcauth-spin .7s linear infinite;
}
@keyframes wcauth-spin { to { transform: rotate(360deg); } }

/* ===== Account Drawer ===== */
.wcauth-account-overlay { justify-content: flex-end; padding: 0; background: rgba(10,8,15,.5); }
.wcauth-drawer {
	width: 100%;
	max-width: 340px;
	height: 100%;
	background: var(--wcauth-bg);
	color: var(--wcauth-fg);
	padding: 24px 20px;
	overflow-y: auto;
	position: relative;
	box-shadow: var(--wcauth-shadow-lg);
	animation: wcauth-slide-in .18s ease-out;
}
@keyframes wcauth-slide-in {
	from { transform: translateX(16px); opacity: 0; }
	to   { transform: translateX(0); opacity: 1; }
}
.wcauth-drawer-head { position: relative; margin-bottom: 26px; padding-top: 6px; }
.wcauth-drawer-user { display: flex; align-items: center; gap: 12px; }
.wcauth-drawer-avatar { width: 52px; height: 52px; border-radius: 999px; object-fit: cover; border: 1px solid var(--wcauth-border); }
.wcauth-drawer-hi { display: block; font-size: 12px; color: var(--wcauth-muted); margin-bottom: 2px; }
.wcauth-drawer-nav { display: flex; flex-direction: column; }
.wcauth-drawer-nav a {
	display: flex; align-items: center; gap: 12px;
	padding: 14px 6px;
	font-size: 14.5px;
	font-weight: 500;
	border-bottom: 1px solid var(--wcauth-border);
}
.wcauth-drawer-nav a i { font-size: 18px; color: var(--wcauth-muted); }
.wcauth-drawer-nav a:hover { color: var(--wcauth-primary); }
.wcauth-drawer-nav a:hover i { color: var(--wcauth-primary); }
.wcauth-drawer-nav a.wcauth-logout { color: var(--wcauth-destructive); border-bottom: none; margin-top: 6px; }
.wcauth-drawer-nav a.wcauth-logout i { color: var(--wcauth-destructive); }

@media (max-width: 480px) {
	.wcauth-modal { max-width: 100%; border-radius: 18px 18px 0 0; }
	.wcauth-drawer { max-width: 86%; }
}
