/* ============================================================
   Public shell — home / auth / error pages.
   Same navy + glass design language as the dashboard (.cx-dash).
   Scoped under .pub-* so it never bleeds into the dashboard shell.
   ============================================================ */

/* ---- Action color = BLUE in BOTH themes ----
   DesignPack ships a gold `--color-primary` in dark mode; the house rule is
   that clickable actions stay blue (gold is reserved for accents). This loads
   after DesignPack on every page, so .btn-primary is blue everywhere. */
/* House action color = DARK BLUE in BOTH themes (more readable; no light blue). */
:root,
[data-theme="light"],
[data-theme="dark"] {
  --color-primary:        #1D4ED8;
  --color-primary-hover:  #1B44BD;
  --color-primary-active: #17399C;
  --color-primary-light:  rgba(29, 78, 216, 0.16);
  --color-primary-muted:  rgba(29, 78, 216, 0.12);
}

/* Neutralise DesignPack's body flex for public pages only */
body:has(.pub-shell) { display: block; margin: 0; min-height: 100vh; }

/* ---------------- Tokens (dark default) ---------------- */
.pub-shell {
  --bg:        #040918;
  --bg-2:      #0b1a3e;
  --glass:     rgba(12, 26, 62, 0.55);
  --border:    rgba(255, 255, 255, 0.08);
  --border-2:  rgba(255, 255, 255, 0.14);
  --text:      #eef2fb;
  --text-dim:  #aab4cf;
  --text-muted:#6f7a99;
  --accent:    #6a8cff;
  --accent-2:  #9eb3ff;
  --accent-soft: rgba(106, 140, 255, 0.16);
  --accent-line: rgba(106, 140, 255, 0.35);
  --radius:    14px;

  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* Flat, like the rest of the app: no gradients anywhere. */
  background: var(--bg);
}
.pub-shell * { box-sizing: border-box; }
.pub-shell a { text-decoration: none; color: inherit; }

/* ---------------- Nav ---------------- */
.pub-nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(4, 9, 24, 0.55);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.pub-nav-inner {
  max-width: 1120px; margin: 0 auto;
  height: 62px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.pub-nav-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text); }
/* No radius: the mark is Kido on transparency, not a square tile — there are
   no corners left to round. */
.pub-nav-actions { display: inline-flex; align-items: center; gap: 12px; }
.pub-nav-link { font-size: 14px; font-weight: 500; color: var(--text-dim); }
.pub-nav-link:hover { color: var(--text); }
.pub-icon-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--text-dim);
  background: rgba(11, 20, 42, 0.55);
  border: 1px solid rgba(96, 165, 250, 0.12);
  transition: border-color .16s, color .16s;
}
.pub-icon-btn:hover { color: var(--text); border-color: rgba(96, 165, 250, 0.30); }

/* ---------------- Main ---------------- */
.pub-main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 64px 24px 72px; }

/* ---------------- Hero ---------------- */
.pub-hero { text-align: center; max-width: 760px; margin: 0 auto 64px; }
.pub-hero-badge {
  display: inline-block; font-family: 'Montserrat', sans-serif; font-size: 11px;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--accent-2);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 22px;
}
.pub-hero-title {
  font-size: clamp(34px, 6vw, 56px); font-weight: 800; letter-spacing: -0.03em; margin: 0 0 16px;
  color: var(--text);
}
.pub-hero-sub { font-size: 16px; line-height: 1.65; color: var(--text-dim); margin: 0 auto 30px; max-width: 600px; }
.pub-hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------------- Features ---------------- */
.pub-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pub-feature {
  padding: 24px; background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius); backdrop-filter: blur(12px); transition: border-color .24s, transform .24s;
}
.pub-feature:hover { border-color: var(--border-2); transform: translateY(-2px); }
.pub-feature-ic {
  width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px; color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid var(--border-2);
}
.pub-feature h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px; color: var(--text); }
.pub-feature p { font-size: 13.5px; line-height: 1.6; color: var(--text-dim); margin: 0; }
.pub-feature code { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--accent-2); }

/* ---------------- Footer ---------------- */
.pub-foot { border-top: 1px solid var(--border); }
.pub-foot-inner {
  max-width: 1120px; margin: 0 auto; padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.pub-foot-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--text); }
.pub-foot-copy { font-size: 12.5px; color: var(--text-muted); }

