* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #05070f;
  color: #f0f3ff;
  min-height: 100vh;
  overflow-x: hidden;
}

/* NEBULA BACKGROUND */
.nebula-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.star-field {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #fff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 60px 120px, #f0f, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 130px 80px, #0ff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 250px 400px, #ffd, rgba(0,0,0,0));
  background-size: 200px 200px, 300px 300px, 400px 400px, 500px 500px;
  background-repeat: no-repeat;
  opacity: 0.5;
  animation: twinkle 4s infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.3; }
  100% { opacity: 0.8; }
}

.aurora-1 {
  position: absolute;
  top: -30%;
  left: -20%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.3), transparent 70%);
  filter: blur(80px);
  animation: auroraFloat 18s infinite alternate;
}

.aurora-2 {
  position: absolute;
  bottom: -20%;
  right: -15%;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.3), transparent 70%);
  filter: blur(100px);
  animation: auroraFloat 22s infinite alternate-reverse;
}

@keyframes auroraFloat {
  0% { transform: translate(0, 0) scale(1); opacity: 0.4; }
  100% { transform: translate(5%, 3%) scale(1.1); opacity: 0.7; }
}

/* AUTH CONTAINER */
.auth-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  backdrop-filter: blur(4px);
  transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.auth-card {
  background: rgba(12, 18, 34, 0.65);
  backdrop-filter: blur(20px);
  border-radius: 56px;
  padding: 2.4rem 2rem;
  width: 90%;
  max-width: 440px;
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.5), 0 0 0 0.5px rgba(255, 255, 255, 0.05) inset;
  position: relative;
  transition: transform 0.3s;
}

.auth-card:hover {
  transform: scale(1.01);
}

.auth-glow {
  position: absolute;
  inset: -1px;
  border-radius: 56px;
  background: linear-gradient(125deg, rgba(96, 165, 250, 0.3), rgba(168, 85, 247, 0.3));
  filter: blur(20px);
  z-index: -1;
  opacity: 0.5;
}

.logo-symbol {
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 4px;
  color: #a78bfa;
  margin-bottom: 1rem;
}

.auth-card h2 {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #c4b5fd, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 2rem;
}

.auth-card h2 span {
  background: linear-gradient(135deg, #f0abfc, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
}

.input-field {
  position: relative;
  margin-bottom: 1.5rem;
}

.input-field input {
  width: 100%;
  padding: 1rem 1.2rem;
  background: rgba(2, 6, 23, 0.7);
  border: 1.5px solid rgba(139, 92, 246, 0.4);
  border-radius: 48px;
  color: white;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
}

.input-field input:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 1rem;
}

.btn-primary, .btn-secondary {
  padding: 0.9rem;
  border-radius: 48px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
}

.btn-primary {
  background: linear-gradient(95deg, #4f46e5, #7c3aed);
  color: white;
  box-shadow: 0 5px 15px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px #4f46e5;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e6;
  border: 1px solid rgba(139, 92, 246, 0.5);
}

.btn-secondary:hover {
  background: rgba(139, 92, 246, 0.25);
  color: white;
}

.cosmic-note {
  text-align: center;
  font-size: 0.7rem;
  margin-top: 1.6rem;
  color: #6b7280;
}

/* APP DASHBOARD */
.app-dashboard {
  display: none;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.glass-header {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(12px);
  border-radius: 80px;
  padding: 0.8rem 1.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 2.5rem;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 6px #a855f7);
}

.brand-text {
  font-size: 1.7rem;
  font-weight: 800;
  background: linear-gradient(125deg, #e9d5ff, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text span {
  font-weight: 500;
  color: #a78bfa;
  background: none;
  -webkit-background-clip: unset;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 15px;
}

.avatar-ring {
  background: linear-gradient(135deg, #4f46e5, #a855f7);
  padding: 2px;
  border-radius: 50%;
}

.avatar {
  background: #0f172a;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0,0,0,0.4);
  padding: 0.4rem 1.2rem;
  border-radius: 60px;
}

.user-email {
  font-size: 0.85rem;
  color: #cbd5e6;
  font-weight: 500;
}

.logout-neon {
  background: rgba(239, 68, 68, 0.8);
  border: none;
  padding: 6px 14px;
  border-radius: 32px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.logout-neon:hover {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  transform: scale(0.96);
}

/* UPLOAD NEBULA */
.upload-nebula {
  background: rgba(10, 16, 30, 0.6);
  backdrop-filter: blur(12px);
  border-radius: 2rem;
  padding: 1.6rem;
  margin-bottom: 2.5rem;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.drop-constellation {
  border: 2px dashed #7c3aed;
  border-radius: 1.5rem;
  padding: 1.8rem;
  text-align: center;
  background: rgba(79, 70, 229, 0.05);
  transition: 0.2s;
  cursor: pointer;
}

.drop-constellation:hover {
  border-color: #c084fc;
  background: rgba(139, 92, 246, 0.1);
}

.vortex-icon {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
}

.drag-text {
  font-size: 0.9rem;
  color: #a5b4fc;
  margin-bottom: 0.5rem;
}

.or-text {
  font-size: 0.75rem;
  color: #6c7a9e;
}

.file-pulse {
  display: inline-block;
  margin-top: 0.8rem;
  background: linear-gradient(95deg, #4f46e5, #7c3aed);
  padding: 0.5rem 1.2rem;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
}

.file-name-preview {
  margin-top: 0.8rem;
  font-size: 0.75rem;
  color: #c084fc;
}

.btn-upload-cosmic {
  width: 100%;
  margin-top: 1.2rem;
  background: linear-gradient(95deg, #2563eb, #9333ea);
  border: none;
  padding: 1rem;
  border-radius: 60px;
  color: white;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-upload-cosmic:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.5);
}

/* GALLERY GRID COSMIC */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.8rem;
}

.card-cosmic {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 2rem;
  overflow: hidden;
  border: 1px solid rgba(139, 92, 246, 0.4);
  transition: all 0.35s;
}

.card-cosmic:hover {
  transform: translateY(-8px);
  border-color: #c084fc;
  box-shadow: 0 20px 30px -12px black;
}

.card-cosmic img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  transition: transform 0.4s;
}

.card-cosmic:hover img {
  transform: scale(1.03);
}

.card-content {
  padding: 1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.image-title {
  font-weight: 700;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.download-cosmic {
  background: #4f46e5;
  padding: 0.45rem 1rem;
  border-radius: 2rem;
  text-decoration: none;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  transition: 0.2s;
}

.download-cosmic:hover {
  background: #7c3aed;
  padding-right: 1.3rem;
}

.empty-gallery-msg {
  grid-column: 1/-1;
  text-align: center;
  padding: 3rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3rem;
  color: #94a3b8;
}

.loader-cosmic {
  text-align: center;
  padding: 3rem;
  color: #a78bfa;
}

@media (max-width: 720px) {
  .app-dashboard {
    padding: 1rem;
  }
  .glass-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .user-profile {
    justify-content: center;
  }
  .brand-text {
    font-size: 1.3rem;
  }
}