:root {
  /* ── Пространство (база 4px) ─────────────────────────── */
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px; --space-4: 16px;
  --space-6: 24px;  --space-8: 32px;  --space-12: 48px;
  --space-16: 64px; --space-24: 96px;

  /* ── Типографика (шкала ×1.25) ───────────────────────── */
  --font-sans: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --text-xs: 12px;  --text-sm: 14px;  --text-base: 16px; --text-lg: 18px;
  --text-xl: 20px;  --text-2xl: 24px; --text-3xl: 30px;  --text-4xl: 36px; --text-5xl: 48px;
  --leading-tight: 1.15; --leading-snug: 1.3; --leading-normal: 1.5;

  /* ── Цвет (роли) ─────────────────────────────────────── */
  --bg: #ede9f6;
  --surface: #ffffff;
  --surface-sunken: #f4f2fb;
  --border: #e4e0f0;
  --border-strong: #d9d4ea;
  --text: #1e1a2e;
  --text-muted: #4a4563;
  --text-subtle: #605a7a;
  --text-placeholder: #8b86a0;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-active: #5b21b6;
  --accent-fg: #ffffff;
  --accent-soft: #f3eefc;
  --accent-border: #e0d4fa;
  --brand-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #ec4899 100%);
  --danger: #dc2626; --danger-bg: #fceaea;

  /* Фирменный фон входа (космо-градиент) */
  --brand-bg: linear-gradient(135deg, #e8e0f0 0%, #dce4f8 35%, #e8e0f0 65%, #f0dce8 100%);
  --glass-border: rgba(255, 255, 255, 0.6);

  /* ── Радиус / тень / фокус / движение ────────────────── */
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(60, 40, 120, 0.06);
  --shadow-md: 0 4px 16px rgba(100, 80, 160, 0.10);
  --shadow-lg: 0 16px 48px rgba(100, 80, 160, 0.16);
  --focus-ring: 0 0 0 3px rgba(124, 58, 237, 0.35);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur-fast: 150ms; --dur-base: 200ms; --dur-slow: 300ms;
}

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

html,
body {
  height: 100%;
}

body {
  overflow: hidden;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
}

.login-bg {
  position: fixed;
  inset: 0;
  background: var(--brand-bg);
}

.login-page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-ring {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  border: 1px solid rgba(124, 58, 237, 0.06);
  animation: pulse 5s ease-in-out infinite;
}

.ring-large {
  width: 620px;
  height: 620px;
  animation-delay: 1.4s;
}

@keyframes pulse {
  0%,
  100% { opacity: 0.32; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.04); }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}

.login-brand-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  box-shadow: 0 0 28px rgba(124, 58, 237, 0.20);
  font-weight: 700;
}

.login-brand-text {
  font-size: var(--text-2xl);
  font-weight: 600;
}

.login-brand-text span {
  color: var(--accent);
}

.auth-card {
  width: 100%;
  max-width: 430px;
  padding: 38px 34px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.60);
  backdrop-filter: blur(42px) saturate(1.4);
  box-shadow: var(--shadow-lg);
}

.auth-card h1 {
  text-align: center;
  font-size: var(--text-3xl);
  font-weight: 600;
}

.auth-subtitle {
  margin-top: 8px;
  text-align: center;
  color: var(--text-muted);
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 28px;
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(180, 170, 210, 0.20);
  background: rgba(255, 255, 255, 0.45);
}

.auth-tab {
  padding: 11px 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-tab.active {
  background: rgba(124, 58, 237, 0.10);
  color: var(--accent);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-field span {
  color: var(--text-muted);
  font-size: 13px;
}

.auth-field input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(180, 170, 210, 0.25);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.70);
  color: var(--text);
}

.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.auth-btn {
  padding: 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  color: var(--accent-fg);
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 0 28px rgba(124, 58, 237, 0.20);
}

.auth-btn-ghost {
  background: rgba(255, 255, 255, 0.50);
  box-shadow: none;
}

.auth-note {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.auth-error {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  border: 1px solid rgba(220, 38, 38, 0.20);
  color: var(--danger);
  font-size: 13px;
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

@media (max-width: 520px) {
  .auth-card { padding: 28px 20px; }
  .login-ring, .ring-large { width: 380px; height: 380px; }
}

/* Доступность: видимое фокус-кольцо для клавиатуры. UI-RULES §6. */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Доступность: гасим анимации (пульсирующие кольца) при prefers-reduced-motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
