/* ============================================================
   CEMSTrekker — industrial light design system
   Precision-industrial aesthetic: light surfaces, navy ink,
   squared components, brand blue accents. Pure CSS.
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #f2f5f7;
  --bg-raise: #ffffff;
  --surface: #f7f9fa;
  --surface-2: #eef2f5;
  --border: #dde4ea;
  --border-strong: #c3cfd9;
  --ink: #132433;
  --text: #33424f;
  --muted: #5d6f7d;
  --faint: #8a99a5;
  --accent: #0067b1;
  --accent-strong: #004e8a;
  --accent-soft: #e8f2fa;
  --sky: #1ea8e0;
  --green: #4f9c2f;
  --green-soft: #ecf5e6;
  --info: #0067b1;
  --info-soft: #e8f2fa;
  --warning: #d98a1f;
  --warning-soft: #faf1df;
  --danger: #c63e4d;
  --danger-soft: #faeaeb;
  --navy: #0d1e2b;
  --navy-2: #0a1721;
  --on-dark: #eef4f9;
  --on-dark-muted: #9fb3c3;
  --font-display: "Barlow Semi Condensed", "Barlow", Arial, sans-serif;
  --font-body: "Barlow", Arial, Helvetica, sans-serif;
  --radius: 3px;
  --radius-sm: 2px;
  --shadow: 0 1px 2px rgba(13, 30, 43, 0.07);
  --shadow-lg: 0 18px 44px rgba(13, 30, 43, 0.16);
  --utility-h: 36px;
  --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(0, 103, 177, 0.22); }

img, svg { display: block; max-width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--ink);
}

p { margin: 0 0 1em; }

.container { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff;
  padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0; z-index: 300; font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

[id] { scroll-margin-top: calc(var(--utility-h) + var(--nav-h) + 16px); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 15px; letter-spacing: 0.02em;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.btn-danger {
  background: transparent;
  border-color: rgba(198, 62, 77, 0.5);
  color: var(--danger);
}
.btn-danger:hover { color: #a52c3a; border-color: var(--danger); background: var(--danger-soft); }

.btn-sm { padding: 9px 16px; font-size: 13.5px; }
.btn-block { width: 100%; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
  white-space: nowrap;
}
.badge::before {
  content: ""; width: 6px; height: 6px; background: currentColor;
}
.badge-success { color: var(--green); background: var(--green-soft); border-color: rgba(79, 156, 47, 0.35); }
.badge-info    { color: var(--accent); background: var(--info-soft); border-color: rgba(0, 103, 177, 0.3); }
.badge-warning { color: var(--warning); background: var(--warning-soft); border-color: rgba(217, 138, 31, 0.35); }
.badge-danger  { color: var(--danger); background: var(--danger-soft); border-color: rgba(198, 62, 77, 0.35); }

/* ---------- Flash messages ---------- */

.flash-stack {
  position: fixed; top: calc(var(--utility-h) + var(--nav-h) + 12px); right: 20px; z-index: 400;
  display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 40px));
}
.flash {
  padding: 13px 18px; border-radius: var(--radius-sm);
  background: var(--navy); color: var(--on-dark);
  border-left: 3px solid var(--faint);
  box-shadow: var(--shadow-lg); font-size: 14.5px;
  animation: flash-in 0.25s ease;
}
.flash-success { border-left-color: var(--green); }
.flash-error   { border-left-color: var(--danger); }
.flash-info    { border-left-color: var(--sky); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Utility bar (dark slim strip)
   ============================================================ */

.utility-bar {
  position: fixed; inset: 0 0 auto 0; z-index: 110;
  height: var(--utility-h);
  background: var(--navy);
  color: var(--on-dark-muted);
  font-size: 13px;
}
.utility-inner { height: var(--utility-h); display: flex; align-items: center; gap: 20px; }
.utility-tag {
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 11.5px; font-weight: 600;
  color: var(--on-dark-muted);
}
.utility-tag::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px;
  background: var(--green);
}
.utility-links { margin-left: auto; display: flex; gap: 22px; }
.utility-links a { color: var(--on-dark-muted); font-weight: 500; }
.utility-links a:hover { color: #fff; }

/* ============================================================
   Public navigation
   ============================================================ */

.site-nav {
  position: fixed; inset: var(--utility-h) 0 auto 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.25s ease;
}
.site-nav.scrolled { box-shadow: var(--shadow); }
.nav-inner { height: var(--nav-h); display: flex; align-items: center; gap: 28px; }

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-logo { height: 38px; width: auto; display: block; }
.brand-logo-sm { height: 30px; }
.brand-logo-lg { height: 46px; }
.brand-name {
  font-family: var(--font-display); font-weight: 700; font-size: 19px;
  color: var(--ink); letter-spacing: 0.01em;
}
.brand-name span { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav-links > a:not(.btn) {
  color: var(--text); font-size: 15px; font-weight: 600;
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.03em;
  transition: color 0.15s ease;
}
.nav-links > a:not(.btn):hover { color: var(--accent); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px; cursor: pointer; margin-left: auto;
}
.nav-toggle span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  padding: calc(var(--utility-h) + var(--nav-h) + 72px) 0 80px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(900px 420px at 88% 8%, rgba(30, 168, 224, 0.08), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(0, 103, 177, 0.06), transparent 55%),
    var(--bg);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(13, 30, 43, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 30, 43, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, black, transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, black, transparent 85%);
}

.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: 56px; align-items: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(40px, 5.2vw, 62px);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 20px;
  color: var(--ink);
}
.hero h1 .accent-word { color: var(--accent); }
.hero p.lede { font-size: clamp(16.5px, 1.6vw, 19px); color: var(--muted); max-width: 520px; margin: 0 0 32px; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 34px; }

