/* Painel UazAPI — estilos mínimos, sem framework */

* { box-sizing: border-box; }

:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #0b1220;
  --border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #25d366;
  --primary-hover: #1fb957;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --secondary: #3b82f6;
  --secondary-hover: #2563eb;
  --connected: #22c55e;
  --connecting: #f59e0b;
  --disconnected: #64748b;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

h1, h2 { margin: 0 0 0.5rem; font-weight: 600; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.125rem; }

/* ---- Login ---- */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.login-card .subtitle {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
}

.login-card label {
  display: block;
  margin-bottom: 1rem;
}

.login-card label span {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
  color: var(--text-muted);
}

.login-card input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
}

.login-card input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}

/* ---- Dashboard ---- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.logout-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-chip {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.25rem 0.625rem;
  background: var(--bg-input);
  border-radius: 99px;
}

.dashboard {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.status-pill {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.375rem 0.75rem;
  border-radius: 99px;
  background: var(--bg-input);
}
.status-connected { background: var(--connected); color: #052e10; }
.status-connecting { background: var(--connecting); color: #422006; }
.status-disconnected { background: var(--disconnected); color: #f1f5f9; }
.status-unknown, .status-loading { background: var(--bg-input); color: var(--text-muted); }

.profile-info { margin-bottom: 1rem; }
.profile-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.375rem 0;
  font-size: 0.9375rem;
}
.profile-row .label {
  color: var(--text-muted);
  min-width: 130px;
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ---- Botoes ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  background: var(--bg-input);
  color: var(--text);
}
.btn:hover { background: #1a2334; }
.btn-primary { background: var(--primary); color: #052e10; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: var(--secondary-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-full { width: 100%; }

/* ---- Alerts ---- */

.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}
.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

/* ---- QR / Pair ---- */

.qr-wrap {
  display: flex;
  justify-content: center;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  margin: 1rem 0;
}
.qr-wrap img {
  max-width: 280px;
  height: auto;
}

.inline-form {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}
.inline-form input {
  flex: 1;
  padding: 0.625rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
}

.pair-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-input);
  border-radius: 8px;
  margin: 1rem 0;
}

.hint {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0.5rem 0 0;
}

code {
  background: var(--bg-input);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.875em;
}