/* ---------------- Auth (centered card) ---------------- */
.pub-auth { align-items: center; justify-content: center; padding: 40px 20px; }
.pub-auth-card { width: 100%; max-width: 400px; }
.pub-auth-brand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 22px;
}
.pub-auth-foot { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 18px; }
.pub-card {
  background: var(--glass); border: 1px solid var(--border); border-radius: 16px;
  backdrop-filter: blur(14px); padding: 28px;
}
.pub-card h1 { font-size: 20px; font-weight: 700; margin: 0 0 4px; color: var(--text); }
.pub-card-sub { font-size: 13.5px; color: var(--text-dim); margin: 0 0 22px; }
.pub-form-row { margin-bottom: 16px; }
.pub-form-row label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 7px; }
.pub-input {
  width: 100%; padding: 11px 13px; font-size: 14px; color: var(--text);
  background: rgba(4, 9, 24, 0.55); border: 1px solid var(--border-2); border-radius: 9px;
  outline: none; transition: border-color .16s, background .16s; font-family: inherit;
}
.pub-input::placeholder { color: var(--text-muted); }
.pub-input:focus { border-color: var(--accent-line); background: rgba(4, 9, 24, 0.78); }
.pub-form-error {
  font-size: 13px; color: #fca5a5; background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.30); border-radius: 9px; padding: 10px 12px; margin-bottom: 16px;
}
.pub-form-foot { text-align: center; font-size: 13px; color: var(--text-dim); margin-top: 18px; }
.pub-form-foot a { color: var(--accent-2); font-weight: 600; }
.pub-block { width: 100%; }

/* ---------------- Home hero: feature chips + vertical centering ---------------- */
.rv-hero { margin-bottom: 0; }
body:has(.rv-hero) .pub-main { display: flex; align-items: center; }
.rv-hero-points {
  list-style: none; padding: 0; margin: 34px auto 0; max-width: 680px;
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
}
.rv-hero-points li {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 500; color: var(--text);
  background: var(--glass); border: 1px solid var(--border-2);
  padding: 10px 16px; border-radius: 999px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color .2s, transform .2s;
}
.rv-hero-points li:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.rv-hero-points i { color: var(--accent-2); font-size: 14px; }

/* ---------------- Error pages ---------------- */
.pub-error { text-align: center; max-width: 480px; margin: 40px auto; padding: 60px 24px; }
.pub-error-code {
  font-family: "JetBrains Mono", monospace; font-size: 80px; font-weight: 700; line-height: 1; margin: 0;
  color: var(--accent-2);
}
.pub-error h1 { font-size: 22px; font-weight: 700; margin: 18px 0 8px; color: var(--text); }
.pub-error p { font-size: 14px; color: var(--text-dim); margin: 0 0 26px; }

/* ============================================================
   LIGHT THEME
   ============================================================ */
[data-theme="light"] body:has(.pub-shell) { background: #f5f7fb; }
[data-theme="light"] .pub-shell {
  --bg:        #f5f7fb;
  --bg-2:      #eaf0fc;
  --glass:     rgba(255, 255, 255, 0.66);
  --border:    rgba(13, 25, 60, 0.08);
  --border-2:  rgba(13, 25, 60, 0.14);
  --text:      #0d1530;
  --text-dim:  #4a5578;
  --text-muted:#7b8499;
  --accent:    #4d6ce8;
  --accent-2:  #2b46c0;
  --accent-soft: rgba(77, 108, 232, 0.10);
  --accent-line: rgba(77, 108, 232, 0.30);
  background: #f5f7fb;
}
[data-theme="light"] .pub-nav { background: rgba(255, 255, 255, 0.62); }
/* The hero title is `var(--text)` in both themes now — nothing to override. */
[data-theme="light"] .pub-icon-btn {
  background: #ffffff; border: 1px solid rgba(59, 130, 246, 0.12);
}
[data-theme="light"] .pub-input { background: rgba(255, 255, 255, 0.85); }
[data-theme="light"] .pub-input:focus { background: #ffffff; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 760px) {
  .pub-main { padding: 40px 18px 56px; }
  .pub-features { grid-template-columns: 1fr; }
  .pub-hero { margin-bottom: 44px; }
  .pub-nav-inner { padding: 0 16px; }
  .pub-nav-link { display: none; }
}
