/* ============================================================
   NEXORA AUTHENTICATION GATE & MULTI-USER PORTAL STYLES
   Obsidian Dark Minimalist Aesthetic + Smooth Animations
   ============================================================ */

:root {
  --nx-auth-bg: #070709;
  --nx-auth-card: rgba(16, 16, 20, 0.88);
  --nx-auth-border: rgba(255, 255, 255, 0.08);
  --nx-auth-border-hover: rgba(255, 255, 255, 0.15);
  --nx-auth-text: #fafafa;
  --nx-auth-muted: #9ca3af;
  --nx-auth-cyan: #22d3ee;
  --nx-auth-indigo: #818cf8;
  --nx-auth-violet: #a855f7;
  --nx-auth-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nx-auth-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

body.nexora-auth-locked {
  overflow: hidden !important;
}

body.nexora-auth-locked #nexora-ai-fab,
body.nexora-auth-locked #nexora-ai-drawer {
  display: none !important;
}

/* Main Fullscreen Overlay */
#nexora-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200000;
  background-color: var(--nx-auth-bg);
  background-image:
    radial-gradient(circle at 50% -10%, rgba(56, 189, 248, 0.09) 0%, rgba(168, 85, 247, 0.06) 35%, transparent 68%),
    radial-gradient(circle at 85% 90%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 15% 85%, rgba(34, 211, 238, 0.04) 0%, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: "Geist Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--nx-auth-text);
  opacity: 1;
  transition: opacity 0.45s var(--nx-auth-ease), transform 0.45s var(--nx-auth-ease);
  overflow-y: auto;
}

#nexora-auth-overlay.nx-auth-hiding {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

/* Subtle Ambient Grid */
#nexora-auth-overlay::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 45%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, black 20%, transparent 75%);
  pointer-events: none;
}

/* Auth Card Container */
.nx-auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--nx-auth-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--nx-auth-border);
  border-radius: 24px;
  padding: 36px 32px 30px;
  box-shadow:
    0 30px 60px -12px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
  animation: nxCardEntrance 0.65s var(--nx-auth-spring) both;
  overflow: hidden;
}

/* Top Subtle Shine Line on Card */
.nx-auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.4), rgba(168, 85, 247, 0.4), transparent);
  pointer-events: none;
}

@keyframes nxCardEntrance {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================================
   ANIMATED NEXORA LOGO SHOWCASE
   ============================================================ */
.nx-logo-stage {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 1. Breathing Ambient Backglow */
.nx-logo-ambient {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.32) 0%, rgba(168, 85, 247, 0.26) 50%, transparent 75%);
  filter: blur(16px);
  animation: nxAmbientBreathe 4.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes nxAmbientBreathe {
  0%, 100% {
    transform: scale(0.92);
    opacity: 0.65;
  }
  50% {
    transform: scale(1.14);
    opacity: 1;
  }
}

/* 2. Outer Delicate Orbital Ring */
.nx-logo-orbit-outer {
  position: absolute;
  inset: 0;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: nxOrbitSlow 12s linear infinite;
  pointer-events: none;
}

.nx-logo-orbit-outer::before,
.nx-logo-orbit-outer::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.nx-logo-orbit-outer::before {
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  background: #38bdf8;
  box-shadow: 0 0 12px 2px #38bdf8;
}

.nx-logo-orbit-outer::after {
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  background: #c084fc;
  box-shadow: 0 0 12px 2px #c084fc;
}

@keyframes nxOrbitSlow {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 3. Counter-Rotating Secondary Aura Ring */
.nx-logo-orbit-inner {
  position: absolute;
  inset: 9px;
  border-radius: 28px;
  border: 1px dashed rgba(129, 140, 248, 0.16);
  animation: nxOrbitReverse 16s linear infinite;
  pointer-events: none;
}

@keyframes nxOrbitReverse {
  0% {
    transform: rotate(360deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

/* 4. Conic Gradient Halo Border Around Squircle */
.nx-logo-halo-wrap {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 22px;
  padding: 2px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
  animation: nxLogoFloat 4.5s ease-in-out infinite;
}

.nx-logo-halo-spinner {
  position: absolute;
  width: 160%;
  height: 160%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    #22d3ee 65deg,
    #818cf8 140deg,
    #c084fc 210deg,
    transparent 280deg,
    transparent 360deg
  );
  animation: nxOrbitSlow 4.2s linear infinite;
}

@keyframes nxLogoFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-3.5px);
  }
}

/* 5. Inner Logo Squircle */
.nx-logo-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: #0b0b10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.nx-logo-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  user-select: none;
  -webkit-user-drag: none;
}

/* Brand Header Titles */
.nx-auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.nx-auth-title {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin: 0 0 6px;
}

