/* PromptRisk — global design system */
:root {
  --bg: #0b1020;
  --bg-soft: #111733;
  --panel: #ffffff;
  --ink: #0d1330;
  --ink-soft: #4a5170;
  --muted: #8a90a8;
  --line: #e6e9f2;
  --brand: #4f46e5;
  --brand-2: #06b6d4;
  --brand-ink: #c7d2fe;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(8, 15, 40, .08);

  --safe: #16a34a;
  --low: #65a30d;
  --moderate: #d97706;
  --high: #ea580c;
  --critical: #dc2626;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #f6f8fc;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; color: var(--ink); }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid transparent; border-radius: 10px; padding: 11px 20px;
  font-size: .95rem; font-weight: 600; cursor: pointer; transition: all .15s; text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #4338ca; text-decoration: none; color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #eef1f8; text-decoration: none; }
.btn-light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.btn-light:hover { background: rgba(255,255,255,.2); color:#fff; text-decoration:none; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-danger:hover { background: #fecaca; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* Public header */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(11,16,32,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.15rem; color: #fff; }
.logo:hover { text-decoration: none; }
.logo .mark { color: var(--brand-2); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: #c8cce0; font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: #fff; text-decoration: none; }

/* Hero / sections */
.hero { background: radial-gradient(1200px 500px at 70% -10%, #1c2550 0%, var(--bg) 55%); color: #fff; padding: 92px 0 80px; }
.hero h1 { font-size: 3rem; margin: 0 0 18px; letter-spacing: -.02em; }
.hero p.lead { font-size: 1.2rem; color: #b9c0dc; max-width: 620px; margin: 0 0 30px; }
.eyebrow { display:inline-block; font-size:.8rem; letter-spacing:.12em; text-transform:uppercase; color: var(--brand-2); font-weight:700; margin-bottom:14px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.section { padding: 72px 0; }
.section.alt { background: #fff; }
.section h2 { font-size: 2rem; margin: 0 0 12px; }
.section .sub { color: var(--ink-soft); font-size: 1.05rem; max-width: 640px; margin: 0 0 40px; }

/* Cards / grids */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card h3 { margin: 8px 0 8px; font-size: 1.15rem; }
.card p { color: var(--ink-soft); margin: 0; font-size: .96rem; }
.card .ic { font-size: 1.4rem; color: var(--brand); }

/* Risk bands */
.bands { display: flex; flex-wrap: wrap; gap: 10px; }
.band { flex: 1; min-width: 120px; border-radius: 10px; padding: 14px; color: #fff; }
.band b { display: block; font-size: 1.3rem; }
.band span { font-size: .8rem; opacity: .92; }
.b-safe { background: var(--safe); } .b-low { background: var(--low); }
.b-moderate { background: var(--moderate); } .b-high { background: var(--high); } .b-critical { background: var(--critical); }

/* Badges */
.badge { display:inline-block; padding:3px 10px; border-radius:20px; font-size:.72rem; font-weight:800; text-transform:uppercase; letter-spacing:.03em; }
.r-safe { background:#dcfce7; color:#15803d; } .r-low { background:#ecfccb; color:#4d7c0f; }
.r-moderate { background:#fef3c7; color:#b45309; } .r-high { background:#ffedd5; color:#c2410c; } .r-critical { background:#fee2e2; color:#b91c1c; }

/* Footer */
.site-footer { background: var(--bg); color: #aeb4d0; padding: 48px 0; font-size: .92rem; }
.site-footer .cols { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 30px; }
.site-footer a { color: #c8cce0; }
.site-footer .muted { color: #6b7299; }

/* Forms */
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: .98rem; background: #fff; color: var(--ink);
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.auth-wrap { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.alert-error { background:#fee2e2; color:#b91c1c; border-radius:10px; padding:10px 13px; font-size:.88rem; margin-bottom:14px; }
.alert-ok { background:#dcfce7; color:#15803d; border-radius:10px; padding:10px 13px; font-size:.88rem; margin-bottom:14px; }

/* App shell */
.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.app-side { background: var(--bg); color: #c8cce0; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.app-side .logo { font-size: 1.05rem; margin-bottom: 26px; padding: 0 8px; }
.app-main { padding: 32px 36px; background: #f6f8fc; }
.app-main h1 { font-size: 1.7rem; margin: 0 0 6px; }
.app-main .page-sub { color: var(--ink-soft); margin: 0 0 26px; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; color: #aeb4d0; font-weight: 500; font-size: .94rem; cursor: pointer; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.side-link.active { background: var(--brand); color: #fff; }
.side-foot { position: absolute; bottom: 16px; left: 14px; right: 14px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; }
.side-user { font-size: .82rem; color: #8a90a8; padding: 0 8px 8px; word-break: break-all; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; background:#fff; border:1px solid var(--line); border-radius: var(--radius); overflow:hidden; }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tbl thead th { background: #f1f4fb; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tbl tr:last-child td { border-bottom: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.code-block { background:#0d1330; color:#d6dcff; padding:16px; border-radius:12px; font-family: ui-monospace, Menlo, monospace; font-size:.85rem; overflow-x:auto; white-space:pre; }

.stat-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-bottom: 26px; }
.stat { background:#fff; border:1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat .n { font-size: 1.8rem; font-weight: 800; }
.stat .l { color: var(--muted); font-size: .85rem; }

@media (max-width: 860px) {
  .grid-3, .grid-2, .stat-row, .stat-row { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.2rem; }
  .app-shell { grid-template-columns: 1fr; }
  .app-side { position: static; height: auto; }
  .nav-links a:not(.btn) { display: none; }
}
