/* BARKR TR8 — shared styles for login, register, and account pages.
   The dashboard (index.php) keeps its own inline styles; these tokens match. */

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

:root {
  --bg:       #0d0d0d;
  --surface:  #181818;
  --surface2: #222;
  --border:   #2a2a2a;
  --text:     #e0e0e0;
  --muted:    #777;
  --blue:     #3b82f6;
  --green:    #22c55e;
  --yellow:   #eab308;
  --red:      #ef4444;
  --orange:   #f97316;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--blue); }

/* ── Centred auth card (login / register) ─────────────────────────────────── */
body.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.card-auth {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
}
.card-auth h1 { font-size: 1.6rem; margin-bottom: 0.25rem; color: #fff; }
.subtitle { color: var(--muted); font-size: 0.85rem; margin-bottom: 1.75rem; }

/* ── Page shell (account) ─────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  flex-wrap: wrap;
}
.topbar h1 { font-size: 1.15rem; color: #fff; flex: 1; }
.navlink { color: var(--muted); font-size: 0.85rem; text-decoration: none; }
.navlink:hover { color: var(--text); }
.navlink.danger:hover { color: var(--red); }

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}
.card h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.85rem;
}
.card p.help { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.9rem; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
label { display: block; font-size: 0.85rem; color: #aaa; margin-bottom: 0.35rem; }
input[type=text], input[type=password], input[type=email] {
  width: 100%;
  background: #111;
  border: 1px solid #444;
  border-radius: 6px;
  color: var(--text);
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  margin-bottom: 1rem;
  outline: none;
  transition: border-color 0.15s;
}
input:focus { border-color: var(--blue); }
input::placeholder { color: #4a4a4a; }
.field-hint { color: var(--muted); font-size: 0.75rem; margin: -0.75rem 0 1rem; }

button, .btn {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.7rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
button:hover { background: #2563eb; }
button.full { width: 100%; }
button.secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
button.secondary:hover { background: #2c2c2c; }
button.danger { background: #7f1d1d; color: #fca5a5; }
button.danger:hover { background: #991b1b; }
button.small { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

.form-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end; }
.form-row > div { flex: 1; min-width: 160px; }
.form-row input { margin-bottom: 0; }

/* ── Messages ─────────────────────────────────────────────────────────────── */
.error, .success {
  border-radius: 6px;
  font-size: 0.85rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 1rem;
}
.error   { background: #3b1010; border: 1px solid #7a2020; color: #ff7070; }
.success { background: #0f2e1b; border: 1px solid #1c5c37; color: #6ee7a0; }

.hint { color: var(--muted); font-size: 0.8rem; text-align: center; margin-top: 1.25rem; }

/* ── Device list ──────────────────────────────────────────────────────────── */
.device-list { display: flex; flex-direction: column; gap: 0.6rem; }
.device-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface2);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  flex-wrap: wrap;
}
.device-row .name { font-weight: 600; color: #fff; }
.device-row .meta { color: var(--muted); font-size: 0.78rem; font-family: ui-monospace, monospace; }
.device-row .spacer { flex: 1; }
.device-row form { display: inline; }

.pill {
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.pill-online  { background: #14532d; color: var(--green); }
.pill-offline { background: #3b1010; color: var(--red); }
.pill-stale   { background: #3a2c0c; color: var(--yellow); }
.pill-never   { background: var(--surface2); color: var(--muted); }
.pill-role    { background: #1e293b; color: #93c5fd; }

code.share {
  display: inline-block;
  background: #111;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--orange);
}
