/* Aurora AI-Vision — компоненты, без glow */

/* Логотип: картинка + текст */
.brand-wordmark,
.landing-nav .brand,
.topbar-brand.brand-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Plus Jakarta Sans', var(--font-sans);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--text);
  transition: filter 0.2s var(--ease), opacity 0.2s var(--ease);
}
.brand-wordmark .brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.brand-wordmark .brand-text {
  background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 35%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-wordmark::before {
  content: none;
}
.landing-nav .brand::before,
.topbar-brand.brand-wordmark::before {
  content: none;
}
.brand-wordmark:hover,
.landing-nav .brand:hover,
.topbar-brand.brand-wordmark:hover {
  filter: brightness(1.15);
  text-decoration: none;
  color: var(--text);
}

.glow-card {
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.glow-card:hover {
  box-shadow: var(--shadow);
  border-color: rgba(255, 255, 255, 0.14);
}

.neon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-weight: 500;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: #fff;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .18s var(--ease), transform .15s var(--ease), box-shadow .18s var(--ease), opacity .18s;
  white-space: nowrap;
}
.neon-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px -3px rgba(59,130,246,.35);
}
.neon-btn:not(.ghost):hover { color: #fff; }
.neon-btn:active { transform: translateY(0); box-shadow: none; opacity: .9; }
.neon-btn:disabled, .neon-btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.neon-btn.ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.neon-btn.ghost:hover {
  background: var(--accent-muted);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
  transform: translateY(-1px);
}

.cosmic-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cosmic-input::placeholder { color: var(--text-muted); }
.cosmic-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-group { margin-bottom: var(--space-5); }

/* ── Auth card ── */
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: var(--space-8) var(--space-8);
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 48px -12px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04);
}
.auth-brand {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: var(--space-6);
}
.auth-brand-logo { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.auth-brand-text {
  font-family: 'Plus Jakarta Sans', var(--font-sans);
  font-weight: 700; font-size: 1.125rem; letter-spacing: -.02em;
  background: linear-gradient(135deg, #f1f5f9 0%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.auth-title {
  font-size: 1.5rem; font-weight: 700; color: var(--text);
  text-align: center; margin-bottom: var(--space-1);
  letter-spacing: -.02em;
}
.auth-subtitle {
  font-size: 0.9375rem; color: var(--text-muted);
  text-align: center; margin-bottom: var(--space-6);
}
.auth-submit-btn {
  width: 100%; justify-content: center;
  padding: var(--space-3) var(--space-5);
  font-size: 0.9375rem; font-weight: 600;
  border-radius: var(--radius);
  margin-top: var(--space-2);
}
.auth-footer {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
}
.auth-footer a { color: var(--text-secondary); transition: color .2s; }
.auth-footer a:hover { color: var(--accent); }
.auth-footer-sep { color: var(--border); }

/* ── Form fields ── */
.form-field { margin-bottom: var(--space-5); }
.form-label {
  display: block; font-size: 0.875rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: var(--space-2);
}
.input-icon-wrap { position: relative; }
.input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.875rem; pointer-events: none;
  z-index: 1;
}
.input-with-icon { padding-left: 40px !important; }
.input-with-icon-right { padding-right: 40px !important; }
.input-toggle-password {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 0.875rem;
  padding: 4px; border-radius: 4px;
  transition: color .15s;
}
.input-toggle-password:hover { color: var(--text); }

/* ── Password strength ── */
.password-strength {
  display: flex; align-items: center; gap: 8px;
  margin-top: var(--space-2); min-height: 18px;
}
.strength-bar {
  flex: 1; height: 3px; border-radius: 2px;
  transition: background .3s;
}
.strength-weak  { background: var(--error); }
.strength-medium { background: var(--warning); }
.strength-strong { background: var(--success); }
.strength-label { font-size: .75rem; color: var(--text-muted); flex-shrink: 0; }

/* ── Error / Success alerts ── */
.form-error,
.form-success {
  display: flex; align-items: flex-start; gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  font-size: 0.875rem;
  border-radius: var(--radius);
}
.form-error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.form-success {
  color: #86efac;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.form-error[hidden],
.form-success[hidden] { display: none; }
.form-error i { color: var(--error); margin-top: 1px; flex-shrink: 0; }
.form-success i { color: var(--success); margin-top: 1px; flex-shrink: 0; }

/* ── Loading button state ── */
.btn-spinner { display: inline-flex; align-items: center; }
.neon-btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

.cosmic-file-wrap input[type="file"] {
  position: absolute;
  width: 0.1px; height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}
.cosmic-file-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  background: var(--surface-solid);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cosmic-file-label:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
  color: var(--text);
}

.aurora-sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 212px;
  padding: var(--space-5) 0 var(--space-4);
  background: rgba(9,11,15,.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  z-index: 50;
}
.aurora-sidebar a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-4);
  margin: 0 var(--space-2);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s;
}
.aurora-sidebar a .sidebar-icon {
  font-size: 1rem; flex-shrink: 0;
  display: inline-block; text-align: center;
  width: 20px;
}
.aurora-sidebar a:hover {
  color: var(--text);
  background: var(--accent-muted);
}
.aurora-sidebar a.active {
  color: var(--accent);
  background: rgba(59,130,246,.1);
  border-color: rgba(59,130,246,.2);
}

