/**
 * لاگین باران — استایل فرانت‌اند
 * طراحی: کارت شیشه‌ای با امضای بصری «باران» ☔
 */

:root {
	--lb-primary: #2563eb;
	--lb-primary-dark: #1e40af;
	--lb-ink: #0f172a;
	--lb-muted: #64748b;
	--lb-line: #e2e8f0;
	--lb-bg: #ffffff;
	--lb-success: #059669;
	--lb-danger: #dc2626;
	--lb-radius: 18px;
	--lb-font: "Vazirmatn", "Vazir", -apple-system, "Segoe UI", Tahoma, sans-serif;
}

/* ---------- کارت ---------- */
.lb-card {
	position: relative;
	max-width: 400px;
	margin-inline: auto;
	background: var(--lb-bg);
	border: 1px solid var(--lb-line);
	border-radius: var(--lb-radius);
	box-shadow: 0 24px 60px -28px rgba(30, 64, 175, 0.35), 0 2px 8px rgba(15, 23, 42, 0.05);
	padding: 30px 28px 18px;
	font-family: var(--lb-font);
	direction: rtl;
	text-align: center;
	color: var(--lb-ink);
	overflow: hidden;
	box-sizing: border-box;
}
.lb-card *, .lb-card *::before, .lb-card *::after { box-sizing: border-box; font-family: inherit; }

/* امضای بصری: باران ملایم بالای کارت */
.lb-rain {
	position: absolute;
	inset: 0 0 auto 0;
	height: 96px;
	pointer-events: none;
	background:
		linear-gradient(180deg, color-mix(in srgb, var(--lb-primary) 10%, transparent), transparent 85%);
	overflow: hidden;
}
.lb-rain::before,
.lb-rain::after {
	content: "";
	position: absolute;
	inset: -100% 0 0 0;
	background-image:
		linear-gradient(transparent 0 86%, color-mix(in srgb, var(--lb-primary) 55%, transparent) 86% 100%);
	background-size: 28px 64px;
	opacity: 0.35;
	animation: lb-rainfall 1.6s linear infinite;
	transform: rotate(8deg) scale(1.4);
}
.lb-rain::after {
	background-size: 44px 90px;
	opacity: 0.18;
	animation-duration: 2.4s;
}
@keyframes lb-rainfall {
	to { transform: rotate(8deg) scale(1.4) translateY(64px); }
}

/* ---------- سربرگ ---------- */
.lb-head { position: relative; margin-bottom: 20px; }
.lb-logo {
	display: inline-flex;
	width: 58px;
	height: 58px;
	border-radius: 18px;
	align-items: center;
	justify-content: center;
	color: #fff;
	background: linear-gradient(140deg, var(--lb-primary), var(--lb-primary-dark));
	box-shadow: 0 10px 24px -10px var(--lb-primary);
	margin-bottom: 12px;
}
.lb-logo svg { width: 30px; height: 30px; }
.lb-logo .lb-drop { animation: lb-drip 1.4s ease-in-out infinite; }
@keyframes lb-drip {
	0%, 100% { opacity: 0.25; transform: translateY(-1px); }
	50% { opacity: 1; transform: translateY(1px); }
}
.lb-title { margin: 0 0 6px !important; font-size: 20px !important; font-weight: 800; color: var(--lb-ink); line-height: 1.4; }
.lb-sub { margin: 0; font-size: 13px; color: var(--lb-muted); line-height: 1.9; }

