/* Anyx Auth — оформление как на лендинге (login / register) */
/* Шрифт Inter подключается в login.html / register.html */

:root {
  --bg-primary: #050b14;
  --bg-secondary: #0a1220;
  --primary: #2f81f7;
  --primary-dark: #1a6ae8;
  --accent: #00d1ff;
  --text: #ffffff;
  --text-secondary: #b8c5d6;
  --text-tertiary: #7a8a9e;
  --border: rgba(47, 129, 247, 0.15);
  --border-light: rgba(255, 255, 255, 0.08);
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.4);
  --font-mono: 'SF Mono', 'Consolas', 'Monaco', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Фоновые блики как на лендинге */
.auth-bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}
.auth-bg-glow-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(47, 129, 247, 0.25) 0%, transparent 70%);
  top: -200px; left: -100px;
}
.auth-bg-glow-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(0, 209, 255, 0.15) 0%, transparent 70%);
  top: 40%; right: -150px;
}
.auth-bg-glow-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(47, 129, 247, 0.2) 0%, transparent 70%);
  bottom: 10%; left: 20%;
}

/* Шапка в стиле лендинга */
.auth-header-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: var(--spacing-lg) 0;
  background: rgba(5, 11, 20, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
}
.auth-header-bar .auth-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.auth-header-bar .brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  color: inherit;
}
.auth-header-bar .brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, rgba(47, 129, 247, 0.2) 0%, rgba(0, 209, 255, 0.1) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-header-bar .brand-dot {
  width: 12px; height: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(47, 129, 247, 0.3);
}
.auth-header-bar .brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}
.auth-header-bar .auth-nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}
.auth-header-bar .auth-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}
.auth-header-bar .auth-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

/* Основной блок */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px var(--spacing-lg) var(--spacing-2xl);
  position: relative;
  z-index: 1;
}

.auth-panel {
  width: 100%;
  max-width: 440px;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.auth-panel-header {
  padding: var(--spacing-xl);
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}
.auth-panel-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.5px;
}
.auth-panel-header h1 a {
  color: var(--text);
  text-decoration: none;
}
.auth-panel-header h1 a:hover {
  color: var(--text-secondary);
}
.auth-panel-header .subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

.auth-panel-content {
  padding: var(--spacing-xl);
}

.form-group {
  margin-bottom: var(--spacing-lg);
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--spacing-sm);
}
.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.2);
}
.form-group input::placeholder {
  color: var(--text-tertiary);
}
.form-group input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Кнопки как на лендинге (без ripple) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  text-decoration: none;
  font-family: inherit;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-full { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(47, 129, 247, 0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(47, 129, 247, 0.4);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--border-light);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

/* Сообщения */
.message {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: var(--spacing-md);
}
.message.hidden { display: none !important; }
.message.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fecaca;
}
.message.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #bbf7d0;
}

.hint {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: var(--spacing-md);
  text-align: center;
}
.text-link {
  color: var(--primary);
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; }

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: var(--spacing-lg) 0;
  color: var(--text-tertiary);
  font-size: 12px;
}
.oauth-divider::before,
.oauth-divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--border-light);
}

/* Блок Telegram: тёмный фон как на лендинге, чтобы не было белого от виджета */
.telegram-widget-wrap {
  /* Виджет Telegram должен быть в DOM, но не виден пользователю */
  display: none !important;
}
.telegram-widget-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: var(--spacing-sm);
  margin-bottom: 0;
}
.telegram-unavailable-msg {
  margin-bottom: 0;
}

.text-center { text-align: center; }
.mt-2 { margin-top: var(--spacing-md); }

.hidden { display: none !important; }

@media (max-width: 480px) {
  .auth-page {
    padding: 90px var(--spacing-md) var(--spacing-xl);
  }
  .auth-panel-header h1 { font-size: 24px; }
  .auth-panel-content { padding: var(--spacing-lg); }
}