.hero-proof {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 26px; flex-wrap: wrap;
}
.hero-proof li {
  position: relative; padding-left: 18px;
  font-size: 14px; font-weight: 600; color: var(--text);
  font-family: var(--font-display); letter-spacing: 0.02em;
}
.hero-proof li::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 8px; height: 8px; background: var(--green);
}

/* Monitor mock */
.hero-visual { min-width: 0; }
.monitor {
  background: var(--navy);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.monitor-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 16px;
  background: var(--navy-2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mb-dot { width: 9px; height: 9px; border-radius: 50%; background: #2c4256; }
.mb-dot:first-child { background: var(--green); }
.monitor-bar em {
  font-style: normal; margin-left: 10px;
  font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--on-dark-muted); font-weight: 600;
}
.monitor-body { padding: 18px; }
.monitor-trend { width: 100%; height: auto; }
.mt-grid line { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }
.mt-limit { stroke: rgba(217, 138, 31, 0.75); stroke-width: 1.5; stroke-dasharray: 6 5; }
.mt-line {
  fill: none; stroke: var(--sky); stroke-width: 2.5;
  stroke-dasharray: 900; stroke-dashoffset: 900;
  animation: trend-draw 2.2s ease forwards 0.3s;
}
.mt-live { fill: var(--sky); animation: mt-pulse 1.8s infinite; }
@keyframes trend-draw { to { stroke-dashoffset: 0; } }
@keyframes mt-pulse {
  0% { opacity: 1; }
  50% { opacity: 0.35; }
  100% { opacity: 1; }
}
.monitor-kpis {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px;
}
.mk {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: grid; gap: 2px;
}
.mk-label { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--on-dark-muted); font-weight: 600; }
.mk-value { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: #fff; line-height: 1.1; }
.mk-value small { font-size: 12px; color: var(--on-dark-muted); font-weight: 500; }
.mk-status { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.mk-status.ok { color: #7ec850; }
.monitor-alarm {
  margin-top: 12px;
  display: flex; align-items: center; gap: 9px;
  font-size: 12.5px; color: #e8d9b8;
  background: rgba(217, 138, 31, 0.12);
  border: 1px solid rgba(217, 138, 31, 0.3);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}
.ma-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); animation: mt-pulse 1.6s infinite; }

/* ---------- Stats band (dark) ---------- */

.stats-band { background: var(--navy); color: var(--on-dark); }
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 38px 0;
}
.stat-block {
  padding: 6px 26px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}
.stat-block:first-child { border-left: 0; padding-left: 0; }
.stat-block strong {
  display: block;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(28px, 3.2vw, 40px);
  color: #fff; line-height: 1.05;
}
.stat-block span { font-size: 13.5px; color: var(--on-dark-muted); letter-spacing: 0.02em; }

/* ============================================================
   Sections
   ============================================================ */

.section { padding: 90px 0; }
.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}
.section-head { max-width: 700px; margin-bottom: 52px; }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
  border-left: 3px solid var(--accent); padding-left: 12px;
}
.section-head.center .eyebrow { border-left: 0; padding-left: 0; }
.section-head h2 { font-size: clamp(30px, 3.6vw, 44px); }
.section-head p { color: var(--muted); font-size: 17px; margin: 0; }

/* Reveal-on-scroll animation (only when JS is available) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

/* ---------- Workflow (5 stages) ---------- */

