@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #07071a;
  --bg-secondary: #0e0e2a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --purple-main: #8b5cf6;
  --purple-light: #a78bfa;
  --blue-accent: #3b82f6;
  --gradient-main: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 50%, #3b82f6 100%);
  --gradient-text: linear-gradient(135deg, #a78bfa, #60a5fa);
  --gradient-btn: linear-gradient(135deg, #8b5cf6, #3b82f6);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(139, 92, 246, 0.2);
  --border-hover: rgba(139, 92, 246, 0.5);
  --shadow-purple: 0 0 30px rgba(139, 92, 246, 0.3);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-btn: 0 4px 20px rgba(139, 92, 246, 0.4);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(109,40,217,0.2) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(59,130,246,0.15) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Auth Container */
.auth-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  background: rgba(14, 14, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 480px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card), var(--shadow-purple);
  animation: fadeInUp 0.6s ease;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo img {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 2px solid var(--purple-main);
  box-shadow: 0 0 20px rgba(139,92,246,0.5);
  margin-bottom: 0.75rem;
}

.auth-logo-title {
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  font-size: 1.3rem;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-logo-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Tabs */
.auth-tabs {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 2rem;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.auth-tab.active {
  background: var(--gradient-btn);
  color: white;
  box-shadow: var(--shadow-btn);
}

/* Form */
.auth-form { display: none; }
.auth-form.active { display: block; }

.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--purple-main);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
  background: rgba(255,255,255,0.07);
}

.form-input::placeholder { color: var(--text-muted); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-error {
  font-size: 0.8rem;
  color: #f87171;
  margin-top: 0.5rem;
  display: none;
}

.form-error.show { display: block; }

.password-wrapper { position: relative; }

.password-toggle {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
}

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

/* Submit btn */
.auth-submit {
  width: 100%;
  padding: 14px;
  background: var(--gradient-btn);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-btn);
  margin-top: 1.5rem;
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139,92,246,0.6);
}

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

/* Alert */
.auth-alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}

.auth-alert.show { display: block; }
.auth-alert.error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.auth-alert.success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }

/* Back to store */
.auth-back {
  text-align: center;
  margin-top: 1.5rem;
}

.auth-back a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-back a:hover { color: var(--purple-light); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@media (max-width: 500px) {
  body {
    align-items: flex-start;
  }
  .auth-wrapper {
    padding: 1rem;
    align-items: flex-start;
  }
  .auth-card {
    padding: 1.5rem 1rem;
    border-radius: var(--radius-lg);
  }
  .auth-logo {
    margin-bottom: 1.5rem;
  }
  .auth-logo img {
    width: 58px;
    height: 58px;
  }
  .form-row { grid-template-columns: 1fr; }
  .form-input,
  .auth-submit,
  .auth-tab {
    min-height: 44px;
  }
}
