:root {
  --bg-color: #0b0d19;
  --card-bg: rgba(17, 20, 38, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --accent-primary: #6366f1; /* Indigo */
  --accent-secondary: #a855f7; /* Purple */
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-border: rgba(255, 255, 255, 0.1);
  --error-color: #ef4444;
  --success-color: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Background Glows */
.glow-blob {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  opacity: 0.35;
  pointer-events: none;
}

.blob-1 {
  background: var(--accent-primary);
  top: -10%;
  left: -10%;
  animation: float-slow 20s infinite alternate;
}

.blob-2 {
  background: var(--accent-secondary);
  bottom: -10%;
  right: -10%;
  animation: float-slow 25s infinite alternate-reverse;
}

@keyframes float-slow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 30px) scale(1.1); }
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 450px;
  padding: 20px;
  z-index: 10;
}

/* Glassmorphic Card */
.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  padding: 40px 30px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
  box-shadow: 0 25px 60px rgba(99, 102, 241, 0.15);
}

.brand {
  text-align: center;
  margin-bottom: 30px;
}

.brand h1 {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-main), #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.brand p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 6px;
}

/* Tab Controls */
.tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 30px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  position: relative;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px 0;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.3s ease;
  z-index: 2;
}

.tab-btn.active {
  color: var(--text-main);
}

.tab-slider {
  position: absolute;
  top: 5px;
  left: 5px;
  width: calc(50% - 5px);
  height: calc(100% - 10px);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 8px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* Form Fields */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

/* Dynamic Signup Fields Transition */
.signup-only {
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  margin-bottom: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin-bottom 0.35s ease;
  overflow: hidden;
}

.signup-mode .signup-only {
  max-height: 100px;
  opacity: 1;
  visibility: visible;
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.form-group input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text-main);
  font-size: 0.95rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Button */
.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  border-radius: 12px;
  color: white;
  padding: 16px 0;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  margin-top: 10px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 25px rgba(99, 102, 241, 0.3);
}

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

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: none;
  animation: fadeIn 0.3s ease;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #a7f3d0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Profile / Dashboard View */
.dashboard-card {
  display: none;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  padding: 40px;
  text-align: center;
}

.avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.dashboard-card h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.dashboard-card .email {
  color: var(--text-muted);
  margin-bottom: 30px;
  font-size: 0.95rem;
}

.meta-list {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 30px;
  text-align: left;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}

.meta-item:last-child {
  border-bottom: none;
}

.meta-label {
  color: var(--text-muted);
}

.logout-btn {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: var(--text-main);
  padding: 14px 0;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}