.workflow-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; counter-reset: stage; }
.workflow-grid.quartet { grid-template-columns: repeat(4, 1fr); }
.stage-card {
  position: relative;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 20px 22px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}
.stage-card::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s ease;
}
.stage-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.stage-card:hover::after { transform: scaleX(1); }
.stage-card::before {
  counter-increment: stage;
  content: "0" counter(stage);
  display: block;
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  color: var(--sky);
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}
.stage-card .stage-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 16px;
}
.stage-card .stage-icon svg { width: 22px; height: 22px; }
.stage-card h3 { font-size: 18px; margin-bottom: 8px; }
.stage-card p { font-size: 14px; color: var(--muted); margin: 0; }

/* ---------- Process (stack → data) ---------- */

.process-flow { display: grid; grid-template-columns: repeat(4, 1fr); align-items: stretch; }
.process-step { position: relative; padding: 26px 26px; text-align: center; }
.process-step:not(:last-child)::after {
  content: ""; position: absolute; top: 56px; right: -24px; width: 48px; height: 2px;
  background: var(--border-strong);
}
.process-icon {
  width: 60px; height: 60px; margin: 0 auto 18px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}
.process-icon svg { width: 26px; height: 26px; }
.process-step h3 { font-size: 19px; }
.process-step p { font-size: 14px; color: var(--muted); margin: 0; }

/* ---------- Capabilities grid ---------- */

.cap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cap-card {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.cap-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-3px); }
.cap-card .cap-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  margin-bottom: 18px;
}
.cap-card .cap-icon svg { width: 22px; height: 22px; }
.cap-card h3 { font-size: 17.5px; margin-bottom: 10px; }
.cap-card ul { margin: 0; padding: 0; list-style: none; }
.cap-card li {
  position: relative; padding-left: 16px;
  font-size: 13.5px; color: var(--muted); margin-bottom: 7px;
}
.cap-card li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 6px; height: 6px;
  background: var(--sky);
}

/* ---------- Roles ---------- */

.roles-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.role-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  background: var(--bg-raise);
  transition: border-color 0.2s ease;
}
.role-card:hover { border-color: var(--accent); }
.role-card h3 { font-size: 16.5px; margin-bottom: 8px; }
.role-card p { font-size: 13.5px; color: var(--muted); margin: 0; }

/* ---------- Compliance / roadmap columns ---------- */

.roadmap { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.roadmap-col h3 {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink); margin-bottom: 22px;
}
.roadmap-col h3::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }
.roadmap-item {
  position: relative;
  padding: 4px 0 26px 30px;
  border-left: 2px solid var(--border-strong);
  margin-left: 8px;
}
.roadmap-item::before {
  content: ""; position: absolute; left: -7px; top: 8px;
  width: 12px; height: 12px;
  background: var(--bg); border: 2px solid var(--accent);
}
.roadmap-col.future .roadmap-item::before { border-color: var(--faint); }
.roadmap-item h4 { font-size: 17px; margin-bottom: 5px; }
.roadmap-item p { font-size: 14px; color: var(--muted); margin: 0; }

/* ---------- CTA band ---------- */

.cta-band {
  position: relative;
  border-radius: var(--radius);
  padding: 64px 48px;
  text-align: center;
  overflow: hidden;
  background: var(--navy);
  color: var(--on-dark);
}
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 90% at 50% 0%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 50% 0%, black 20%, transparent 80%);
}
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; font-size: clamp(28px, 3.4vw, 40px); }
.cta-band p { color: var(--on-dark-muted); max-width: 540px; margin: 0 auto 32px; }
.cta-band .eyebrow { color: var(--sky); border-left-color: var(--sky); }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cta-band .btn-ghost { border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.cta-band .btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); color: #fff; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--navy-2); background: var(--navy); color: var(--on-dark-muted); padding-top: 60px; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px;
  padding-bottom: 44px;
}
.footer-brand p { color: var(--on-dark-muted); font-size: 14px; margin: 16px 0 0; max-width: 300px; }
.footer-col h4 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em;
  color: #fff; margin-bottom: 16px;
}
.footer-col a, .footer-col span { display: block; color: var(--on-dark-muted); font-size: 14.5px; margin-bottom: 10px; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-block: 20px; border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--on-dark-muted); font-size: 13px;
}

