/* Traderus design tokens and shared components.
   Loaded after page CSS to keep a single source of truth for themes. */
:root {
  color-scheme: dark;
  --bg: #0e1116;
  --card: #161b22;
  --border: #30363d;
  --control-border: #6e7681;
  --text: #e6edf3;
  --muted: #8b949e;
  --green: #3fb950;
  --red: #f85149;
  --amber: #d29922;
  --link: #58a6ff;
  --pink: #db61a2;
  --ok: #3fb950;
  --bad: #f85149;
  --accent: #1f6feb;
  --input-bg: #0b0f14;
  --radius: 12px;
}
body.light {
  color-scheme: light;
  --bg: #f6f8fa;
  --card: #ffffff;
  --border: #7d8590;
  --control-border: #6e7781;
  --text: #1f2328;
  --muted: #57606a;
  --green: #1a7f37;
  --red: #cf222e;
  --amber: #9a6700;
  --link: #0550ae;
  --pink: #bf3989;
  --ok: #1a7f37;
  --bad: #cf222e;
  --accent: #0969da;
  --input-bg: #ffffff;
}
a { color: var(--link); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* Authentication pages */
body.auth {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 0%, #1f6feb22, transparent 40%), var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body.auth .card {
  width: min(440px, calc(100vw - 32px));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 18px 60px #0008;
}
body.auth h1 { margin: 0 0 6px; font-size: 23px; }
body.auth p, body.auth .sub { color: var(--muted); }
body.auth p { margin: 0 0 14px; }
body.auth label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 5px; }
body.auth input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--control-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 15px;
}
body.auth input:focus { border-color: var(--link); outline: none; box-shadow: 0 0 0 2px #1f6feb33; }
body.auth button {
  width: 100%;
  margin-top: 16px;
  padding: 11px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
body.auth button:disabled { opacity: .6; cursor: wait; }
body.auth button[type="button"] { background: #30363d; color: #fff; border: 1px solid var(--control-border); }
body.light button[type="button"] { background: #eaeef2; color: #1f2328; }
body.auth .error { color: var(--red); min-height: 20px; font-size: 13px; margin-top: 10px; }
body.auth .ok { color: var(--green); min-height: 20px; font-size: 13px; margin-top: 10px; }
body.auth .msg { min-height: 20px; font-size: 13px; margin-top: 10px; }
body.auth .foot { color: var(--muted); font-size: 12px; line-height: 1.55; margin-top: 18px; }
body.auth a:hover { text-decoration-thickness: 2px; }

.auth-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; }
.auth-brand img { width: 30px; height: 30px; border-radius: 8px; }
.auth-brand .auth-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
body.auth .auth-brand button {
  width: 36px; height: 36px; margin: 0 0 0 auto; padding: 0;
  border-radius: 8px; background: #30363d; color: #fff;
  font-size: 18px; line-height: 1; flex: 0 0 auto; color: var(--text);
}
body.light .auth-brand button { background: #eaeef2; color: #1f2328; border: 1px solid var(--control-border); }
body.light .cand-count { background: #ffffff; color: #1f2328; }
body.light .market-status.open { color: #0f5323; }
body.light .market-status.closed { color: #a40e26; }

@media (max-width: 480px) {
  body.auth .card { padding: 22px; }
}

/* Shared dashboard details */
.dashboard input, .dashboard select, .dashboard textarea { border-color: var(--control-border); }
.dashboard button.secondary { border: 1px solid var(--control-border); }
.brandmark { width: 24px; height: 24px; border-radius: 6px; vertical-align: middle; }
.saas-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin: 8px 0 16px; padding-bottom: 8px; }
.saas-tab { background: transparent; border: 1px solid transparent; color: var(--muted); padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.saas-tab:hover { background: #1f6feb14; color: var(--text); }
.saas-tab.active { background: #1f6feb22; color: var(--link); border-color: #1f6feb44; }
.saas-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 8px 0 12px; }
.saas-toolbar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
