/**
 * پوستهٔ لاگین وردپرس — کارت سمت راست + لوگوی سه‌بعدی چرخان سمت چپ
 * از طریق افزونه branch_login (با آپدیت WP بازنمی‌گردد)
 * فونت: یکان (همان سایت) — @font-face از WpLoginTheme تزریق می‌شود
 */

:root {
  --li-card: #ffffff;
  --li-ink: #1a1230;
  --li-muted: #6b5b7c;
  --li-border: rgba(85, 45, 133, 0.16);
  --li-blue: #552d85;
  --li-blue-hover: #3f2166;
  --li-blue-soft: #f3eaf8;
  --li-cyan: #4a97ca;
  --li-radius: 16px;
  --li-shadow: 0 22px 50px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --li-font: yekan, "Yekan", Tahoma, Arial, sans-serif;
  --li-panel-w: min(420px, calc(100vw - 32px));
}

html,
body.login {
  min-height: 100%;
  height: 100%;
  margin: 0 !important;
  font-family: var(--li-font) !important;
  color: var(--li-ink);
  overflow-x: hidden;
  background: #0a0614 !important;
}

body.login * {
  box-sizing: border-box;
}

/* ─── پس‌زمینه شبکه‌ای (مثل همتایار، رنگ لوگوی همتالونز) ─── */
.bl-login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(ellipse at 30% 20%, #3d2a6e 0%, #1a0e32 45%, #0a0614 100%);
}

.bl-login-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 900px) {
  .bl-li-hero {
    display: none !important;
  }
}

/* ─── لوگوی SVG با عمق سه‌بعدی (نسبت عمودی کامل) ─── */
.bl-li-hero {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(52vw, 640px);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 40px 16px 48px;
  pointer-events: none;
  perspective: 1400px;
  perspective-origin: 48% 42%;
}

.bl-li-matrix-stage {
  position: relative;
  /* نسبت تقریبی لوگو ~0.73 — ارتفاع مبنا تا چیزی بریده نشود */
  width: min(280px, 32vw);
  height: min(380px, 44vw);
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  overflow: visible;
  flex: 0 0 auto;
}

.bl-li-logo-glow {
  position: absolute;
  inset: 12% 8% 8%;
  border-radius: 48%;
  background:
    radial-gradient(ellipse at 40% 35%, rgba(74, 151, 202, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 70%, rgba(85, 45, 133, 0.38) 0%, transparent 60%);
  filter: blur(28px);
  z-index: 0;
  pointer-events: none;
  animation: blLogoGlow 6s ease-in-out infinite alternate;
}

.bl-li-matrix-spin {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  animation: blMatrixTilt 14s ease-in-out infinite;
  will-change: transform;
  overflow: visible;
}

.bl-li-logo-3d {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  transform: rotateY(-18deg) rotateX(10deg);
}

.bl-li-logo-extrude,
.bl-li-hero-logo {
  grid-area: 1 / 1;
  width: auto;
  height: 92%;
  max-height: 360px;
  max-width: 100%;
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  backface-visibility: hidden;
}

.bl-li-logo-extrude {
  transform: translateZ(calc(var(--z, 1) * -3px)) scale(1.01);
  opacity: 0.22;
  filter: saturate(0.7) brightness(0.55);
  pointer-events: none;
}

.bl-li-hero-logo {
  position: relative;
  z-index: 2;
  transform: translateZ(4px);
  filter:
    drop-shadow(0 2px 0 rgba(40, 20, 80, 0.12))
    drop-shadow(0 18px 28px rgba(60, 40, 120, 0.28))
    drop-shadow(0 4px 10px rgba(74, 151, 202, 0.25));
}

@keyframes blMatrixTilt {
  0%   { transform: rotateY(0deg) rotateX(0deg) translateY(0); }
  20%  { transform: rotateY(22deg) rotateX(8deg) translateY(-8px); }
  40%  { transform: rotateY(-8deg) rotateX(16deg) translateY(2px); }
  60%  { transform: rotateY(-22deg) rotateX(-6deg) translateY(6px); }
  80%  { transform: rotateY(12deg) rotateX(-14deg) translateY(-2px); }
  100% { transform: rotateY(0deg) rotateX(0deg) translateY(0); }
}

@keyframes blLogoGlow {
  from { opacity: 0.75; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1.04); }
}

