/* ==========================================================================
   PixelMarket Premium Authentication & Security Gateway Styles (auth.css)
   Ultra-modern animations, glassmorphism, password meter & cyber admin
   ========================================================================== */

/* 1. Viewport & Background Ambient Orbs */
.auth-viewport {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2.5rem 1.25rem;
  overflow-x: hidden;
  background-color: var(--bg-page);
}

.auth-ambient-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  mix-blend-mode: normal;
}

.auth-orb-1 {
  width: 480px;
  height: 480px;
  top: -10%;
  left: -8%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.5) 0%, rgba(14, 165, 233, 0.2) 70%, transparent 100%);
  animation: floatOrb1 18s ease-in-out infinite alternate;
}

.auth-orb-2 {
  width: 540px;
  height: 540px;
  bottom: -15%;
  right: -10%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.45) 0%, rgba(99, 102, 241, 0.25) 70%, transparent 100%);
  animation: floatOrb2 22s ease-in-out infinite alternate;
}

.auth-orb-3 {
  width: 380px;
  height: 380px;
  top: 40%;
  left: 60%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.35) 0%, rgba(16, 185, 129, 0.15) 70%, transparent 100%);
  animation: pulseGlow 12s ease-in-out infinite alternate;
}

[data-theme="dark"] .auth-orb-1 {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, rgba(2, 132, 199, 0.12) 70%, transparent 100%);
}
[data-theme="dark"] .auth-orb-2 {
  background: radial-gradient(circle, rgba(147, 51, 234, 0.3) 0%, rgba(79, 70, 229, 0.15) 70%, transparent 100%);
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(70px, 50px) scale(1.15) rotate(90deg); }
  100% { transform: translate(-30px, 80px) scale(0.95) rotate(180deg); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-60px, -40px) scale(1.12); }
  100% { transform: translate(40px, -70px) scale(0.92); }
}

@keyframes pulseGlow {
  0% { opacity: 0.25; transform: scale(0.9); }
  50% { opacity: 0.55; transform: scale(1.1); }
  100% { opacity: 0.25; transform: scale(0.9); }
}

/* Subtle Matrix Dot Texture */
.auth-grid-texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: radial-gradient(rgba(15, 23, 42, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.6;
}

[data-theme="dark"] .auth-grid-texture {
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
}

/* 2. Top Header & Logo Area */
.auth-header-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text-main);
  letter-spacing: -0.025em;
  transition: transform var(--transition-fast);
}

.auth-brand-logo:hover {
  transform: translateY(-1px);
}

.auth-brand-logo .logo-icon {
  filter: drop-shadow(0 4px 10px rgba(99, 102, 241, 0.3));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-brand-logo:hover .logo-icon {
  transform: scale(1.08) rotate(4deg);
}

/* Theme & Home Action Pill */
.auth-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-action-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-body);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.auth-action-icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.18);
}

/* 3. Main Glassmorphic Auth Card */
.auth-card-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 520px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-2xl);
  padding: 2.25rem 2rem;
  box-shadow: 
    0 20px 40px -15px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(79, 70, 229, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: authCardIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[data-theme="dark"] .auth-card {
  background: rgba(15, 23, 42, 0.84);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

@keyframes authCardIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 4. Segmented Sliding Navigation Tabs */
.auth-tabs-nav {
  display: flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.28rem;
  margin-bottom: 1.75rem;
  position: relative;
}

.auth-tab-link {
  flex: 1;
  text-align: center;
  padding: 0.55rem 0.85rem;
  font-size: 0.865rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-pill);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  user-select: none;
}

.auth-tab-link:hover {
  color: var(--text-main);
}

.auth-tab-link.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .auth-tab-link.active {
  background: rgba(30, 41, 59, 0.95);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Card Titles */
.auth-title-block {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.025em;
  margin-bottom: 0.35rem;
}

.auth-subtitle {
  font-size: 0.885rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

/* 5. Demo Logins Station (Quick Fill) */
.auth-demo-station {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(14, 165, 233, 0.05) 100%);
  border: 1.5px dashed rgba(99, 102, 241, 0.22);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
  transition: border-color var(--transition-fast);
}

.auth-demo-station:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.auth-demo-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.auth-demo-pills {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.auth-demo-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.28rem 0.65rem;
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-body);
  cursor: pointer;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.auth-demo-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.15);
}