.cosmic-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  height: 56px;
  background: rgba(9,11,15,.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  gap: var(--space-4);
  position: sticky; top: 0; z-index: 40;
}
.cosmic-topbar .topbar-brand { text-decoration: none; font-size: 1.0625rem; }
.cosmic-topbar .topbar-brand:hover { text-decoration: none; }
.cosmic-topbar .system-status {
  display: flex; align-items: center; gap: var(--space-5);
  font-size: 0.8125rem; color: var(--text-muted);
}
.cosmic-topbar .system-status .status-item {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums;
  min-width: 80px; justify-content: center;
}
.cosmic-topbar .profile {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: 0.875rem; color: var(--text-secondary);
}
.cosmic-topbar .profile a {
  color: var(--text-secondary); font-size: 0.8125rem;
  padding: 4px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  transition: color .2s, border-color .2s, background .2s;
}
.cosmic-topbar .profile a:hover {
  color: var(--text); border-color: var(--accent); background: var(--accent-muted);
}
.topbar-user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-muted), rgba(139,92,246,.2));
  border: 1px solid rgba(59,130,246,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6875rem; font-weight: 700; color: var(--accent);
  flex-shrink: 0;
}

.status-orb {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background .3s;
}
.status-orb.active {
  background: var(--success);
  box-shadow: 0 0 6px rgba(34,197,94,.5);
  animation: orbPulse 2.5s ease-in-out infinite;
}
.status-orb.warning { background: var(--warning); box-shadow: 0 0 6px rgba(245,158,11,.4); }
.status-orb.error   { background: var(--error);   box-shadow: 0 0 6px rgba(239, 68,68,.4); }
@keyframes orbPulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .6; }
}

.detection-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.detection-box, .detection-overlay .box {
  position: absolute;
  border: 2px solid var(--detection-border);
  box-shadow: 0 0 14px var(--detection-glow);
  border-radius: 4px;
  color: var(--detection-border);
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--detection-bg);
  padding: 2px 6px;
}

.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}
.toast {
  padding: var(--space-4) var(--space-5);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  animation: fade-in-up 0.3s var(--ease-out);
  pointer-events: auto;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--error); }
.toast.info { border-left: 4px solid var(--accent); }

.copyable-block {
  padding: var(--space-4);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  word-break: break-all;
  color: var(--text);
}
.copyable-block .copy-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: var(--space-2); }
.api-key-masked .api-key-value { filter: blur(6px); user-select: none; cursor: pointer; transition: filter 0.2s; }
.api-key-masked.revealed .api-key-value { filter: none; user-select: text; cursor: text; }
.api-key-masked { cursor: pointer; }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* Лимит запросов — кастомный зелёный progress bar */
.quota-progress-track {
  height: 12px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  overflow: hidden;
}
.quota-progress-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #16a34a 0%, var(--success) 50%, #4ade80 100%);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
  transition: width 0.4s var(--ease-out), background 0.3s, box-shadow 0.3s;
  min-width: 0;
}
.quota-progress-fill.quota-fill-warning {
  background: linear-gradient(90deg, #b45309 0%, var(--warning) 50%, #fbbf24 100%);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}
.quota-progress-fill.quota-fill-danger {
  background: linear-gradient(90deg, #b91c1c 0%, var(--error) 50%, #f87171 100%);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}
.neon-btn-success {
  background: var(--success);
  color: #fff;
}
.neon-btn-success:hover {
  background: #16a34a;
  color: #fff;
}

/* Preloader dashboard */
.dashboard-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  transition: opacity 0.4s var(--ease-out), visibility 0.4s;
}
.dashboard-preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.dashboard-preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}
.dashboard-preloader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: dashboard-spin 0.9s linear infinite;
}
.dashboard-preloader-text {
  font-size: 0.9375rem;
  color: var(--text-muted);
}
@keyframes dashboard-spin {
  to { transform: rotate(360deg); }
}
