/* ============ احراز هویت - آبنر ============ */

#abLoginOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 15, 30, 0.35);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  animation: abFadeIn 0.3s ease;
}
#abLoginOverlay.hidden { display: none !important; }

@keyframes abFadeIn { from { opacity: 0; } to { opacity: 1; } }

.ab-login-card {
  width: 100%;
  max-width: 400px;
  padding: 32px 28px 24px;
  border-radius: 26px;
  background: rgba(255, 255, 255, var(--glass-opacity, 0.12)) !important;
  backdrop-filter: blur(calc(var(--dash-blur-px, 24px) + 8px)) saturate(180%) !important;
  -webkit-backdrop-filter: blur(calc(var(--dash-blur-px, 24px) + 8px)) saturate(180%) !important;
  border: 1px solid var(--dash-glass-border, rgba(255, 255, 255, 0.3)) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  color: #f8fafc;
  text-align: center;
  animation: abCardIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  position: relative;
}

@keyframes abCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ab-login-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.ab-login-close:hover { background: rgba(239, 68, 68, 0.6); color: #fff; }

.ab-login-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.4);
}
.ab-login-icon svg { width: 38px; height: 38px; stroke: #fff; }

.ab-login-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.3px;
}

.ab-login-subtitle {
  margin: 0 0 24px;
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0.8;
  line-height: 1.7;
}

.ab-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  background: #fff;
  color: #1f2937;
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.ab-google-btn:hover {
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
.ab-google-btn:active { transform: translateY(0); }
.ab-google-btn:disabled { opacity: 0.6; cursor: wait; }

.ab-login-skip {
  margin-top: 14px;
  padding: 10px;
  background: transparent;
  border: none;
  color: inherit;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  opacity: 0.65;
  cursor: pointer;
  transition: opacity 0.2s;
  width: 100%;
}
.ab-login-skip:hover { opacity: 1; }

.ab-login-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.ab-login-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0.85;
  text-align: right;
}
.ab-login-feature svg { flex-shrink: 0; opacity: 0.7; }

/* ============ دکمه‌ی داکر بعد از ورود ============ */

.ab-dock-btn-logged-in {
  background: linear-gradient(135deg, #38bdf8, #2563eb) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.5);
  border: none !important;
  overflow: hidden;
  padding: 0 !important;
}

/* حرف اول — وسط دایره، دقیق */
.ab-user-initial {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: center;
  transform: translateY(-1px); /* اصلاح بصری برای فونت فارسی */
}

/* عکس پروفایل — پرکننده‌ی کامل دایره */
.ab-user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 50%;
}

/* ============ منوی حساب ============ */
.ab-account-menu {
  width: 260px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(15, 25, 45, 0.35) !important;
  backdrop-filter: blur(var(--dash-blur-px, 24px)) saturate(180%) !important;
  -webkit-backdrop-filter: blur(var(--dash-blur-px, 24px)) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 4px;
  direction: rtl;
  animation: abCardIn 0.2s ease;
}

.ab-account-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
}
.ab-account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 17px;
  flex-shrink: 0;
  overflow: hidden;
}
.ab-account-avatar > span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  transform: translateY(-1px);
}
.ab-account-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.ab-account-info { flex: 1; overflow: hidden; }
.ab-account-name {
  font-size: 13.5px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ab-account-email {
  font-size: 11.5px;
  opacity: 0.7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.ab-account-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 4px 0;
}
.ab-account-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: inherit;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  text-align: right;
  width: 100%;
}
.ab-account-item:hover { background: rgba(255, 255, 255, 0.12); }
.ab-account-item.ab-account-danger { color: #fca5a5; }
.ab-account-item.ab-account-danger:hover { background: rgba(239, 68, 68, 0.18); }

/* ============ تم لایت ============ */
body.theme-light .ab-login-card,
body.theme-light .ab-account-menu {
  background: rgba(255, 252, 245, 0.97) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-color: rgba(120, 90, 50, 0.22) !important;
  color: #2a1f14 !important;
}
body.theme-light .ab-login-close { background: rgba(0, 0, 0, 0.08); color: #2a1f14; }
body.theme-light .ab-login-features { border-top-color: rgba(0, 0, 0, 0.1); }
body.theme-light .ab-account-divider { background: rgba(0, 0, 0, 0.1); }
body.theme-light .ab-account-item:hover { background: rgba(0, 0, 0, 0.06); }
body.theme-light .ab-account-item.ab-account-danger { color: #dc2626; }
body.theme-light .ab-account-item.ab-account-danger:hover { background: rgba(239, 68, 68, 0.12); }

/* ============ تم دارک ============ */
body.theme-dark .ab-login-card,
body.theme-dark .ab-account-menu {
  background: rgba(10, 15, 30, 0.97) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

@media (max-width: 480px) {
  .ab-login-card { padding: 26px 20px 18px; border-radius: 22px; }
  .ab-login-icon { width: 60px; height: 60px; margin-bottom: 12px; }
  .ab-login-icon svg { width: 30px; height: 30px; }
  .ab-login-title { font-size: 17px; }
}