/* ════════════════════════════════════════════════════════════
   SecureWave Web UI v1.0 — "Private Routing" design system
   Single-stylesheet build (CI guard: web_ui_v1.css only).
   Sections: tokens / base / nav / hero / sections / features /
   pricing / footer / legacy page components / responsive
   ════════════════════════════════════════════════════════════ */

/* The production bundle already self-hosts Manrope. It is used as the
   Space Grotesk-compatible display face so the design remains CSP-safe. */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/fonts/Manrope-400.ttf') format('truetype');
}

/* ── tokens.css ─────────────────────────────────────────────── */

:root {
  --bg:        #03060d;
  --bg2:       #060c18;
  --surf:      #080f20;
  --border:    #0f1e3a;
  --border2:   #1a3060;
  --text:      #d0e8ff;
  --muted:     #35577f;
  --subtle:    #6f94c5;
  --accent:    #00b4ff;
  --accent2:   #0066cc;
  --glow:      rgba(0,180,255,0.15);
  --green:     #00e5a0;
  --red:       #ff4060;
  --sans:      'Space Grotesk', sans-serif;
  --mono:      'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --nav-h:     56px;
}

/* ── base ───────────────────────────────────────────────────── */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* dot grid backdrop */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, #1a3060 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.35;
}

.page, main, section, header, footer { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
main { flex: 1; }

.page { min-height: 100vh; display: flex; flex-direction: column; }

h1, h2, h3, h4 { line-height: 1.1; letter-spacing: -0.03em; font-weight: 700; }
h1 { font-size: clamp(40px, 3.8vw, 62px); letter-spacing: -0.035em; line-height: 1.05; text-wrap: balance; }
h2 { font-size: clamp(28px, 3vw, 44px); letter-spacing: -0.035em; }
h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.025em; }
h1 em, h2 em, .hl { color: var(--accent); font-style: normal; }

