/* ============================================================
   MarketShri (AURA AI) - Authentication & Profile CSS
   Institutional Cyberpunk Dark Terminal Aesthetic
============================================================ */

/* --- Top Header Auth Trigger Button --- */
.header-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(99, 102, 241, 0.2) 100%);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.1);
}

.header-auth-btn:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(99, 102, 241, 0.35) 100%);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

/* --- Top Header Logged-in Profile Pill --- */
.header-profile-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.header-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 4px 10px 4px 4px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.header-profile-pill:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(30, 41, 59, 0.9);
}

.auth-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.auth-user-name {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-role-pill {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.auth-role-pill.badge-admin {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.auth-role-pill.badge-user {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* --- Profile Dropdown Menu --- */
.auth-profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: none;
  flex-direction: column;
  z-index: 1000;
  animation: authFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-profile-dropdown.active {
  display: flex;
}

.auth-dropdown-header {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.auth-dropdown-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.auth-dropdown-email {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.auth-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.auth-dropdown-item.item-admin {
  color: #a78bfa;
  font-weight: 600;
}

.auth-dropdown-item.item-admin:hover {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
}

.auth-dropdown-item.item-logout {
  color: #f87171;
}

.auth-dropdown-item.item-logout:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

/* --- Auth Modal Overlay --- */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.auth-modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.auth-modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, #0d1527 0%, #070b14 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85), 0 0 40px rgba(56, 189, 248, 0.08);
  padding: 32px;
  animation: authScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.auth-modal-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  height: 160px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.2) 0%, rgba(99, 102, 241, 0) 70%);
  pointer-events: none;
}

.auth-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.auth-modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  transform: rotate(90deg);
}

.auth-modal-header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}

.auth-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
  margin-top: 6px;
}

.auth-modal-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

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

.auth-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.auth-tab-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Error Banner */
.auth-error-banner {
  display: none;
  align-items: center;
  gap: 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  margin-bottom: 20px;
  line-height: 1.4;
}

/* Forms */
.auth-form-group {
  margin-bottom: 18px;
}

.auth-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  color: #64748b;
  font-size: 13px;
  pointer-events: none;
}

.auth-input {
  width: 100%;
  background: rgba(7, 11, 20, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 14px 10px 38px;
  font-size: 13px;
  color: #ffffff;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.auth-input:focus {
  border-color: #38bdf8;
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.auth-input::placeholder {
  color: #475569;
}

.auth-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.auth-submit-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-switch-text {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 20px;
}

.auth-switch-link {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

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

/* Floating Toast */
.auth-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  transform: translateY(10px);
  transition: all 0.25s ease;
}

.auth-toast.active {
  display: flex;
  transform: translateY(0);
}

.auth-toast-success {
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.auth-toast-info {
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

/* Keyframes */
@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes authScaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================================
   FULLSCREEN LOGIN & REGISTRATION PAGE (#auth-screen)
============================================================ */

/* Hide dashboard container until body is marked authenticated */
body:not(.authenticated) .app-container {
  display: none !important;
}

body.authenticated #auth-screen {
  display: none !important;
}

.auth-fullscreen-container {
  min-height: 100vh;
  width: 100%;
  background: #070B12;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  overflow-x: hidden;
  z-index: 1000;
}

.auth-fullscreen-glow-1 {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 350px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, rgba(99, 102, 241, 0.05) 50%, transparent 80%);
  filter: blur(80px);
  pointer-events: none;
}

.auth-fullscreen-glow-2 {
  position: absolute;
  bottom: 10%;
  right: 15%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  filter: blur(100px);
  pointer-events: none;
}

.auth-fullscreen-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-fullscreen-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 28px;
  width: 100%;
}

.auth-logo-hero-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px;
  margin-bottom: 12px;
}

.auth-logo-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: 80px;
  background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.28) 0%, rgba(56, 189, 248, 0.2) 40%, rgba(99, 102, 241, 0) 75%);
  filter: blur(24px);
  pointer-events: none;
  animation: auraPulse 4s ease-in-out infinite alternate;
}

@keyframes auraPulse {
  0% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

.auth-logo-link {
  position: relative;
  z-index: 2;
  display: inline-block;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-logo-link:hover {
  transform: scale(1.03);
}

.auth-brand-logo-main {
  height: 64px;
  width: auto;
  max-width: 290px;
  object-fit: contain;
  filter: drop-shadow(0 6px 22px rgba(16, 185, 129, 0.42)) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.9));
  display: block;
}

/* Sleek High-Tech AI Chip */
.auth-ai-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(13, 22, 38, 0.95) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #38bdf8;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(56, 189, 248, 0.12), inset 0 0 10px rgba(56, 189, 248, 0.08);
  backdrop-filter: blur(12px);
  margin-bottom: 14px;
  font-family: var(--font-mono, monospace);
  text-transform: uppercase;
}

.auth-ai-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981, 0 0 14px #10b981;
  display: inline-block;
  animation: aiDotBlink 2s ease-in-out infinite;
}

@keyframes aiDotBlink {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.85);
  }
}

.auth-fullscreen-title {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin: 0 0 8px 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.auth-fullscreen-subtitle {
  font-size: 13px;
  color: #94a3b8;
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.5;
}

.auth-fullscreen-card {
  width: 100%;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(7, 11, 20, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 40px rgba(56, 189, 248, 0.06);
  backdrop-filter: blur(20px);
}

.demo-fill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.demo-fill-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.auth-back-link {
  font-size: 12px;
  color: #94a3b8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.auth-back-link:hover {
  color: #38bdf8;
}

.auth-fullscreen-footnote {
  margin-top: 24px;
  font-size: 11px;
  color: #64748b;
  text-align: center;
}
