/* ZenFocus account / login UI */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, rgba(99, 102, 241, 0.35), transparent 55%),
              radial-gradient(circle at 80% 80%, rgba(56, 189, 248, 0.25), transparent 50%),
              rgba(7, 11, 22, 0.94);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.auth-overlay.open { opacity: 1; pointer-events: auto; }
body.auth-locked #app-container { filter: blur(6px); pointer-events: none; }

.auth-card {
  width: 380px;
  max-width: 92vw;
  padding: 30px 28px 26px;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  text-align: center;
  animation: authPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authPop {
  0% { transform: translateY(14px) scale(0.97); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

.auth-logo {
  width: 46px;
  height: 46px;
  margin: 0 auto 10px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.5);
}

.auth-title { font-size: 22px; font-weight: 800; color: #fff; }
.auth-subtitle { font-size: 13px; color: #94a3b8; margin: 4px 0 18px; }

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.auth-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #94a3b8;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab:hover { color: #e2e8f0; }
.auth-tab.active { background: linear-gradient(135deg, #6366f1, #38bdf8); color: #fff; }

#auth-form { text-align: left; display: flex; flex-direction: column; gap: 6px; }
.auth-label { font-size: 11.5px; font-weight: 600; color: #94a3b8; margin-top: 6px; }

.auth-input {
  width: 100%;
  padding: 11px 13px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15); }

.auth-error { min-height: 18px; margin-top: 4px; font-size: 12.5px; color: #f87171; }

.auth-submit {
  margin-top: 4px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
}

.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(99, 102, 241, 0.45); }
.auth-submit:disabled { opacity: 0.6; cursor: wait; transform: none; }

/* Sidebar account box */
.account-box {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.account-box.visible { display: flex; }
.account-info { display: flex; align-items: center; gap: 10px; min-width: 0; }

.account-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
}

.account-text { display: flex; flex-direction: column; min-width: 0; }
.account-label { font-size: 10.5px; color: #94a3b8; }
.account-name { font-size: 13.5px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.account-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #fca5a5;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.account-logout:hover { background: rgba(239, 68, 68, 0.28); color: #fff; }

/* Password show/hide */
.auth-pw-wrap { position: relative; }
.auth-pw-wrap .auth-input { padding-right: 42px; }
.auth-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: 8px; color: #94a3b8; cursor: pointer; transition: all 0.15s ease; }
.auth-eye:hover { color: #38bdf8; background: rgba(56, 189, 248, 0.12); }

/* Remember me checkbox */
.auth-remember-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 4px;
}

.auth-remember-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
}

.auth-remember-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
  position: relative;
  outline: none;
  transition: all 0.15s ease;
}

.auth-remember-label input[type="checkbox"]:hover {
  border-color: #38bdf8;
}

.auth-remember-label input[type="checkbox"]:checked {
  background: #38bdf8;
  border-color: #38bdf8;
}

.auth-remember-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid #0f172a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Profile Modal & Clickable Account Info */
.account-info {
  cursor: pointer;
  padding: 6px;
  border-radius: 10px;
  transition: all 0.2s ease;
  position: relative;
}

.account-info:hover {
  background: rgba(255, 255, 255, 0.07);
}

.account-info:hover .account-name {
  color: #38bdf8;
}

.account-info:hover .account-avatar {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

.account-arrow {
  margin-left: auto;
  color: #64748b;
  transition: transform 0.2s ease, color 0.2s ease;
}

.account-info:hover .account-arrow {
  color: #38bdf8;
  transform: translateX(2px);
}

.profile-modal-container {
  width: 500px;
  max-width: 92vw;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-header-icon {
  font-size: 18px;
}

.profile-modal-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 80vh;
  overflow-y: auto;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.profile-hero-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.profile-hero-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-hero-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-hero-title {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.profile-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  line-height: 1.3;
}

.profile-plan-badge.badge-free {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.profile-plan-badge.badge-premium {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(234, 88, 12, 0.22));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.55);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

body.theme-light .profile-plan-badge.badge-free {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

body.theme-light .profile-plan-badge.badge-premium {
  background: linear-gradient(135deg, #fef3c7, #fed7aa);
  color: #b45309;
  border-color: #f59e0b;
}

.profile-hero-tag {
  font-size: 12px;
  color: #94a3b8;
}

.profile-form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.profile-form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #e2e8f0;
}

.profile-form-label span {
  font-size: 11.5px;
  color: #94a3b8;
}

/* Profile Account Header Card */
.profile-account-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2px;
}

body.theme-light .profile-account-card {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.profile-account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  flex-shrink: 0;
}

.profile-account-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-account-label {
  font-size: 11.5px;
  color: #94a3b8;
}

.profile-account-username {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
}

body.theme-light .profile-account-username {
  color: #0f172a;
}

/* Tier Card (Free / Premium) */
.profile-tier-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-light .profile-tier-card {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.profile-tier-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-tier-desc {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}

body.theme-light .profile-tier-desc {
  color: #64748b;
}

.profile-tier-upgrade-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  white-space: nowrap;
}

.profile-tier-card.is-premium {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(15, 23, 42, 0.65));
  border-color: rgba(245, 158, 11, 0.35);
}

.profile-tier-card.is-premium .profile-tier-upgrade-btn {
  display: none !important;
}

.profile-account-avatar-wrap {
  position: relative;
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  transition: transform 0.2s ease;
}

.profile-account-avatar-wrap:hover {
  transform: scale(1.04);
}

.profile-account-avatar-wrap:hover .profile-account-avatar {
  filter: brightness(0.9);
}

.profile-account-avatar-wrap .avatar-edit-overlay {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #38bdf8;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}

.profile-account-avatar-wrap:hover .avatar-edit-overlay {
  transform: scale(1.15);
}

.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

/* Modal Logout Button */
.profile-logout-group {
  margin-top: 4px;
}

.profile-modal-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 9px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-modal-logout-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: #ef4444;
  color: #fca5a5;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}

body.theme-light .profile-modal-logout-btn {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

body.theme-light .profile-modal-logout-btn:hover {
  background: #fee2e2;
  border-color: #ef4444;
}

.profile-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

/* Avatar Customizer Styles */
.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.account-avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.profile-hero-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45);
  position: relative;
  flex-shrink: 0;
}

.avatar-picker-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.avatar-presets-grid {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.avatar-preset-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.avatar-preset-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-preset-btn.default-letter {
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
}

.avatar-preset-btn:hover {
  transform: scale(1.12);
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

.avatar-preset-btn.active {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.4);
  transform: scale(1.08);
}

.avatar-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px dashed rgba(56, 189, 248, 0.45);
  border-radius: 999px;
  color: #38bdf8;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.avatar-upload-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

/* ==========================================================================
   Light Theme Adaptations for Profile & Account Modal
   ========================================================================== */
body.theme-light .profile-modal-container {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
}

body.theme-light .profile-header-icon {
  filter: none;
}

body.theme-light .profile-form-label {
  color: #1e293b;
  font-weight: 600;
}

body.theme-light .profile-form-label strong {
  color: #0f172a;
}

body.theme-light .profile-form-label span {
  color: #64748b;
  font-weight: 500;
}

body.theme-light .profile-account-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

body.theme-light .profile-account-label {
  color: #64748b;
  font-weight: 500;
}

body.theme-light .profile-account-username {
  color: #0f172a;
  font-weight: 700;
}

body.theme-light .profile-account-avatar-wrap .avatar-edit-overlay {
  background: #0284c7;
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

body.theme-light .avatar-preset-btn {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

body.theme-light .avatar-preset-btn:hover {
  border-color: #0284c7;
  background: #f0f9ff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

body.theme-light .avatar-preset-btn.active {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
  background: #e0f2fe;
}

body.theme-light .avatar-upload-btn {
  background: #f0f9ff;
  border: 1px dashed #0284c7;
  color: #0284c7;
}

body.theme-light .avatar-upload-btn:hover {
  background: #e0f2fe;
  border-color: #0369a1;
  color: #0369a1;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.16);
}

body.theme-light .auth-input {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

body.theme-light .auth-input::placeholder {
  color: #94a3b8;
}

body.theme-light .auth-input:focus {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

body.theme-light .profile-tier-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

body.theme-light .profile-tier-desc {
  color: #475569;
}

body.theme-light .profile-tier-card.is-premium {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.08);
}

body.theme-light .profile-tier-card.is-premium .profile-tier-desc {
  color: #92400e;
  font-weight: 600;
}

body.theme-light .edit-btn-cancel {
  border: 1px solid #cbd5e1;
  color: #475569;
  background: #ffffff;
}

body.theme-light .edit-btn-cancel:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