/* ============================================================
   Forms
   ============================================================ */

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 7px; font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.04em; }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg-raise);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit; font-size: 15px;
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 103, 177, 0.14);
}
.field .hint { font-size: 12.5px; color: var(--faint); margin-top: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-error {
  background: var(--danger-soft); border: 1px solid rgba(198, 62, 77, 0.4);
  border-left: 3px solid var(--danger);
  color: var(--danger); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 14px; margin-bottom: 18px;
}
select option { background: #fff; color: var(--ink); }

/* ============================================================
   Auth pages (login / setup)
   ============================================================ */

.auth-wrap {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: calc(var(--utility-h) + 60px) 24px 48px;
  position: relative; overflow: hidden;
}
.auth-wrap::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(700px 380px at 15% 0%, rgba(0, 103, 177, 0.07), transparent 60%),
    linear-gradient(rgba(13, 30, 43, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 30, 43, 0.035) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
}
.auth-card {
  width: min(430px, 100%);
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}
.auth-card .brand { justify-content: center; margin-bottom: 26px; }
.auth-card h1 { text-align: center; font-size: 25px; margin-bottom: 6px; }
.auth-card .auth-sub { text-align: center; color: var(--muted); font-size: 14.5px; margin-bottom: 28px; }
.auth-alt { text-align: center; margin-top: 22px; font-size: 14px; color: var(--muted); }
.auth-note {
  margin-top: 20px; padding: 13px 16px; border-radius: var(--radius-sm);
  background: var(--info-soft); border-left: 3px solid var(--accent);
  color: var(--accent); font-size: 13.5px;
}

/* ============================================================
   Contact section
   ============================================================ */

.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: start; }
.contact-info h3 { font-size: 22px; }
.contact-info p { color: var(--muted); }
.contact-points { margin-top: 26px; display: grid; gap: 16px; }
.contact-point { display: flex; gap: 14px; align-items: flex-start; }
.contact-point .cp-icon {
  flex: none; width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.contact-point .cp-icon svg { width: 19px; height: 19px; }
.contact-point strong { display: block; font-size: 14.5px; color: var(--ink); }
.contact-point span { font-size: 14px; color: var(--muted); }

.panel {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

/* ============================================================
   Portal
   ============================================================ */

.portal { background: var(--bg-alt); }

.portal-shell { display: grid; grid-template-columns: 262px 1fr; min-height: 100vh; }

.portal-sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--navy);
  border-right: 1px solid var(--navy-2);
  padding: 26px 16px;
}
.portal-sidebar .brand { padding: 0 10px; margin-bottom: 34px; }
.portal-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.portal-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  color: var(--on-dark-muted); font-size: 14.5px; font-weight: 500;
  font-family: var(--font-display); letter-spacing: 0.02em;
  transition: background 0.15s ease, color 0.15s ease;
}
.portal-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.portal-nav a.active { background: rgba(30, 168, 224, 0.14); color: #fff; border-left-color: var(--sky); }
.portal-nav a .icon { width: 18px; height: 18px; flex: none; }
.portal-sidebar-footer { display: grid; gap: 4px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.portal-sidebar-footer a {
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--on-dark-muted);
}
.portal-sidebar-footer a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.portal-main { min-width: 0; display: flex; flex-direction: column; }
.portal-topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  height: 66px; padding: 0 30px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.portal-topbar h1 { font-size: 20px; margin: 0; }
.portal-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.portal-user-name { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.portal-nav-toggle { display: none; }

.portal-content { padding: 34px 30px 60px; width: 100%; max-width: 1120px; }

/* Cards & grids */
.card {
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card h2 { font-size: 20px; }
.card h3 { font-size: 16.5px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat-card { padding: 20px 22px; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 600; color: var(--accent); line-height: 1.1; }
.stat-card .stat-title { font-size: 13px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }

.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.project-card { display: flex; flex-direction: column; gap: 14px; transition: border-color 0.2s ease; }
.project-card:hover { border-color: var(--accent); }
.project-card .pc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.project-card h3 { margin: 0; font-size: 18px; }
.project-card h3 a { color: var(--ink); }
.project-card h3 a:hover { color: var(--accent); }
.project-card .pc-dates { font-size: 13px; color: var(--faint); }

.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--sky));
  transition: width 0.8s ease;
  min-width: 0;
}
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-row .progress { flex: 1; }
.progress-num { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--accent); min-width: 42px; text-align: right; }

.pc-next { font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; }
.pc-next strong { color: var(--ink); font-weight: 600; }

/* Project detail */
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.detail-head h2 { margin: 0; }
.detail-meta { display: flex; gap: 22px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin: 14px 0 24px; }
.detail-meta strong { color: var(--ink); font-weight: 600; }

.two-col { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; }