p { color: var(--subtle); line-height: 1.75; font-size: 16px; }
.subtitle { color: var(--subtle); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

::selection { background: var(--accent2); color: var(--text); }

/* ── nav.css ────────────────────────────────────────────────── */

.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  border-bottom: 1px solid var(--border);
  background: rgba(3, 6, 13, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.navbar .container { width: 100%; max-width: none; margin: 0; padding: 0; }

.navbar-row {
  min-height: var(--nav-h);
  height: var(--nav-h);
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: var(--nav-h);
  padding: 0 32px 0 20px;
  border-right: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}

.brand img, .brand svg { width: 24px; height: 24px; }
.brand em { color: var(--accent); font-style: normal; }

.nav-panel { display: flex; align-items: stretch; flex: 1; }

.nav-links { display: flex; align-items: stretch; list-style: none; }

.nav-link {
  display: inline-flex;
  align-items: center;
  height: var(--nav-h);
  padding: 0 22px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
  border-right: 1px solid var(--border);
  transition: color 0.18s ease, background 0.18s ease;
}

.nav-link:hover, .nav-link:focus-visible {
  color: var(--accent);
  background: var(--glow);
  outline: none;
}

.nav-link.active { color: var(--accent); background: var(--glow); }

.nav-actions { display: flex; align-items: stretch; margin-left: auto; }

.nav-actions .nav-link,
.navbar .btn {
  height: var(--nav-h);
  min-height: var(--nav-h);
  border: 0;
  border-left: 1px solid var(--border);
  border-right: 0;
  border-radius: 0;
  background: none;
  padding: 0 22px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
  box-shadow: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: color 0.18s ease, background 0.18s ease;
}

.navbar .btn:hover, .navbar .btn:focus-visible {
  transform: none;
  color: var(--text);
  background: var(--glow);
}

.nav-cta, .navbar .btn-primary { color: var(--accent); }

.nav-cta:hover, .nav-cta:focus-visible,
.navbar .btn-primary:hover, .navbar .btn-primary:focus-visible {
  background: var(--accent);
  color: var(--bg);
}

.nav-toggle {
  display: none;
  width: var(--nav-h);
  height: var(--nav-h);
  border: 0;
  border-left: 1px solid var(--border);
  background: none;
  color: var(--text);
  cursor: pointer;
}

.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 18px; height: 2px; background: currentColor;
  margin: 0 auto; content: ''; transition: transform 0.2s ease;
}
.nav-toggle span::before { transform: translateY(-6px); }
.nav-toggle span::after { transform: translateY(4px); }

/* ── hero.css ───────────────────────────────────────────────── */

.sw-hero {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}

.hero-left {
  padding: 72px 56px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-eyebrow, .eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 36px;
}

.hero-eyebrow::before, .eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.hero-left h1 { margin-bottom: 28px; }

.hero-body {
  font-size: 16px;
  color: var(--subtle);
  line-height: 1.75;
  max-width: 440px;
  margin-bottom: 44px;
}

.cta-group {
  display: flex;
  border: 1px solid var(--border2);
  width: fit-content;
}

.cta-primary, .cta-secondary {
  display: inline-flex;
  align-items: center;
  padding: 15px 30px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.cta-primary { background: var(--accent); color: var(--bg); }
.cta-primary:hover { opacity: 0.85; }

.cta-secondary {
  background: none;
  color: var(--subtle);
  border-left: 1px solid var(--border2);
}
.cta-secondary:hover { color: var(--text); background: var(--glow); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  margin-top: 56px;
}

.hero-stats .stat { padding: 24px 0; border-right: 1px solid var(--border); }
.hero-stats .stat:nth-child(2), .hero-stats .stat:nth-child(3) { padding-left: 28px; }
.hero-stats .stat:last-child { border-right: none; }

.hero-stats .v {
  display: block;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero-stats .l {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-right {
  background: var(--bg2);
  overflow: hidden;
  position: relative;
}

.hero-right #netviz { position: absolute; inset: 0; }
.hero-right svg { width: 100%; height: 100%; display: block; }

.net-status {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 150px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--bg2);
  display: grid;
  gap: 4px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--subtle);
}

.net-status .ns-title { color: var(--muted); letter-spacing: 0.12em; }
.net-status .ns-state { color: var(--accent); }

/* ── sections.css ───────────────────────────────────────────── */

.sw-section { border-bottom: 1px solid var(--border); }
.sw-section-pad { padding: 80px 56px; }

.sec-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 56px;
}

.sec-label .n { color: var(--accent); }
.sec-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* how it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.step { padding: 0 32px; border-right: 1px solid var(--border); }
.step:first-child { padding-left: 0; }
.step:last-child { border-right: none; padding-right: 0; }

.step-fig {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  background: var(--bg2);
  margin-bottom: 24px;
}
.step-fig svg { width: 100%; height: 100%; display: block; }

.step-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  display: block;
  margin-bottom: 10px;
}

.step h3 { margin-bottom: 12px; }
.step p { font-size: 13px; line-height: 1.7; }

/* features */
.feat-head { padding: 56px 56px 0; }
.feat-head .sec-label { margin-bottom: 56px; }
.feat-grid { display: grid; grid-template-columns: 1fr 1fr; }

.feat-main { padding: 56px; border-right: 1px solid var(--border); }
.feat-main svg { width: 100%; height: auto; display: block; margin-bottom: 32px; }

.tag {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.feat-main h3, .feat-sub h3 { margin-bottom: 12px; }
.feat-main p, .feat-sub p { font-size: 13px; line-height: 1.7; }

.feat-side { display: flex; flex-direction: column; }

.feat-sub {
  padding: 40px 48px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 32px;
  align-items: center;
  flex: 1;
}
.feat-sub:last-child { border-bottom: none; }
.feat-sub svg { width: 180px; height: 135px; display: block; }

/* ── pricing ────────────────────────────────────────────────── */

.pricing { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); }

.price-left { padding: 80px 56px; border-right: 1px solid var(--border); }
.price-left h2 {
  font-size: clamp(32px, 3vw, 52px);
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 24px;
}
.price-left p { max-width: 420px; margin-bottom: 32px; }

.price-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  transition: gap 0.18s ease;
}
.price-link:hover { gap: 14px; }

.price-right {
  padding: 64px 56px;
  background: var(--bg2);
  display: flex;
  gap: 20px;
}

.plan {
  flex: 1;
  border: 1px solid var(--border);
  padding: 28px;
  background: var(--bg);
}
.plan.pro { border-color: var(--accent2); }