.nx-auth-subtitle {
  font-size: 13.5px;
  color: var(--nx-auth-muted);
  margin: 0;
  line-height: 1.45;
}

/* ============================================================
   SEGMENTED PILL SWITCHER (INICIAR SESION / CREAR CUENTA)
   ============================================================ */
.nx-auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
}

.nx-auth-tab-Compile-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.36s var(--nx-auth-spring);
  pointer-events: none;
}

.nx-auth-tabs[data-mode="register"] .nx-auth-tab-Compile-pill {
  transform: translateX(100%);
}

.nx-auth-tab-btn {
  position: relative;
  z-index: 1;
  background: transparent;
  border: none;
  color: var(--nx-auth-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.25s ease;
  font-family: inherit;
}

.nx-auth-tab-btn.active {
  color: #ffffff;
  font-weight: 600;
}

/* ============================================================
   FORM FIELDS & INPUT ANIMATIONS
   ============================================================ */
.nx-auth-view {
  animation: nxViewFadeIn 0.35s var(--nx-auth-spring) both;
}

@keyframes nxViewFadeIn {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.nx-auth-field {
  margin-bottom: 14px;
}

.nx-auth-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: #d4d4d8;
  margin-bottom: 6px;
}

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

.nx-auth-input-icon {
  position: absolute;
  left: 13px;
  color: #71717a;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: color 0.22s ease, transform 0.22s ease;
}

.nx-auth-input {
  width: 100%;
  height: 43px;
  padding: 0 38px 0 40px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  color: #ffffff;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition:
    border-color 0.25s var(--nx-auth-ease),
    background-color 0.25s var(--nx-auth-ease),
    box-shadow 0.25s var(--nx-auth-ease);
}

.nx-auth-input::placeholder {
  color: #52525b;
}

.nx-auth-input:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.048);
}

.nx-auth-input:focus {
  border-color: rgba(129, 140, 248, 0.65);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.nx-auth-input-wrap:focus-within .nx-auth-input-icon {
  color: #818cf8;
  transform: scale(1.06);
}

.nx-auth-eye-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: #71717a;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.nx-auth-eye-btn:hover {
  color: #e4e4e7;
  background: rgba(255, 255, 255, 0.06);
}

/* Row: Remember Session + Forgot Password */
.nx-auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 18px;
  font-size: 12.5px;
}

.nx-auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #a1a1aa;
  cursor: pointer;
  user-select: none;
}

.nx-auth-remember input {
  accent-color: #818cf8;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.nx-auth-link-btn {
  background: transparent;
  border: none;
  color: #a1a1aa;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.nx-auth-link-btn:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Submit Primary Button */
.nx-auth-submit-btn {
  position: relative;
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 11px;
  background: #ffffff;
  color: #09090b;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.12);
  transition:
    transform 0.22s var(--nx-auth-spring),
    box-shadow 0.22s var(--nx-auth-spring),
    background-color 0.2s ease,
    opacity 0.2s ease;
}

.nx-auth-submit-btn:hover:not(:disabled) {
  background: #f4f4f5;
  transform: translateY(-1.5px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2);
}

.nx-auth-submit-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}

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

/* Secondary Subtle Button */
.nx-auth-secondary-btn {
  width: 100%;
  height: 40px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  color: #d4d4d8;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s var(--nx-auth-ease);
}

.nx-auth-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
}

/* Error & Info Banners */
.nx-auth-alert {
  padding: 11px 14px;
  border-radius: 11px;
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: nxViewFadeIn 0.25s var(--nx-auth-spring) both;
}

.nx-auth-alert.error {
  background: rgba(239, 68, 68, 0.11);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #fca5a5;
}

.nx-auth-alert.success {
  background: rgba(34, 197, 94, 0.11);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: #86efac;
}

.nx-auth-alert.info {
  background: rgba(56, 189, 248, 0.09);
  border: 1px solid rgba(56, 189, 248, 0.24);
  color: #bae6fd;
}

/* Password Recovery Notice Box */
.nx-recovery-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px 16px;
  margin-bottom: 16px;
  text-align: center;
}

.nx-recovery-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(129, 140, 248, 0.28);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nx-recovery-card h4 {
  margin: 0 0 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: #ffffff;
}

.nx-recovery-card p {
  margin: 0;
  font-size: 12.8px;
  color: #a1a1aa;
  line-height: 1.55;
}

/* Blocked Account Screen */
.nx-blocked-badge {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  margin: 0 auto 16px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.32);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.2);
}

/* Footer Dev Link */
.nx-auth-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: #71717a;
}

.nx-auth-dev-link {
  color: #71717a;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nx-auth-dev-link:hover {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.08);
}

@media (max-width: 480px) {
  .nx-auth-card {
    padding: 28px 22px 24px;
    border-radius: 20px;
  }
}