/* Milestones timeline */
.milestone-list { list-style: none; margin: 0; padding: 0; }
.milestone-item {
  position: relative; padding: 0 0 22px 34px;
  border-left: 2px solid var(--border-strong); margin-left: 9px;
}
.milestone-item:last-child { padding-bottom: 2px; }
.milestone-item::before {
  content: ""; position: absolute; left: -10px; top: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--faint);
}
.milestone-item.done { border-left-color: rgba(79, 156, 47, 0.5); }
.milestone-item.done::before {
  border-color: var(--green); background: var(--green);
}
.milestone-item.done .ms-title { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(79, 156, 47, 0.6); }
.ms-title { font-weight: 600; font-size: 15px; color: var(--ink); }
.ms-due { font-size: 12.5px; color: var(--faint); }

/* Updates feed */
.update-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.update-item:last-child { border-bottom: 0; padding-bottom: 0; }
.update-meta { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; flex-wrap: wrap; }
.update-meta .u-author { font-weight: 600; font-size: 14px; color: var(--ink); }
.update-meta .u-date { font-size: 12.5px; color: var(--faint); }
.update-body { font-size: 14.5px; color: var(--muted); margin: 0; white-space: pre-line; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.data-table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--faint); font-weight: 700;
  padding: 10px 14px; border-bottom: 2px solid var(--border-strong);
}
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 0.12s ease; }
.data-table tbody tr:hover { background: var(--surface); }
.data-table .cell-main { font-weight: 600; color: var(--ink); }
.data-table .cell-sub { font-size: 12.5px; color: var(--faint); }

/* Admin toolbar & forms */
.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.toolbar .spacer { flex: 1; }
.toolbar h2 { margin: 0; font-size: 21px; }

.form-card { max-width: 620px; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.toggle-row:last-of-type { border-bottom: 0; }
.toggle-row .tr-label strong { display: block; font-size: 15px; color: var(--ink); }
.toggle-row .tr-label span { font-size: 13px; color: var(--muted); }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  transition: background 0.2s ease;
}
.switch .slider::before {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--faint); transition: transform 0.2s ease, background 0.2s ease;
}
.switch input:checked + .slider { background: var(--green-soft); border-color: rgba(79, 156, 47, 0.55); }
.switch input:checked + .slider::before { transform: translateX(20px); background: var(--green); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(0, 103, 177, 0.2); }

/* Demo page */
.demo-hero { text-align: center; max-width: 560px; margin: 20px auto 34px; }
.demo-hero h2 { font-size: 26px; }
.demo-hero p { color: var(--muted); }
.demo-locked {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 44px 30px; text-align: center;
  max-width: 560px; margin-inline: auto;
  background: var(--bg-raise);
}
.demo-locked .lock-icon {
  width: 56px; height: 56px; margin: 0 auto 18px;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted);
}
.demo-frame {
  width: 100%; height: calc(100vh - 220px); min-height: 480px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg-raise);
}

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state h3 { color: var(--ink); font-size: 19px; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1080px) {
  .workflow-grid { grid-template-columns: repeat(3, 1fr); }
  .workflow-grid.quartet { grid-template-columns: repeat(2, 1fr); }
  .cap-grid { grid-template-columns: repeat(3, 1fr); }
  .roles-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero p.lede { max-width: 640px; }
}

@media (max-width: 900px) {
  .process-flow { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .process-step:not(:last-child)::after { display: none; }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .roadmap { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }

  .portal-shell { grid-template-columns: 1fr; }
  .portal-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 120;
    width: 272px; transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
  }
  .portal-sidebar.open { transform: none; }
  .portal-nav-toggle { display: flex; }
  .portal-content { padding: 24px 18px 48px; }

  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 18px 0; padding: 30px 0; }
  .stat-block { border-left: 0; padding: 0; }
}

@media (max-width: 720px) {
  .utility-tag { display: none; }
  .utility-links { gap: 16px; margin-inline: auto; }
  .nav-links {
    position: fixed; inset: calc(var(--utility-h) + var(--nav-h)) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 18px 24px 24px;
    box-shadow: var(--shadow-lg);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links .btn { margin: 6px 0 0; }
  .nav-toggle { display: flex; }

  .workflow-grid, .cap-grid, .roles-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 64px 0; }
  .hero { padding-top: calc(var(--utility-h) + var(--nav-h) + 48px); }
  .field-row { grid-template-columns: 1fr; }
  .cta-band { padding: 44px 24px; }
  .auth-card { padding: 32px 24px; }
  .portal-user-name { display: none; }
  .monitor-kpis { grid-template-columns: 1fr 1fr; }
  .mk:last-child { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .workflow-grid, .cap-grid, .roles-grid, .process-flow { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .utility-links a:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .mt-line { stroke-dashoffset: 0; animation: none; }
}