.plan-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--bg);
  padding: 3px 8px;
  margin-bottom: 14px;
}

.plan-name {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 14px;
}

.plan-price {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.04em;
  display: block;
}

.plan-cycle {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin: 8px 0 24px;
}

.plan-feats { list-style: none; display: grid; gap: 10px; }
.plan-feats li { font-size: 12.5px; color: var(--text); display: flex; gap: 10px; }
.plan-feats li::before { content: '+'; color: var(--accent); font-family: var(--mono); }
.plan-feats li.off { color: var(--subtle); }
.plan-feats li.off::before { content: '—'; color: var(--muted); }

/* ── footer.css ─────────────────────────────────────────────── */

.sw-footer { border-top: 1px solid var(--border); margin-top: auto; }

.sw-footer-cols {
  display: grid;
  grid-template-columns: 260px 1fr 1fr 1fr;
}

.sw-footer-col { padding: 48px 40px; border-right: 1px solid var(--border); }
.sw-footer-col:last-child { border-right: none; }

.sw-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}
.sw-footer-brand svg, .sw-footer-brand img { width: 24px; height: 24px; }
.sw-footer-brand em { color: var(--accent); font-style: normal; }

.sw-footer-tag { font-size: 14px; color: var(--muted); line-height: 1.65; }

.sw-footer-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.sw-footer-col a {
  display: block;
  font-size: 13px;
  color: var(--subtle);
  padding: 5px 0;
  transition: color 0.18s ease;
}
.sw-footer-col a:hover { color: var(--accent); }

.sw-footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ── reveal animation ───────────────────────────────────────── */

.reveal {
  opacity: 1;
  transform: none;
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.in, .reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ════════════════════════════════════════════════════════════
   Legacy page components (about/contact/dashboard/forms/etc.)
   restyled to the same design language.
   ════════════════════════════════════════════════════════════ */

.container {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.section { padding: 80px 0; border-bottom: 1px solid var(--border); }
.section-tight { padding: 56px 0; border-bottom: 1px solid var(--border); }

.content-stack { display: grid; gap: 24px; }
.section-header { display: grid; gap: 16px; }
.text-measure { max-width: 62ch; }

.badge, .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid var(--border2);
  background: rgba(0, 180, 255, 0.06);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card, .hero-panel, .cta-band, .highlight-panel, .legal-card, .status-tile {
  position: relative;
  border: 1px solid var(--border);
  background: var(--surf);
}

.card, .hero-panel, .cta-band, .highlight-panel, .legal-card { padding: clamp(24px, 3vw, 34px); }

.card-strong, .plan-primary {
  background: linear-gradient(180deg, rgba(0, 180, 255, 0.06), rgba(0, 180, 255, 0)) , var(--surf);
  border-color: var(--accent2);
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: clamp(28px, 4vw, 54px);
  align-items: center;
}

.hero-copy { display: grid; gap: 24px; }

.hero-kpis, .dashboard-actions, .footer-columns, .download-grid, .feature-grid,
.metric-grid, .support-grid, .plans-grid, .grid, .split-grid, .story-grid {
  display: grid;
  gap: 20px;
}

.stat-list { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.status-tile { padding: 24px; min-height: 150px; }

.status-tile .value {
  display: block;
  margin-top: 16px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
}

.status-tile .label {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
}

.hero-panel { display: grid; gap: 24px; overflow: hidden; }

.hero-panel .status-ring {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--border2);
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 180, 255, 0.18), rgba(0, 180, 255, 0.03) 56%, transparent 57%);
  box-shadow: inset 0 0 0 18px rgba(0, 180, 255, 0.04);
}

.hero-panel .status-ring::before {
  content: '';
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--bg2);
}

.hero-panel .status-summary { display: grid; gap: 12px; }
.hero-panel .status-summary strong { font-size: 1.2rem; }

.metric-grid, .feature-grid, .support-grid, .dashboard-actions, .grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.split-grid, .story-grid, .layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 32px;
  align-items: stretch;
}

.layout-main, .layout-side { min-width: 0; }

.card-row { display: flex; align-items: flex-start; gap: 16px; }

.icon-circle {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--bg2);
  border: 1px solid var(--border2);
}

