/* Tally Remote: shared look for the camera grid, dashboard, sign-in and admin pages (from the dashboard mockup) */
:root {
  /* Defaults. The server adds the WordPress site's palette and fonts after this file
     (lib/brand.js), so these only show until the first sync. Astra slot in brackets. */
  --accent: #dd183b;        /* Brand (1): buttons, highlights */
  --accent-hover: #cc1939;  /* Alt Brand (2) */
  --heading: #ffffff;       /* Heading (3): headings, logo "Tally", button text */
  --fg: #c3c9d8;            /* Text (4) */
  --bg: #0f1117;            /* Primary BG (5) */
  --surface: #171a23;       /* Secondary BG (6): cards */
  --border: #262b38;        /* Border (7) */
  --surface2: #13161e;      /* Subtle BG (8): inputs, inner panels */
  --success: #22c55e;       /* Extra 1 (9): connected, saved */
  --warn: #f5a524;          /* Extra 2 (10): trial, warnings */
  --font-body: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  --font-head: var(--font-body);

  /* Tally colours: fixed on purpose, never taken from the website */
  --program: #e0001b; --program-glow: rgba(224,0,27,.16);
  --preview: #00b140; --preview-glow: rgba(0,177,64,.15);

  /* Worked out from the above */
  --on-accent: var(--heading);
  --fg-muted: color-mix(in srgb, var(--fg) 72%, var(--bg));
  --fg-dim: color-mix(in srgb, var(--fg) 45%, var(--bg));
  --accent-glow: color-mix(in srgb, var(--accent) 15%, transparent);
  --success-dim: color-mix(in srgb, var(--success) 12%, transparent);
  --warn-dim: color-mix(in srgb, var(--warn) 12%, transparent);
  --blue: #4a90d9; --blue-dim: rgba(74,144,217,.12); /* links to camera pages, info */
  --radius: 10px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--fg); min-height: 100vh;
  font: 14px/1.5 var(--font-body);
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
h1, h2, h3, .card-title { font-family: var(--font-head); color: var(--heading); }
[hidden] { display: none !important; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* Brand */
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-logo { display: block; height: 42px; width: auto; max-width: 100%; }
.brand-icon { width: 36px; height: 36px; border-radius: 5px; background: var(--accent); flex: none; }
.brand-icon svg { display: block; width: 100%; height: 100%; }
.brand-icon .ring { fill: #fce7eb; } /* logo artwork: fixed */
.brand-icon .core { fill: #000; }
.brand-name { font: 600 21px/1 "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; letter-spacing: -.2px; color: var(--heading); }
.brand-name span { color: var(--accent); }
.brand-sub { font: 400 11.5px/1 "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; color: var(--fg-muted); letter-spacing: .035em; text-transform: uppercase; margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px;
  border-radius: var(--radius); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap; text-decoration: none; transition: opacity .12s, background .12s;
}
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); opacity: 1; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-ghost { background: transparent; color: var(--fg-muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--fg); background: var(--surface2); opacity: 1; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { color: var(--accent); }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--fg-muted); white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-dim); flex: none; }
.dot.live { background: var(--success); box-shadow: 0 0 0 2px var(--success-dim); }
.dot.warn { background: var(--warn); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-title { font-size: 13.5px; font-weight: 600; }
.card-desc { font-size: 12px; color: var(--fg-muted); margin-top: 1px; }
.card-body { padding: 16px 18px; }
.section-title { font-size: 12px; font-weight: 600; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .07em; margin: 0 0 12px; }

/* Banners */
.banner { border: 1px solid; border-radius: var(--radius); padding: 11px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; font-weight: 500; }
.banner span { flex: 1; min-width: 180px; }
.banner.warn { background: var(--warn-dim); border-color: var(--warn); color: var(--warn); }
.banner.info { background: var(--blue-dim); border-color: var(--blue); color: var(--blue); }

/* Forms */
.field-label { font-size: 12px; font-weight: 600; color: var(--fg-muted); margin-bottom: 5px; display: block; }
.input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; padding: 9px 12px;
  font: inherit; font-size: 14px; color: var(--fg);
}
.input:focus { outline: none; border-color: var(--blue); }
.url { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--blue); background: var(--blue-dim); padding: 3px 8px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 100%; vertical-align: middle; }

/* State tags */
.tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.tag.program { background: var(--program-glow); color: var(--program); }
.tag.preview { background: var(--preview-glow); color: var(--preview); }
.tag.clear, .tag.idle { background: var(--surface2); color: var(--fg-dim); }

/* Toast */
.toast {
  position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 18px;
  font-size: 13px; font-weight: 600; box-shadow: 0 8px 32px rgba(0,0,0,.35); opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s; z-index: 200; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--accent); color: var(--accent); }
