/* ============================================================
   SaforaTech — Auth Styles
   Modal | Google Button | User Menu
   ============================================================ */

/* ── Modal Overlay ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeOverlay 0.2s ease;
}

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

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  width: 100%;
  max-width: 440px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  text-align: center;
  margin-bottom: 4px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t);
}

.modal-close:hover {
  background: #EF4444;
  color: #fff;
  border-color: #EF4444;
}

/* ── Auth Tab ────────────────────────────────────────────────── */
.auth-tab { width: 100%; }

.auth-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  text-align: center;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ── Google Button ───────────────────────────────────────────── */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 20px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--t);
}

.btn-google:hover {
  border-color: #4285F4;
  box-shadow: 0 4px 16px rgba(66, 133, 244, 0.15);
  background: var(--bg-card);
}

/* ── Divider ─────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Auth Switch ─────────────────────────────────────────────── */
.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}

.auth-switch a:hover { text-decoration: underline; }

/* ── Auth Messages ───────────────────────────────────────────── */
.auth-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #EF4444;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.auth-success {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #10B981;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

/* ── Password Toggle ─────────────────────────────────────────── */
.pwd-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.5;
  transition: opacity var(--t);
  padding: 4px;
}

.pwd-toggle:hover { opacity: 1; }

/* ── User Menu ───────────────────────────────────────────────── */
.user-menu {
  position: relative;
}

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  transition: all var(--t);
}

.user-avatar-btn:hover {
  border-color: var(--primary);
  background: rgba(0, 87, 255, 0.05);
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 200px;
  box-shadow: var(--shadow-hover);
  z-index: 500;
  overflow: hidden;
  animation: slideUp 0.2s ease;
}

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
  transition: background var(--t);
}

.user-dropdown a:hover {
  background: rgba(0, 87, 255, 0.06);
  color: var(--primary);
}

/* ── Nav Logo ────────────────────────────────────────────────── */
.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo {
  height: 44px;
  width: auto;
  transition: opacity var(--t);
}

.nav-logo:hover { opacity: 0.85; }

/* Dark mode logo filter — invert TECH text */
[data-theme="dark"] {
  --logo-filter: brightness(0) invert(1);
}

[data-theme="dark"] .nav-logo {
  /* Keep gradient colors but brighten TECH text */
  filter: drop-shadow(0 0 8px rgba(0, 212, 170, 0.2));
}

/* ── Loading state for buttons ───────────────────────────────── */
.btn-loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

/* Mobile modal */
@media (max-width: 480px) {
  .modal-box {
    padding: 28px 20px;
    border-radius: var(--radius);
  }
}