.btn {
  min-height: 46px;
  padding: 0 26px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  transition: opacity 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.btn:disabled { cursor: not-allowed; opacity: 0.5; }

.btn-primary { color: var(--bg); background: var(--accent); }
.btn-primary:hover, .btn-primary:focus-visible { opacity: 0.85; outline: none; }

.btn-secondary, .btn-ghost, .btn-outline, .download-btn {
  color: var(--subtle);
  background: none;
  border-color: var(--border2);
}

.btn-secondary:hover, .btn-secondary:focus-visible,
.btn-ghost:hover, .btn-ghost:focus-visible,
.btn-outline:hover, .btn-outline:focus-visible,
.download-btn:hover, .download-btn:focus-visible {
  color: var(--text);
  background: var(--glow);
  outline: none;
}

.download-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.download-btn { width: 100%; }
.download-btn small { color: var(--muted); font-family: var(--mono); }

.list { padding-left: 20px; display: grid; gap: 12px; color: var(--subtle); font-size: 15px; }
.list li::marker { color: var(--accent); }

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: 0; padding-bottom: 0; }
.info-label { color: var(--subtle); font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }
.info-value { color: var(--text); font-weight: 600; }
.info-value-wrap { max-width: 62%; overflow-wrap: anywhere; text-align: right; }

.cta-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}

/* legacy footer (interior pages) */
.footer { margin-top: auto; border-top: 1px solid var(--border); padding: 0 0 48px; }
.footer-top, .footer-bottom { position: relative; z-index: 1; }
.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 32px;
  padding: 32px 0;
}
.footer-brand strong { display: block; margin-bottom: 12px; font-size: 1.05rem; }
.footer-brand p { font-size: 14px; color: var(--muted); }
.footer-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.footer-column { display: grid; gap: 10px; }
.footer-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-column a { color: var(--subtle); font-size: 14px; }
.footer-column a:hover, .footer-column a:focus-visible { color: var(--accent); outline: none; }
.footer-bottom {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

/* forms */
.form-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vw, 56px);
}

.form-card {
  width: min(560px, 100%);
  padding: clamp(28px, 4vw, 40px);
  border: 1px solid var(--border);
  background: var(--surf);
}

.form-grid, .field { display: grid; gap: 12px; }
.form-grid { gap: 16px; }

.field label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.input {
  min-height: 48px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--text);
}

.input::placeholder { color: var(--muted); }

.input:focus {
  outline: 1px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

.field-hint { color: var(--subtle); font-size: 13px; }

.form-message {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--subtle);
  font-size: 14px;
  display: none;
}
.form-message.visible { display: block; }

/* chat widgets */
.chatbot, .legal-grid, .support-panel { display: grid; gap: 16px; }
.chatbot-header { display: flex; align-items: center; gap: 16px; }

.chatbot-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  background: var(--bg2);
}

.chat-bubble {
  width: fit-content;
  max-width: 100%;
  padding: 12px 14px;
  background: var(--surf);
  border: 1px solid var(--border);
  color: var(--subtle);
  font-size: 14px;
}

.chat-bubble-accent {
  margin-left: auto;
  background: rgba(0, 180, 255, 0.08);
  border-color: var(--border2);
  color: var(--text);
}

.chat-input {
  min-height: 48px;
  border: 1px dashed var(--border2);
  color: var(--muted);
  background: none;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 12px;
}

/* Floating support assistant. These selectors are part of the public widget
   contract used by js/chat_assistant.js; keep them with every site theme. */
.sw-chat-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--border2);
  background: var(--surf);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.sw-chat-fab-dot { display: none; }
.sw-chat-fab:hover { border-color: var(--accent); color: var(--accent); }
.sw-chat-fab:focus-visible,
.sw-chat-close:focus-visible,
.sw-chat-chip:focus-visible,
.sw-chat-send:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sw-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 80px;
  z-index: 1501;
  width: min(380px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 112px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sw-chat-panel.open { display: flex; }
.sw-chat-panel[hidden] { display: none; }

.sw-chat-header {
  min-height: 52px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surf);
}

.sw-chat-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 10px 14px;
}

.sw-chat-title-name { font-size: 14px; font-weight: 600; }
.sw-chat-title-sub { color: var(--subtle); font-size: 11px; }

