/* CivilDesign AI — single stylesheet, no external resources.
   "Blueprint" identity: navy ink + paper + one disciplined cyan accent,
   safety-orange reserved strictly for warning badges. */
:root {
  --navy: #0b1220;
  --navy-2: #101a2e;
  --navy-3: #16233a;
  --ink: #1c2733;
  --paper: #f7f8fa;
  --card: #ffffff;
  --line: #dde3ea;
  --accent: #2ec5e0;       /* blueprint cyan */
  --accent-ink: #0b6e80;   /* accessible cyan for text on paper */
  --safety: #f59e0b;       /* safety orange — warnings only */
  --ok: #1e7d43;
  --warn: #9a6700;
  --err: #b3261e;
  --muted: #5b6877;
  --shadow: 0 1px 2px rgba(11, 18, 32, 0.06), 0 8px 24px rgba(11, 18, 32, 0.07);
  --shadow-hover: 0 4px 10px rgba(11, 18, 32, 0.08), 0 16px 32px rgba(11, 18, 32, 0.12);
  --grid-line: rgba(255, 255, 255, 0.06);
  --grid-line-paper: rgba(11, 18, 32, 0.05);
  --radius: 12px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.15; color: var(--navy); letter-spacing: -0.01em; font-weight: 700; }
h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { max-width: 62ch; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1080px; margin: 0 auto; padding: 2.5rem 1.25rem 4.5rem; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* blueprint grid texture, used on hero / navy bands */
.blueprint-grid {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* header / nav */
.site-header {
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-inner {
  max-width: 1080px; margin: 0 auto; padding: 0.75rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 1.15rem; font-weight: 700; color: #fff; letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark { display: block; border-radius: 6px; flex: none; }
.brand .accent { color: var(--accent); }
.site-header nav { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.site-header nav a { color: #c7d4e3; font-weight: 500; font-size: 0.94rem; }
.site-header nav a:hover { color: #fff; text-decoration: none; }
.btn-nav {
  background: var(--accent); color: var(--navy) !important;
  padding: 0.45rem 1rem; border-radius: 7px; font-weight: 700;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn-nav:hover { background: #58d6ec; text-decoration: none; }
.nav-user { color: #8394a9; font-size: 0.85rem; }
.nav-logout { display: inline; }
.nav-logout button {
  background: none; border: none; color: #c7d4e3; cursor: pointer;
  font: inherit; padding: 0; text-decoration: underline;
}
.nav-logout button:hover { color: #fff; }

/* footer */
.site-footer {
  background: var(--navy);
  color: #97a7bc;
  padding: 2rem 1.25rem;
}
.site-footer .footer-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 0.4rem 1.5rem;
  font-size: 0.88rem;
}
.site-footer a { color: #c7d4e3; }
.site-footer .footer-line-2 { width: 100%; color: #6c7d93; font-size: 0.82rem; }

/* buttons */
.btn, button[type="submit"], button {
  display: inline-block; background: var(--navy-3); color: #fff;
  border: 1px solid transparent; border-radius: 8px; padding: 0.6rem 1.2rem;
  font: inherit; font-weight: 600; cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}
.btn:hover, button[type="submit"]:hover, button:hover { background: var(--navy); text-decoration: none; }
.btn:active, button[type="submit"]:active, button:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--navy); }
.btn-primary:hover { background: #58d6ec; }
.btn-small { padding: 0.3rem 0.75rem; font-size: 0.85rem; font-weight: 500; }

/* cards & layout helpers */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1.6rem; margin: 1.1rem 0; box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.muted { color: var(--muted); }
.tagline { color: var(--accent-ink); font-weight: 600; margin: 0.15rem 0 0.5rem; font-size: 0.9rem; }
.inline { display: inline; }
.inline button { padding: 0.2rem 0.6rem; font-size: 0.78rem; margin-right: 0.2rem; }

/* forms */
form label { display: block; font-weight: 600; margin: 0.9rem 0 0.3rem; font-size: 0.92rem; }
input[type="text"], input[type="email"], input[type="password"],
input[type="file"], select, textarea {
  width: 100%; max-width: 480px; padding: 0.6rem 0.75rem;
  border: 1px solid var(--line); border-radius: 8px; font: inherit;
  background: #fff; color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #c3ccd6; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 197, 224, 0.22);
}
textarea { min-height: 7rem; font-family: ui-monospace, Consolas, monospace; }
form .btn, form button[type="submit"] { margin-top: 1.1rem; }

/* tables */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; background: var(--card); }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); }
th { background: var(--navy-3); color: #fff; font-weight: 600; font-size: 0.88rem; }
tr:nth-child(even) td { background: #fafbfc; }
table { font-variant-numeric: tabular-nums; }

/* flashes & badges */
.flash { padding: 0.75rem 1.1rem; border-radius: 8px; margin: 1.1rem 0; font-weight: 500; border: 1px solid transparent; }
.flash-error { background: #fdecea; color: var(--err); border-color: #f5c6c2; }
.flash-ok { background: #e8f5ec; color: var(--ok); border-color: #bfe3cb; }
.badge {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  padding: 0.15rem 0.6rem; border-radius: 999px; vertical-align: middle;
  background: #e5eaf0; color: var(--navy-3); text-transform: uppercase; letter-spacing: 0.03em;
}
.badge-ok { background: #e8f5ec; color: var(--ok); }
.badge-warn { background: #fef3e2; color: #92600a; }
.badge-warn::before { content: "\26A0\FE0E "; color: var(--safety); }

/* dashboard tool cards (rendered by server.py / dashboard.html, not this scope) */
.tool-group { margin: 2.2rem 0 0.5rem; }
.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem; margin-top: 0.85rem;
}
.tool-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem 1.4rem; color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.tool-card:hover {
  text-decoration: none; transform: translateY(-3px);
  box-shadow: var(--shadow-hover); border-color: #c7d9e0;
}
.tool-card h3 { margin: 0 0 0.2rem; display: flex; align-items: center; gap: 0.5rem; }
.tool-card .icon { color: var(--accent-ink); flex: none; }
.tool-card p { margin: 0.35rem 0 0; font-size: 0.92rem; color: var(--muted); }
.tool-card .tagline { color: var(--accent-ink); }

/* feature cards (landing page) */
.feature-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1.5rem; box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.feature-card .icon {
  width: 40px; height: 40px; border-radius: 9px; display: flex; align-items: center;
  justify-content: center; background: rgba(46, 197, 224, 0.12); color: var(--accent-ink);
  margin-bottom: 0.8rem;
}
.feature-card h3 { margin: 0 0 0.15rem; }

/* pricing */
.plan-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.3rem; margin: 1.6rem 0;
}
.plan-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; text-align: center; box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.plan-featured { border: 2px solid var(--accent); box-shadow: 0 8px 24px rgba(46, 197, 224, 0.18); }
.plan-price { font-size: 2.1rem; font-weight: 800; color: var(--navy); margin: 0.4rem 0 0.9rem; letter-spacing: -0.02em; }
.plan-card ul { list-style: none; padding: 0; margin: 0 0 1.3rem; color: var(--muted); text-align: left; }
.plan-card li { padding: 0.3rem 0; }

/* job log */
.job-log {
  background: #0d1420; color: #c7d5e8; border-radius: 8px;
  padding: 1rem; font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem; min-height: 8rem; max-height: 24rem;
  overflow: auto; white-space: pre-wrap; word-break: break-word;
}

/* landing */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 75%);
  color: #fff; border-radius: 16px; padding: clamp(2.4rem, 4vw, 4rem) clamp(1.5rem, 4vw, 3rem);
  margin-bottom: 2.2rem; position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.2));
  pointer-events: none;
}
.hero > * { position: relative; }
.hero h1 {
  color: #fff; font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem);
  margin: 0 0 0.7rem; max-width: 34rem; letter-spacing: -0.02em;
}
.hero p { color: #b9c7d8; font-size: 1.14rem; max-width: 38rem; margin: 0 0 1.6rem; }
.hero .accent { color: var(--accent); }
.hero .btn { margin-right: 0.6rem; }
.hero-final {
  text-align: center; padding: clamp(2.4rem, 4vw, 3.5rem) 1.5rem;
}
.hero-final h1 { max-width: none; margin-left: auto; margin-right: auto; }
.hero-final p { max-width: none; margin-left: auto; margin-right: auto; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.1rem; margin: 1rem 0 2.2rem; }
.step-num {
  display: inline-flex; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--accent); color: var(--navy); font-weight: 800;
  align-items: center; justify-content: center; margin-bottom: 0.6rem;
}
.section-title { margin-top: 2.8rem; }

.trust-band {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem; margin: 1rem 0;
}
.trust-band .card { margin: 0; }

/* auth split-panel */
.auth-wrap {
  display: grid; grid-template-columns: 1fr 1fr; max-width: 880px; margin: 1.5rem auto;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-hover);
  border: 1px solid var(--line);
}
.auth-brand {
  background: linear-gradient(165deg, var(--navy) 0%, var(--navy-2) 80%);
  color: #fff; padding: 2.4rem 2rem; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-brand::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 30% 30%, rgba(0,0,0,0.85), transparent 75%);
}
.auth-brand > * { position: relative; }
.auth-brand .brand { color: #fff; font-size: 1.3rem; margin-bottom: 1.2rem; }
.auth-brand p { color: #b9c7d8; max-width: none; font-size: 1rem; }
.auth-form {
  background: var(--card); padding: 2.4rem 2.2rem; margin: 0; border: none;
  box-shadow: none; border-radius: 0;
}
.auth-form h1 { margin-top: 0; }
.auth-form .btn-primary { width: 100%; }
.auth-microcopy { font-size: 0.86rem; color: var(--muted); margin-top: 1rem; }

/* account / admin structural wrappers */
.page-head { margin-bottom: 0.5rem; }

/* FAQ */
.faq-item { margin: 0 0 1.1rem; }
.faq-item h4 { margin: 0 0 0.25rem; color: var(--navy); }
.faq-item p { margin: 0; color: var(--muted); }

/* responsive */
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; max-width: 480px; }
  .auth-brand { padding: 1.8rem 1.6rem; }
}
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 2rem 1.4rem; border-radius: 12px; }
  main { padding: 1.5rem 1rem 3rem; }
  .header-inner { padding: 0.7rem 1rem; }
}
@media (max-width: 480px) {
  .site-header nav { gap: 0.8rem; }
  .site-header nav a { font-size: 0.88rem; }
  .card { padding: 1.1rem 1.2rem; }
}

/* dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1620; --card: #18212e; --ink: #dbe4ee;
    --line: #2a3648; --navy: #080d16; --navy-2: #101a2e; --navy-3: #1d2a3d;
    --muted: #93a4b8; --accent-ink: #7fe0f2;
    --shadow: 0 1px 2px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.35);
    --shadow-hover: 0 4px 10px rgba(0,0,0,0.4), 0 16px 32px rgba(0,0,0,0.45);
  }
  body { background: var(--paper); }
  h1, h2, h3 { color: #eaf1f8; }
  a { color: #7fe0f2; }
  .site-header { background: rgba(8, 13, 22, 0.92); }
  input[type="text"], input[type="email"], input[type="password"],
  input[type="file"], select, textarea { background: #101927; color: var(--ink); border-color: var(--line); }
  tr:nth-child(even) td { background: #141d2a; }
  .tool-card p { color: var(--muted); }
  .plan-price { color: #eaf1f8; }
  .flash-error { background: #3a1512; border-color: #6b2420; color: #ffb4ad; }
  .flash-ok { background: #10281a; border-color: #1e4a2f; color: #8fd6a8; }
  .badge { background: #253248; color: #b9c7d8; }
  .badge-warn { background: #3a2a10; color: #f0c374; }
  .feature-card .icon { background: rgba(46, 197, 224, 0.16); }
  .site-footer { background: var(--navy); }
}
:root[data-theme="dark"] {
  --paper: #0f1620; --card: #18212e; --ink: #dbe4ee;
  --line: #2a3648; --navy: #080d16; --navy-2: #101a2e; --navy-3: #1d2a3d;
  --muted: #93a4b8; --accent-ink: #7fe0f2;
}
:root[data-theme="light"] {
  --paper: #f7f8fa; --card: #ffffff; --ink: #1c2733;
  --line: #dde3ea; --navy: #0b1220; --navy-2: #101a2e; --navy-3: #16233a;
  --muted: #5b6877; --accent-ink: #0b6e80;
}