/* ---------- فیلدها ---------- */
.lb-field {
	position: relative;
	display: block;
	margin-bottom: 14px;
}
.lb-field-icon {
	position: absolute;
	inset-inline-start: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 20px;
	height: 20px;
	color: var(--lb-muted);
	pointer-events: none;
}
.lb-field-icon svg { width: 100%; height: 100%; }
.lb-input {
	width: 100%;
	height: 52px;
	border: 1.5px solid var(--lb-line) !important;
	border-radius: 14px !important;
	padding: 0 16px 0 44px !important;
	font: 600 16px/1 var(--lb-font) !important;
	letter-spacing: 1px;
	text-align: center;
	color: var(--lb-ink) !important;
	background: #f8fafc !important;
	transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
	outline: none;
	box-shadow: none !important;
}
.lb-input:focus {
	border-color: var(--lb-primary) !important;
	background: #fff !important;
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--lb-primary) 14%, transparent) !important;
}
.lb-input::placeholder { color: #94a3b8; font-weight: 400; letter-spacing: 0; }

/* ---------- خانه‌های کد یکبار مصرف ---------- */
.lb-otp-boxes {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-bottom: 16px;
}
.lb-otp-box {
	width: 46px;
	height: 54px;
	border: 1.5px solid var(--lb-line) !important;
	border-radius: 12px !important;
	background: #f8fafc !important;
	text-align: center;
	font: 800 22px/1 var(--lb-font) !important;
	color: var(--lb-ink) !important;
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
	outline: none;
	padding: 0 !important;
	box-shadow: none !important;
}
.lb-otp-box:focus {
	border-color: var(--lb-primary) !important;
	background: #fff !important;
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--lb-primary) 14%, transparent) !important;
	transform: translateY(-2px);
}
.lb-otp-box.lb-filled { border-color: var(--lb-primary) !important; background: #fff !important; }

/* ---------- دکمه‌ها ---------- */
.lb-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 52px;
	border: 0;
	border-radius: 14px;
	font: 700 15px/1 var(--lb-font);
	cursor: pointer;
	transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
	text-decoration: none !important;
}
.lb-btn-primary {
	color: #fff !important;
	background: linear-gradient(140deg, var(--lb-primary), var(--lb-primary-dark));
	box-shadow: 0 14px 28px -12px var(--lb-primary);
}
.lb-btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.lb-btn-primary:active { transform: translateY(0); }
.lb-btn-ghost { background: #f1f5f9; color: var(--lb-ink) !important; width: auto; padding: 0 22px; height: 44px; }
.lb-btn-sm { height: 44px; font-size: 14px; }
.lb-btn[disabled] { opacity: 0.65; cursor: wait; }

.lb-spinner {
	width: 18px;
	height: 18px;
	border: 2.5px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	display: none;
	animation: lb-spin 0.7s linear infinite;
}
@keyframes lb-spin { to { transform: rotate(360deg); } }
.lb-btn.lb-loading .lb-spinner { display: inline-block; }
.lb-btn.lb-loading .lb-btn-text { opacity: 0.85; }

.lb-link {
	background: none;
	border: 0;
	color: var(--lb-primary);
	font: 600 13px/1 var(--lb-font);
	cursor: pointer;
	padding: 4px;
	text-decoration: none;
}
.lb-link:hover { text-decoration: underline; }
.lb-resend { display: block; margin: 12px auto 0; }
.lb-resend[disabled] { color: var(--lb-muted); cursor: default; text-decoration: none; }

/* ---------- پیام‌ها ---------- */
.lb-alert {
	border-radius: 12px;
	padding: 11px 14px;
	font-size: 13px;
	line-height: 1.8;
	margin-bottom: 14px;
	text-align: right;
	animation: lb-pop 0.25s ease;
}
.lb-alert.lb-error { background: #fef2f2; color: var(--lb-danger); border: 1px solid #fecaca; }
.lb-alert.lb-success { background: #ecfdf5; color: var(--lb-success); border: 1px solid #a7f3d0; }
@keyframes lb-pop { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- پانوشت ---------- */
.lb-foot {
	margin-top: 20px;
	padding-top: 14px;
	border-top: 1px dashed var(--lb-line);
	font-size: 11px;
	color: #94a3b8;
}
.lb-foot a { color: var(--lb-muted); text-decoration: none; }
.lb-foot a:hover { color: var(--lb-primary); }

/* ---------- حالت واردشده ---------- */
.lb-logged-in-inner { position: relative; padding-top: 8px; }
.lb-avatar img { border-radius: 50%; box-shadow: 0 8px 20px -8px var(--lb-primary); }
.lb-logged-in p { font-size: 15px; font-weight: 700; margin: 12px 0 16px; }

/* ---------- مودال ---------- */
.lb-modal { position: fixed; inset: 0; z-index: 999999; display: none; }
.lb-modal.lb-show { display: block; }
.lb-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(6px);
	animation: lb-fade 0.2s ease;
}
.lb-modal-dialog {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	pointer-events: none;
}
.lb-modal-dialog .lb-card { pointer-events: auto; animation: lb-rise 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2); width: 100%; }
.lb-modal-close {
	position: absolute;
	z-index: 2;
	top: 26px;
	inset-inline-start: 26px;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, 0.92);
	color: var(--lb-ink);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	pointer-events: auto;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
	transition: transform 0.15s;
}
.lb-modal-close:hover { transform: rotate(90deg); }
@keyframes lb-fade { from { opacity: 0; } }
@keyframes lb-rise { from { opacity: 0; transform: translateY(24px) scale(0.97); } }
body.lb-modal-open { overflow: hidden; }

/* ---------- تأیید شماره در تسویه‌حساب ---------- */
.lb-checkout-verify {
	border: 1.5px dashed var(--lb-primary);
	background: color-mix(in srgb, var(--lb-primary) 5%, #fff);
	border-radius: 14px;
	padding: 16px;
	margin: 0 0 18px;
	font-family: var(--lb-font);
	text-align: right;
}
.lb-checkout-verify.lb-verified {
	border-color: var(--lb-success);
	background: #ecfdf5;
}
.lb-cv-status { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.lb-checkout-verify.lb-verified .lb-cv-status { margin-bottom: 0; }
.lb-cv-icon {
	flex: 0 0 30px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--lb-primary);
	color: #fff;
}
.lb-checkout-verify.lb-verified .lb-cv-icon { background: var(--lb-success); }
.lb-cv-icon svg { width: 16px; height: 16px; }
.lb-cv-check { stroke-dasharray: 24; stroke-dashoffset: 24; }
.lb-checkout-verify.lb-verified .lb-cv-check { animation: lb-check 0.5s ease forwards; }
@keyframes lb-check { to { stroke-dashoffset: 0; } }
.lb-cv-text { font-size: 13.5px; font-weight: 600; color: var(--lb-ink); line-height: 1.8; }
.lb-cv-form { margin-top: 14px; }
.lb-cv-form .lb-card { max-width: 100%; box-shadow: none; border-style: solid; }
.lb-cv-form .lb-foot { display: none; }

/* ---------- دروازه ورود چک‌اوت ---------- */
.lb-checkout-gate {
	max-width: 440px;
	margin: 28px auto;
	font-family: var(--lb-font);
	direction: rtl;
}
.lb-gate-notice {
	display: flex;
	align-items: center;
	gap: 12px;
	background: color-mix(in srgb, var(--lb-primary) 7%, #fff);
	border: 1.5px dashed var(--lb-primary);
	border-radius: 14px;
	padding: 14px 16px;
	margin-bottom: 18px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--lb-ink);
	line-height: 1.9;
	text-align: right;
}
.lb-gate-icon { font-size: 24px; flex: 0 0 auto; }
body.lb-checkout-gated .woocommerce-NoticeGroup,
body.lb-checkout-gated .woocommerce-notices-wrapper:empty { display: none; }

/* ---------- صفحه ورود وردپرس ---------- */
.lb-wp-login-wrap { margin-bottom: 22px; }
body.login .lb-card { box-shadow: 0 10px 30px -16px rgba(30, 64, 175, 0.4); }

/* ---------- ریسپانسیو ---------- */
@media (max-width: 420px) {
	.lb-card { padding: 24px 18px 14px; border-radius: 16px; }
	.lb-otp-box { width: 40px; height: 50px; font-size: 20px !important; }
	.lb-otp-boxes { gap: 6px; }
}

/* ---------- کاهش حرکت ---------- */
@media (prefers-reduced-motion: reduce) {
	.lb-rain::before, .lb-rain::after, .lb-logo .lb-drop, .lb-spinner { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
	.lb-btn, .lb-otp-box, .lb-modal-close { transition: none; }
}
