:root {
  --accent: #d36cff;
  --accent-2: #ff7ed1;
  --accent-soft: #ffb6e6;
  --text: #f4eaff;
  --muted: #b9a8d2;
  --muted-2: #7d7196;
  --card: rgba(22, 14, 34, 0.72);
  --line: rgba(255, 255, 255, 0.08);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100vh;
  background: #08040f;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.aura {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.aura::before {
  content: "";
  width: 46vmin; height: 46vmin;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(211,108,255,0.55) 0%, rgba(255,126,209,0.28) 38%, rgba(211,108,255,0.08) 60%, transparent 75%);
  filter: blur(20px);
  transform: translateY(-12vh);
  animation: heartbeat 2.4s ease-in-out infinite;
}
@keyframes heartbeat {
  0%   { transform: translateY(-12vh) scale(0.92); opacity: 0.78; }
  18%  { transform: translateY(-12vh) scale(1.08); opacity: 1; }
  32%  { transform: translateY(-12vh) scale(0.98); opacity: 0.86; }
  48%  { transform: translateY(-12vh) scale(1.04); opacity: 0.95; }
  100% { transform: translateY(-12vh) scale(0.92); opacity: 0.78; }
}
@media (prefers-reduced-motion: reduce) { .aura::before { animation: none; } }

.auth {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; padding: 24px;
}
.auth-logo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.auth-name { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 26px; letter-spacing: 0.22em; text-align: center; text-shadow: 0 0 24px rgba(211,108,255,0.5); }

.auth-card {
  position: relative;
  width: 100%; max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px 24px 24px;
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  animation: card-in 0.4s cubic-bezier(0.22,0.61,0.36,1) both;
}
.auth-card.hidden { display: none; }
@keyframes card-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.auth-title { font-weight: 800; font-size: 22px; margin: 0 0 4px; }
.auth-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; line-height: 1.4; }

.auth-email { display: flex; align-items: center; gap: 10px; }
.auth-email input {
  flex: 1; min-width: 0;
  background: rgba(12,7,22,0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--text); font-size: 14px; font-family: inherit;
  outline: none; transition: border-color 0.2s ease;
}
.auth-email input:focus { border-color: var(--accent); }
.auth-email input::placeholder { color: var(--muted-2); }
.auth-go {
  flex: 0 0 44px; width: 44px; height: 44px;
  border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, #ff7ed1, #d36cff);
  color: #1a0a2b;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.18s ease, filter 0.2s ease;
}
.auth-go svg { width: 18px; height: 18px; }
.auth-go:active { transform: scale(0.92); }

.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted-2); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-tg {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  background: rgba(12,7,22,0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.18s ease;
}
.auth-tg:hover { border-color: var(--accent); background: rgba(36,20,54,0.7); }
.auth-tg:active { transform: scale(0.99); }
.tg-ico { width: 26px; height: 26px; color: var(--accent-soft); display: inline-flex; flex: 0 0 26px; }
.tg-ico svg { width: 100%; height: 100%; }
.tg-txt { flex: 1; text-align: left; }
.tg-arrow { width: 18px; height: 18px; color: var(--muted); display: inline-flex; }
.tg-arrow svg { width: 100%; height: 100%; }

.auth-back {
  position: absolute; top: 16px; left: 16px;
  width: 30px; height: 30px; border-radius: 999px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line);
  color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.auth-back svg { width: 15px; height: 15px; }

.auth-tg-open {
  display: block; text-align: center;
  background: linear-gradient(135deg, #ff7ed1 0%, #d36cff 50%, #9a3fd1 100%);
  color: #1a0a2b; font-weight: 700; font-size: 14px;
  border-radius: 12px; padding: 13px; text-decoration: none;
  box-shadow: 0 8px 22px rgba(211,108,255,0.3);
}
.auth-wait { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 13px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.12); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.code-inputs { display: flex; gap: 8px; margin-top: 6px; }
.code-inputs input {
  flex: 1; width: 0; aspect-ratio: 1;
  background: rgba(12,7,22,0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center; font-size: 22px; font-weight: 700; color: var(--text);
  outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.code-inputs input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(211,108,255,0.15); }
.code-resend { margin-top: 16px; text-align: center; color: var(--muted); font-size: 12.5px; }
.code-resend b { color: var(--accent-soft); }

.auth-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(10px);
  background: rgba(20,12,32,0.95); border: 1px solid var(--line);
  padding: 11px 18px; border-radius: 12px; font-size: 13.5px; color: var(--text);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease; z-index: 10;
}
.auth-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