/* ─── پنل ورود — سمت راست فیزیکی ─── */
body.login {
  background: #0a0614 !important;
  display: block !important;
}

body.login #login {
  position: relative;
  z-index: 2;
  width: var(--li-panel-w);
  margin: 0 !important;
  margin-left: auto !important;
  margin-right: 3.5vw !important;
  padding: 40px 0 48px !important;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.login.rtl #login {
  /* حتی در RTL پنل روی راست صفحه بماند */
  margin-left: auto !important;
  margin-right: 3.5vw !important;
}

/* لوگو */
body.login #login h1 {
  margin: 0 0 16px;
  text-align: center;
}

body.login #login h1 a {
  background-image: none !important;
  width: auto;
  height: auto;
  margin: 0 auto 4px;
  padding: 0;
  text-indent: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--li-blue) !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

body.login #login h1 a::before {
  content: "";
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(145deg, #4a97ca, #552d85);
  box-shadow: 0 8px 18px rgba(85, 45, 133, 0.32);
  display: inline-block;
}

body.login.bl-has-custom-logo #login h1 a::before {
  display: none;
}

body.login.bl-has-custom-logo #login h1 a {
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  width: 170px;
  height: 60px;
  text-indent: -9999px;
  overflow: hidden;
}

/* کارت شیشه‌ای */
body.login #loginform,
body.login #registerform,
body.login #lostpasswordform,
body.login form.bl-totp-form,
body.login #login form {
  background: var(--li-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--li-radius);
  box-shadow: var(--li-shadow);
  padding: 28px 28px 22px;
  margin-top: 0;
}

body.login #loginform p,
body.login #lostpasswordform p {
  margin-bottom: 14px;
}

body.login label {
  font-size: 14px;
  font-weight: 600;
  color: var(--li-ink);
  margin-bottom: 6px;
  display: block;
}

body.login #loginform input[type="text"],
body.login #loginform input[type="password"],
body.login #loginform input[type="email"],
body.login #lostpasswordform input[type="text"],
body.login input.input {
  font-size: 16px !important;
  line-height: 1.4 !important;
  padding: 12px 14px !important;
  border: 1px solid var(--li-border) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.95) !important;
  color: var(--li-ink) !important;
  box-shadow: none !important;
  font-family: var(--li-font) !important;
}

body.login #loginform input[type="text"]:focus,
body.login #loginform input[type="password"]:focus,
body.login input.input:focus {
  border-color: var(--li-blue) !important;
  box-shadow: 0 0 0 3px rgba(74, 151, 202, 0.22) !important;
  outline: none !important;
}

body.login .forgetmenot {
  float: none !important;
  margin: 4px 0 16px !important;
}

body.login .forgetmenot label {
  font-weight: 400;
  color: var(--li-muted);
  display: inline;
}

body.login .submit {
  margin: 0 !important;
  padding: 0 !important;
}

body.login #wp-submit,
body.login .button-primary {
  width: 100% !important;
  float: none !important;
  height: auto !important;
  min-height: 48px;
  padding: 12px 18px !important;
  border: none !important;
  border-radius: 24px !important;
  background: linear-gradient(135deg, #4a97ca 0%, #552d85 100%) !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  text-shadow: none !important;
  box-shadow: 0 10px 24px rgba(85, 45, 133, 0.32) !important;
  transition: background 0.15s ease, transform 0.15s ease;
  font-family: var(--li-font) !important;
}

body.login #wp-submit:hover,
body.login .button-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

body.login #nav,
body.login #backtoblog {
  text-align: center;
  padding: 8px 0 0;
  margin: 12px 0 0;
  position: relative;
  z-index: 2;
}

body.login #nav a,
body.login #backtoblog a {
  color: #aadaeb !important;
  font-weight: 600;
  text-decoration: none;
  text-shadow: none;
}

body.login #nav a:hover,
body.login #backtoblog a:hover {
  text-decoration: underline;
  color: #f8f4f8 !important;
}

body.login #language-switcher {
  display: none !important;
}

body.login .message,
body.login #login_error,
body.login .success {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(20, 40, 80, 0.08);
  margin: 0 0 14px !important;
  position: relative;
  z-index: 2;
}