.sw-chat-close {
  flex: 0 0 48px;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--subtle);
  font-size: 22px;
  cursor: pointer;
}

.sw-chat-close span { pointer-events: none; }
.sw-chat-close:hover { background: var(--bg2); color: var(--text); }

.sw-chat-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
}

.sw-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sw-chat-msg { display: flex; }
.sw-chat-msg-user { justify-content: flex-end; }

.sw-chat-bubble {
  max-width: 88%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  background: var(--surf);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.sw-chat-msg-user .sw-chat-bubble {
  border-color: var(--border2);
  background: rgba(0, 180, 255, 0.08);
}

.sw-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 12px;
}

.sw-chat-chip {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--subtle);
  font-size: 12px;
  cursor: pointer;
}

.sw-chat-chip:hover { border-color: var(--accent); color: var(--text); }

.sw-chat-footer {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
  background: var(--surf);
}

.sw-chat-input {
  min-width: 0;
  flex: 1;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border2);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

.sw-chat-input::placeholder { color: var(--muted); }
.sw-chat-input:focus { outline: 1px solid var(--accent); border-color: var(--accent); }

.sw-chat-send {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 12px;
}

.callout { border-left: 2px solid var(--accent); padding-left: 16px; }

.legal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.metric-value { font-size: 2rem; font-weight: 700; color: var(--text); letter-spacing: -0.03em; }
.metric-label {
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── responsive ─────────────────────────────────────────────── */

@media (max-width: 1080px) {
  .sw-hero, .feat-grid, .pricing { grid-template-columns: 1fr; }
  .hero-left { border-right: none; border-bottom: 1px solid var(--border); }
  .hero-right { min-height: 480px; }
  .feat-main, .price-left { border-right: none; border-bottom: 1px solid var(--border); }
  .sw-footer-cols { grid-template-columns: 1fr 1fr; }
  .sw-footer-col { border-bottom: 1px solid var(--border); }

  .hero-kpis, .metric-grid, .feature-grid, .support-grid, .dashboard-actions, .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .download-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-top, .split-grid, .story-grid, .layout, .hero-shell, .cta-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .sw-section-pad { padding: 56px 24px; }
  .hero-left { padding: 56px 24px; }
  .feat-head { padding: 40px 24px 0; }
  .feat-main { padding: 40px 24px; }
  .feat-sub { padding: 32px 24px; grid-template-columns: 1fr; }
  .price-left, .price-right { padding: 48px 24px; }
  .price-right { flex-direction: column; }
  .steps { grid-template-columns: 1fr; }
  .step { padding: 0 0 40px; border-right: none; border-bottom: 1px solid var(--border); margin-bottom: 40px; }
  .step:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
  .sw-footer-cols { grid-template-columns: 1fr; }
  .sw-footer-col { border-right: none; }
  .sw-footer-bottom { flex-direction: column; gap: 8px; }

  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; }
  .nav-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
    background: rgba(3, 6, 13, 0.98);
  }
  .nav-panel:has(.nav.nav-open), .navbar.nav-open .nav-panel { display: flex; }
  .nav-links, .nav-actions { flex-direction: column; align-items: stretch; margin-left: 0; }
  .nav-link, .nav-actions .nav-link, .navbar .btn {
    width: 100%;
    border-right: 0;
    border-left: 0;
    border-bottom: 1px solid var(--border);
    justify-content: flex-start;
  }

  h1 { font-size: clamp(34px, 9vw, 44px); }

  .hero-kpis, .metric-grid, .feature-grid, .support-grid, .dashboard-actions,
  .grid, .legal-grid, .plans-grid, .download-grid { grid-template-columns: 1fr; }

  .container { width: min(100%, calc(100% - 28px)); }
  .footer-columns { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .form-shell { padding: 18px; }
  .form-card { padding: 24px; }
  .card, .hero-panel, .cta-band, .highlight-panel, .legal-card { padding: 20px; }
  .cta-group { width: 100%; }
  .cta-primary, .cta-secondary { flex: 1; justify-content: center; }
  .sw-chat-fab { right: 12px; bottom: 12px; }
  .sw-chat-panel {
    right: 12px;
    bottom: 68px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 92px);
  }
}
