:root {
  --bg-main: #0c0a14;
  --bg-card: rgba(23, 19, 36, 0.72);
  --bg-card-border: rgba(220, 180, 254, 0.16);
  --bg-input: rgba(16, 13, 27, 0.65);
  --input-border: rgba(220, 180, 254, 0.22);
  --input-border-focus: #d8b4fe;
  --text-primary: #fdf2f8;
  --text-secondary: #c4b5fd;
  --text-muted: #9488a7;

  /* Pastel Pink & Purple accents */
  --pastel-pink: #f472b6;
  --pastel-purple: #c084fc;
  --pastel-lavender: #d8b4fe;
  --pastel-pink-soft: #fbcfe8;

  --gradient-accent: linear-gradient(135deg, #f472b6 0%, #c084fc 50%, #a855f7 100%);
  --glow-pink: rgba(244, 114, 182, 0.35);
  --glow-purple: rgba(192, 132, 252, 0.35);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  padding: 20px;
}

/* Ambient Pastel Glow Orbs */
.ambient-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.42;
  animation: float 14s ease-in-out infinite alternate;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #f472b6, #ec4899 40%, transparent 70%);
  top: -60px;
  right: -80px;
}

.orb-2 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #c084fc, #9333ea 40%, transparent 70%);
  bottom: -100px;
  left: -100px;
  animation-delay: -5s;
}

.orb-3 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #fda4af, #d8b4fe 50%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.25;
  animation-duration: 18s;
}

@keyframes float {
  0% {
    transform: translate(0px, 0px) scale(1);
  }
  50% {
    transform: translate(25px, -30px) scale(1.05);
  }
  100% {
    transform: translate(-20px, 25px) scale(0.95);
  }
}

/* Subtle geometric grid layer */
.grid-pattern {
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(rgba(216, 180, 254, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

/* Login Container */
.login-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
}

/* Back link */
.nav-back {
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-back:hover {
  color: var(--pastel-pink);
  transform: translateX(-3px);
}

.nav-back svg {
  width: 16px;
  height: 16px;
}

.nav-logo {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  object-fit: cover;
  opacity: 0.85;
  flex-shrink: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-back:hover .nav-logo {
  opacity: 1;
  transform: scale(1.05);
}

/* Card */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--bg-card-border);
  border-radius: 24px;
  padding: 44px 36px 40px;
  box-shadow: 
    0 20px 50px -10px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  box-shadow: 
    0 24px 60px -10px rgba(0, 0, 0, 0.55),
    0 0 28px -4px var(--glow-purple),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-color: rgba(220, 180, 254, 0.28);
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 32px;
}

.badge-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.18), rgba(192, 132, 252, 0.18));
  border: 1px solid rgba(244, 114, 182, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px -4px var(--glow-pink);
}

.badge-icon svg {
  width: 28px;
  height: 28px;
  color: var(--pastel-pink);
  filter: drop-shadow(0 2px 6px rgba(244, 114, 182, 0.4));
}

.title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 30%, var(--pastel-pink-soft) 70%, var(--pastel-lavender) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group-password {
  margin-bottom: 28px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.input-icon svg {
  width: 18px;
  height: 18px;
}

.form-input {
  width: 100%;
  height: 48px;
  background: var(--bg-input);
  border: 1px solid var(--input-border);
  border-radius: 14px;
  padding: 0 42px 0 42px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-input::placeholder {
  color: rgba(148, 136, 167, 0.6);
}

.form-input:focus {
  background: rgba(22, 17, 37, 0.9);
  border-color: var(--input-border-focus);
  box-shadow: 
    0 0 0 3px rgba(216, 180, 254, 0.2),
    0 0 16px -2px rgba(244, 114, 182, 0.25);
}

.input-wrapper:focus-within .input-icon {
  color: var(--pastel-pink);
}

/* Toggle Password Button */
.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.2s, background-color 0.2s;
}

.toggle-password:hover {
  color: var(--pastel-lavender);
  background: rgba(255, 255, 255, 0.06);
}

.toggle-password svg {
  width: 18px;
  height: 18px;
}

/* Submit Button */
.submit-btn {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 14px;
  background: var(--gradient-accent);
  color: #12091c;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 
    0 10px 24px -4px var(--glow-pink),
    0 4px 12px -2px var(--glow-purple);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, filter 0.2s;
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: 0.6s;
}

.submit-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 
    0 14px 30px -4px rgba(244, 114, 182, 0.55),
    0 6px 18px -2px rgba(192, 132, 252, 0.45);
}

.submit-btn:hover::before {
  left: 100%;
}

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

.submit-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.submit-btn:hover svg {
  transform: translateX(3px);
}

/* Card Shake on Error */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.card.shake {
  animation: shake 0.4s ease-in-out;
}

/* Текст внизу формы */
.card-footer {
  margin-top: 26px;
  text-align: center;
  font-size: 13px;
  color: #9488a7; /* Приглушенный вторичный цвет */
}

/* Пастельно-розовая ссылка */
.card-footer a {
  color: #f472b6; /* Пастельно-розовый акцент */
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
  transition: color 0.2s ease;
}

/* Эффект при наведении */
.card-footer a:hover {
  color: #fbcfe8; /* Нежно-розовый при наведении */
  text-decoration: underline;
}

/* Notification / Toast */
.toast {
  position: fixed;
  bottom: 24px;
  background: rgba(30, 24, 48, 0.95);
  border: 1px solid var(--pastel-purple);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px var(--glow-purple);
  color: #fff;
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 24px rgba(239, 68, 68, 0.35);
}

.toast.error .toast-icon {
  color: #f87171;
}

.toast-icon {
  color: var(--pastel-pink);
  display: flex;
  align-items: center;
}

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

/* Auth Switcher Tabs */
.auth-tabs {
  display: flex;
  background: rgba(16, 13, 27, 0.7);
  border: 1px solid rgba(220, 180, 254, 0.16);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.auth-tab-btn.active {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--glow-purple);
}