/* تب‌ها */
.bl-li-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 14px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 10px 28px rgba(20, 40, 80, 0.1);
  position: relative;
  z-index: 2;
}

.bl-li-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--li-muted);
  font-family: var(--li-font);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.bl-li-tab.is-active {
  background: #fff;
  color: var(--li-blue);
  box-shadow: 0 4px 12px rgba(85, 45, 133, 0.14);
}

.bl-li-panel[hidden] {
  display: none !important;
}

.bl-li-branch-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--li-radius);
  box-shadow: var(--li-shadow);
  padding: 28px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.bl-li-branch-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--li-ink);
}

.bl-li-branch-card p {
  margin: 0 0 20px;
  color: var(--li-muted);
  font-size: 14px;
  line-height: 1.7;
}

.bl-li-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bl-li-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--li-font);
  text-decoration: none !important;
  cursor: pointer;
  border: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.bl-li-btn-primary {
  background: var(--li-blue);
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(85, 45, 133, 0.28);
}

.bl-li-btn-primary:hover {
  background: var(--li-blue-hover);
  transform: translateY(-1px);
}

.bl-li-btn-ghost {
  background: rgba(255, 255, 255, 0.85);
  color: var(--li-blue) !important;
  border: 1px solid rgba(85, 45, 133, 0.4);
}

.bl-li-btn-ghost:hover {
  background: var(--li-blue-soft);
}

/* کپچا */
body.login .bl-wp-login-captcha {
  margin: 4px 0 16px !important;
  padding: 12px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid var(--li-border);
  border-radius: 12px;
}

body.login .bl-wp-login-captcha-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

body.login #bl-wp-login-captcha-img {
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  height: 50px;
  width: auto;
}

body.login .bl-wp-login-captcha-refresh {
  min-width: 44px !important;
  height: 44px !important;
  border-radius: 22px !important;
  border: 1px solid var(--li-border) !important;
  background: #fff !important;
  color: var(--li-ink) !important;
  box-shadow: none !important;
}

/* ─── دیالوگ نمایندگی — پنل کشویی از راست ─── */
.bl-li-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}

.bl-li-modal.is-open {
  display: flex;
}

.bl-li-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(20, 45, 80, 0.18), rgba(20, 45, 80, 0.45));
  backdrop-filter: blur(2px);
}

.bl-li-modal-dialog {
  position: relative;
  width: min(440px, 100%);
  height: 100%;
  max-height: 100%;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-radius: 20px 0 0 20px;
  box-shadow: -18px 0 50px rgba(15, 40, 80, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: blSlideInRight 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes blSlideInRight {
  from { transform: translateX(100%); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

.bl-li-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.9);
}

.bl-li-modal-head strong {
  font-size: 15px;
  font-weight: 700;
}

.bl-li-modal-close {
  appearance: none;
  border: 0;
  background: #eef3f8;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--li-ink);
}

.bl-li-modal-frame {
  border: 0;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: #fff;
}

.bl-li-modal-foot {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  text-align: center;
  background: rgba(255, 255, 255, 0.92);
}

.bl-li-modal-foot a {
  color: var(--li-blue);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

body.login.rtl #login {
  direction: rtl;
}

@media (max-width: 900px) {
  .bl-li-hero {
    width: 100%;
    height: auto;
    min-height: 240px;
    top: 0;
    bottom: auto;
    justify-content: flex-end;
    padding: 20px 12px 12px;
    perspective: 900px;
  }
  .bl-li-matrix-stage {
    width: min(140px, 36vw);
    height: min(190px, 48vw);
  }
  .bl-li-logo-3d {
    transform: rotateY(-12deg) rotateX(8deg);
  }
  body.login #login {
    margin-right: auto !important;
    margin-left: auto !important;
    padding-top: 260px !important;
    min-height: auto;
  }
}

@media (max-width: 480px) {
  body.login #login {
    width: calc(100% - 20px);
    margin-right: 10px !important;
    margin-left: 10px !important;
  }
  body.login #loginform,
  body.login #lostpasswordform {
    padding: 22px 18px 18px;
  }
  .bl-li-modal-dialog {
    width: 100%;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
    height: min(92vh, 100%);
    animation-name: blSlideInUp;
  }
  @keyframes blSlideInUp {
    from { transform: translateY(100%); }
    to { transform: none; }
  }
  .bl-li-modal {
    align-items: flex-end;
  }
}