.auth-demo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.auth-demo-chip.seller .auth-demo-dot { background: #3b82f6; }
.auth-demo-chip.partner .auth-demo-dot { background: #f59e0b; }
.auth-demo-chip.buyer .auth-demo-dot { background: #10b981; }
.auth-demo-chip.admin .auth-demo-dot { background: #ef4444; }

/* 6. Form Field Enhancements & Prefix Icons */
.auth-field-group {
  margin-bottom: 1.15rem;
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.auth-label {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0;
}

.auth-forgot-link {
  font-size: 0.785rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.auth-forgot-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

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

.auth-input-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s ease;
  z-index: 2;
}

.auth-input {
  width: 100%;
  height: 44px;
  padding-left: 2.5rem;
  padding-right: 2.6rem;
  font-family: var(--font-sans);
  font-size: 0.885rem;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.auth-input:hover {
  border-color: var(--border-hover);
}

.auth-input:focus {
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.auth-input:focus ~ .auth-input-icon,
.auth-input-wrapper:focus-within .auth-input-icon {
  color: var(--primary);
}

/* Password Eye Toggle */
.auth-password-toggle {
  position: absolute;
  right: 0.65rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
  z-index: 2;
}

.auth-password-toggle:hover {
  color: var(--text-main);
}

/* 7. Dual Account Type Selector (Register) */
.auth-role-selector {
  margin-bottom: 1.25rem;
}

.auth-role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.auth-role-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.auth-role-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.auth-role-card.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.18), 0 4px 14px rgba(99, 102, 241, 0.1);
}

.auth-role-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auth-role-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.auth-role-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.auth-role-card.active .auth-role-icon {
  background: var(--primary);
  color: #ffffff;
}

.auth-role-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.2s ease;
}

.auth-role-card.active .auth-role-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.auth-role-title {
  font-size: 0.865rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.auth-role-desc {
  font-size: 0.725rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* 8. Password Strength Meter */
.password-meter-wrap {
  margin-top: 0.45rem;
}

.password-meter-bar {
  height: 4px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
  display: flex;
  gap: 3px;
}

.password-meter-segment {
  flex: 1;
  height: 100%;
  background: var(--border);
  border-radius: var(--radius-pill);
  transition: background-color 0.25s ease;
}

.password-meter-feedback {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.35rem;
  font-size: 0.72rem;
}

.password-strength-label {
  font-weight: 700;
  color: var(--text-muted);
  transition: color 0.25s ease;
}

.password-hint {
  color: var(--text-muted);
}

/* 9. Animated Submit Button */
.auth-submit-btn {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.925rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  margin-top: 1.4rem;
}

.auth-submit-btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

.auth-submit-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
  transition: none;
}

.auth-submit-btn:hover::after {
  left: 140%;
  transition: all 0.75s ease-in-out;
}

/* 10. Card Footer Links */
.auth-card-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-card-footer a {
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

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

/* Secondary Admin Gateway Link */
.auth-admin-gateway-link {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.775rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.auth-admin-gateway-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--bg-surface);
}

/* 11. Dedicated Admin Security Gateway Styles */
.admin-auth-card {
  background: rgba(11, 15, 25, 0.94) !important;
  border: 1px solid rgba(99, 102, 241, 0.35) !important;
  box-shadow: 
    0 25px 60px -10px rgba(0, 0, 0, 0.85),
    0 0 40px -5px rgba(79, 70, 229, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  color: #f8fafc;
}

.admin-auth-card .auth-title {
  color: #ffffff;
}

.admin-auth-card .auth-subtitle {
  color: #94a3b8;
}

.admin-auth-card .auth-input {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

.admin-auth-card .auth-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25);
}

.admin-auth-card .auth-label {
  color: #e2e8f0;
}

.admin-shield-emblem {
  width: 58px;
  height: 58px;
  margin: 0 auto 1.25rem auto;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(14, 165, 233, 0.15) 100%);
  border: 1.5px solid rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
  animation: shieldGlow 3s ease-in-out infinite alternate;
}

@keyframes shieldGlow {
  0% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.4)); }
  100% { transform: scale(1.05); filter: drop-shadow(0 0 16px rgba(14, 165, 233, 0.7)); }
}

/* Cyber Terminal Badges */
.admin-security-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-sec-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.685rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

.admin-sec-badge.live-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: adminDotBlink 1.5s infinite;
}

@keyframes adminDotBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.admin-submit-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #0284c7 100%) !important;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4) !important;
}

.admin-submit-btn:hover {
  box-shadow: 0 6px 24px rgba(14, 165, 233, 0.5) !important;
}

/* Bottom Return Links */
.auth-return-footer {
  margin-top: 2rem;
  text-align: center;
  position: relative;
  z-index: 10;
}

.auth-return-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.auth-return-link:hover {
  color: var(--primary);
}
