/* ------------------------------------------------------------
   AutoACP5 shared theme — tokens, base, header/footer components.
   Source of truth for the site palette (taken from the demo-video
   design). Load AFTER public.css: the legacy variable aliases below
   repaint public.css components without touching their rules.
   Public pages are dark-only; nothing sets data-theme on them.
   ------------------------------------------------------------ */

:root {
  color-scheme: dark;

  --bg: #0B0E16;
  --panel: #10141F;
  --panel-2: #0D1119;      /* inputs / inset surfaces */
  --panel-3: #0A0D14;      /* table headers / recessed */
  --text: #F5F7FB;
  --muted: #94A0B8;
  --muted-2: #6C7890;      /* dimmest legible text */
  --accent: #4C82F7;
  --accent-hover: #3E6FE0;
  --accent-soft: rgba(76, 130, 247, 0.10);
  --border: rgba(255, 255, 255, 0.08);
  --border-hard: rgba(255, 255, 255, 0.16);
  --glow: rgba(58, 78, 134, 0.28);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --topbar-bg: rgba(11, 14, 22, 0.78);

  /* Legacy aliases — variable names public.css / older pages use.
     They reference the tokens above, so they flip with the theme. */
  --primary: var(--accent);
  --primary-dark: var(--accent-hover);
  --primary-soft: var(--accent-soft);
  --background: var(--bg);
  --card-background: var(--panel);
  --bg-card: var(--panel);
  --bg-input: var(--panel-2);
  --bg-muted: var(--panel-3);
  --text-primary: var(--text);
  --text-secondary: var(--muted);
  --text-muted: var(--muted-2);
  --border-color: var(--border);
  --border-strong: var(--border-hard);
  --nav-bg: var(--topbar-bg);
  --row-border: var(--border);
}

/* Light tokens reserved for the logged-in dashboard theme toggle
   (future pass). Public pages never set data-theme, so they always
   render with the dark :root tokens above. */
[data-theme="light"] {
  color-scheme: light;

  --bg: #F7F8FB;
  --panel: #FFFFFF;
  --panel-2: #F2F4F9;
  --panel-3: #EBEEF5;
  --text: #101423;
  --muted: #5A6478;
  --muted-2: #7A8498;
  --accent: #3E6FE0;
  --accent-hover: #2F5BC4;
  --accent-soft: rgba(62, 111, 224, 0.10);
  --border: rgba(16, 20, 35, 0.10);
  --border-hard: rgba(16, 20, 35, 0.20);
  --glow: rgba(76, 130, 247, 0.10);
  --shadow: 0 18px 44px rgba(16, 20, 35, 0.10);
  --topbar-bg: rgba(247, 248, 251, 0.78);
}

/* ------------------------------------------------------------
   Base
   ------------------------------------------------------------ */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  background-image: radial-gradient(60% 55% at 50% 34%, var(--glow) 0%, transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  transition: background-color .2s, color .2s;
  -webkit-font-smoothing: antialiased;
}

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

/* ------------------------------------------------------------
   Topbar (injected by js/layout.js)
   ------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 28px;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.topbar .nav { display: flex; align-items: center; gap: 4px; }
.topbar .nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  padding: 7px 12px;
  border-radius: 8px;
}
.topbar .nav a:hover { color: var(--text); text-decoration: none; }
.topbar .nav .nav-login {
  color: var(--text);
  border: 1px solid var(--border-hard);
  margin-left: 8px;
}
.topbar .nav .nav-login:hover { border-color: var(--accent); color: var(--accent); }

.nav-burger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
}

@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  .nav-burger { display: inline-flex; }
  .topbar .nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }
  .topbar .nav.open { display: flex; }
  .topbar .nav a { padding: 12px; }
  .topbar .nav .nav-login { margin-left: 0; text-align: center; }
}

/* ------------------------------------------------------------
   Buttons / panels
   ------------------------------------------------------------ */
.btn-accent {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  padding: 14px 32px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background .15s ease;
}
.btn-accent:hover { background: var(--accent-hover); text-decoration: none; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

/* ------------------------------------------------------------
   Footer (injected by js/layout.js)
   ------------------------------------------------------------ */
.footer {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  padding: 36px 24px 44px;
  text-align: center;
}
.footer .footer-brand { font-weight: 700; font-size: 16px; color: var(--text); }
.footer .footer-tag { color: var(--muted); font-size: 14px; margin-top: 6px; }
.footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  margin: 20px 0 18px;
}
.footer .footer-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.footer .footer-links a:hover { color: var(--text); }
.footer .footer-legal { color: var(--muted-2); font-size: 13px; }
.footer .footer-legal a { color: var(--muted-2); }
