/* ---- Auth Modals ---- */
.auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.auth-overlay.active {
  display: flex;
}

.auth-modal {
  background: #13151f;
  border: 1px solid #2a2d3e;
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  position: relative;
  animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #666;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.auth-modal-close:hover { color: #fff; }

.auth-modal h2 {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.auth-modal p {
  color: #7a8aaa;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.auth-form { display: flex; flex-direction: column; gap: 12px; }

.auth-field { display: flex; flex-direction: column; gap: 4px; }
.auth-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #8a8faa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.auth-field input {
  background: #0b0d13;
  border: 1px solid #2a2d3e;
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.auth-field input:focus {
  border-color: #4a6cf7;
}

.auth-btn {
  background: #4a6cf7;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
  margin-top: 4px;
}
.auth-btn:hover { background: #3b5de6; }
.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #2a2d3e;
}
.auth-divider span {
  color: #666;
  font-size: 0.78rem;
  font-weight: 600;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #0b0d13;
  border: 1px solid #2a2d3e;
  border-radius: 8px;
  padding: 10px 16px;
  color: #ccc;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  width: 100%;
}
.auth-social-btn:hover {
  border-color: #4a6cf7;
  color: #fff;
}

.auth-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 0.82rem;
  color: #666;
}
.auth-footer a {
  color: #4a6cf7;
  text-decoration: none;
  cursor: pointer;
}
.auth-footer a:hover { text-decoration: underline; }

.auth-error {
  background: rgba(255, 60, 60, 0.1);
  border: 1px solid rgba(255, 60, 60, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  color: #ff6b6b;
  font-size: 0.82rem;
  display: none;
}
.auth-error.visible { display: block; }

.auth-success {
  background: rgba(60, 255, 120, 0.1);
  border: 1px solid rgba(60, 255, 120, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  color: #6bffa0;
  font-size: 0.82rem;
  display: none;
}
.auth-success.visible { display: block; }

/* ---- User Menu ---- */
.user-menu {
  position: relative;
  margin-left: auto;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  color: #ccc;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s;
}
.user-menu-trigger:hover {
  border-color: #2a2d3e;
  background: #13151f;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #4a6cf7;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #13151f;
  border: 1px solid #2a2d3e;
  border-radius: 10px;
  min-width: 180px;
  padding: 6px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.user-menu-dropdown.open { display: block; }

.user-menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 6px;
  color: #ccc;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s;
}
.user-menu-item:hover {
  background: #1e2030;
  color: #fff;
}
.user-menu-item.danger { color: #ff6b6b; }
.user-menu-item.danger:hover { background: rgba(255, 60, 60, 0.1); }

.user-menu-divider {
  height: 1px;
  background: #2a2d3e;
  margin: 4px 0;
}

/* ---- Upgrade Modal ---- */
.upgrade-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.plan-card {
  background: #0b0d13;
  border: 2px solid #2a2d3e;
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.plan-card:hover { border-color: #4a6cf7; }
.plan-card.recommended { border-color: #4a6cf7; position: relative; }
.plan-card.recommended::before {
  content: 'Best value';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #4a6cf7;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
  text-transform: uppercase;
}

.plan-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.plan-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: #4a6cf7;
}
.plan-price span {
  font-size: 0.8rem;
  font-weight: 500;
  color: #666;
}
.plan-savings {
  font-size: 0.78rem;
  color: #6bffa0;
  font-weight: 600;
  margin-top: 4px;
}

/* ---- Premium Badge ---- */
.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #4a6cf7, #7c3aed);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Login Prompt (inline, for not-logged-in state) ---- */
.login-prompt-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid #2a2d3e;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  color: #4a6cf7;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s;
}
.login-prompt-btn:hover {
  border-color: #4a6cf7;
  background: rgba(74, 108, 247, 0.08);
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .auth-modal { padding: 1.5rem; }
  .upgrade-plans { grid-template-columns: 1fr; }
}