/* ═══════════════════════════════════════════
   /branch_login/ تمام‌صفحه — فقط ورود نمایندگی
   ═══════════════════════════════════════════ */
html:has(body.bl-branch-fullscreen),
body.bl-branch-fullscreen {
  min-height: 100%;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
  font-family: var(--li-font) !important;
  background: #0a0614 !important;
}

body.bl-branch-fullscreen #wpadminbar,
body.bl-branch-fullscreen header,
body.bl-branch-fullscreen .site-header,
body.bl-branch-fullscreen footer,
body.bl-branch-fullscreen .site-footer,
body.bl-branch-fullscreen .elementor-location-header,
body.bl-branch-fullscreen .elementor-location-footer,
body.bl-branch-fullscreen .wd-header,
body.bl-branch-fullscreen .whb-header,
body.bl-branch-fullscreen nav.main-nav,
body.bl-branch-fullscreen .mega-menu,
body.bl-branch-fullscreen .breadcrumb,
body.bl-branch-fullscreen .page-title,
body.bl-branch-fullscreen .entry-header,
body.bl-branch-fullscreen #hpb-site-header,
body.bl-branch-fullscreen .hpb-header-builder,
body.bl-branch-fullscreen .hpb-header,
body.bl-branch-fullscreen .hpb-footer-builder,
body.bl-branch-fullscreen .hpb-footer,
body.bl-branch-fullscreen #hpb-site-footer,
body.bl-branch-fullscreen .hpb-lb-sticky-bottom-host,
body.bl-branch-fullscreen .hpb-sticky-bottom-nav {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

body.bl-branch-fullscreen .bl-auth-shell {
  position: relative;
  z-index: 2;
  width: var(--li-panel-w);
  max-width: none;
  min-height: 100vh;
  margin: 0 !important;
  margin-left: auto !important;
  margin-right: 3.5vw !important;
  padding: 40px 0 48px !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  background: transparent !important;
  border-radius: 0 !important;
  box-sizing: border-box;
}

body.bl-branch-fullscreen .mega_check_login_by_sms_holder.bl-auth-card {
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  background: var(--li-card) !important;
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  border-radius: var(--li-radius) !important;
  box-shadow: var(--li-shadow) !important;
  overflow: hidden;
  font-family: var(--li-font) !important;
}

body.bl-branch-fullscreen .bl-auth-header {
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%) !important;
  color: var(--li-ink) !important;
  border-bottom: 1px solid var(--li-border);
}

body.bl-branch-fullscreen .bl-auth-eyebrow {
  color: var(--li-cyan) !important;
}

body.bl-branch-fullscreen .bl-tab-btn.active {
  background: linear-gradient(135deg, #4a97ca 0%, #552d85 100%) !important;
  box-shadow: 0 8px 20px rgba(85, 45, 133, 0.22);
}

body.bl-branch-fullscreen .bl-auth-title,
body.bl-branch-fullscreen .branch_login_intrance h1 {
  color: var(--li-ink) !important;
}

body.bl-branch-fullscreen .bl-auth-subtitle,
body.bl-branch-fullscreen .branch_login_intrance h2 {
  color: var(--li-muted) !important;
}

body.bl-branch-fullscreen .bl-btn-primary,
body.bl-branch-fullscreen #branch_login_by_sms,
body.bl-branch-fullscreen #password_login_btn {
  background: linear-gradient(135deg, #4a97ca 0%, #552d85 100%) !important;
  border-color: #552d85 !important;
}

body.bl-branch-fullscreen .bl-btn-primary:hover,
body.bl-branch-fullscreen #branch_login_by_sms:hover,
body.bl-branch-fullscreen #password_login_btn:hover {
  filter: brightness(1.06);
}

@media (max-width: 900px) {
  body.bl-branch-fullscreen .bl-li-hero {
    display: none;
  }
  body.bl-branch-fullscreen .bl-auth-shell {
    width: min(420px, calc(100vw - 28px));
    margin: 0 auto !important;
    padding: 28px 0 36px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bl-li-matrix-spin,
  .bl-li-modal-dialog,
  .bl-li-logo-glow {
    animation: none !important;
  }
  .bl-li-matrix-spin {
    transform: rotateY(-12deg) rotateX(6deg);
  }
}
