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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --accent: #4f8ef7;
  --accent-hover: #3a7de8;
  --danger: #e55353;
  --text: #e2e4ed;
  --text-muted: #7c8099;
  --success: #3ecf8e;
  --warning: #f5a623;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Карточка авторизации ─────────────────────────────────────── */
.auth-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  gap: 1.5rem;
}

.auth-card .logo {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

.auth-card .logo span { color: var(--accent); }

.auth-card .subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
}

/* ── Кнопки ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }

.btn-google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  padding: 0.7rem 1.6rem;
  font-size: 1rem;
}
.btn-google:hover { background: #f8f9fa; text-decoration: none; }
.btn-google img { width: 20px; height: 20px; }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { opacity: 0.9; }

.btn:disabled, .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Бейдж статуса ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge-idle    { background: #2a2d3a; color: var(--text-muted); }
.badge-connecting { background: #2a3040; color: var(--warning); animation: pulse 1.2s infinite; }
.badge-active  { background: #1a3028; color: var(--success); }
.badge-error   { background: #2e1a1a; color: var(--danger); }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* ── Dashboard ───────────────────────────────────────────────── */
.dashboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 3rem 1.5rem;
  gap: 2rem;
}

.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: center;
}

.dashboard-card h2 { font-size: 1.3rem; font-weight: 600; }
.dashboard-card .email { color: var(--text-muted); font-size: 0.9rem; }
.dashboard-card .latency { color: var(--text-muted); font-size: 0.85rem; }

/* ── Permissions banner ───────────────────────────────────────── */
.permissions-banner {
  background: #2a2010;
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
  color: var(--warning);
  text-align: left;
  width: 100%;
  max-width: 420px;
}
.permissions-banner ul { margin: 0.5rem 0 0 1.2rem; }

/* ── Сообщение об ошибке ─────────────────────────────────────── */
.error-msg {
  color: var(--danger);
  font-size: 0.9rem;
}
