/* ==========================================================================
   InfroCRM — design tokens
   ========================================================================== */
:root {
  --bg: #0f1620;
  --bg-panel: #141d28;
  --bg-panel-2: #19232f;
  --border: #263241;
  --border-soft: #1c2733;
  --text: #e7ecf1;
  --text-muted: #8ca0b3;
  --text-faint: #566475;
  --accent-amber: #f2b84b;
  --accent-amber-dim: #7a6431;
  --accent-blue: #5b8def;
  --accent-green: #4fd18b;
  --radius-s: 3px;
  --radius-m: 6px;
  --font-display: "Space Grotesk", "IBM Plex Sans", sans-serif;
  --font-body: "Inter", "IBM Plex Sans", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", monospace;
  --maxw: 1120px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; }

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

.mono { font-family: var(--font-mono); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-amber);
  color: #1a1305;
}
.btn-primary:hover { background: #ffc85e; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--text-muted); }

.btn-block { width: 100%; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(15, 22, 32, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: baseline;
  #gap: 8px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}
.logo .dot { color: var(--accent-amber); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.main-nav a {
  font-size: 14.5px;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.main-nav a:hover { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 8px 10px;
  color: var(--text);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: 88px 0 96px;
  /*border-bottom: 1px solid var(--border-soft);*/
}

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

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px 5px 10px;
  margin-bottom: 22px;
}

.hero-status .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 0 rgba(79, 209, 139, 0.6);
  animation: pulse-dot 2.2s infinite;
}

@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(79, 209, 139, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(79, 209, 139, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 209, 139, 0); }
}

.hero h1 {
    font-size: 42px;
    /* max-width: 15ch; */
    text-wrap-style: pretty;
}

.hero-lead {
  margin-top: 20px;
  font-size: 17px;
  color: var(--text-muted);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.hero-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-faint);
}

/* ---------- hero diagram ---------- */
.hero-diagram {
  position: relative;
}

.diagram-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--bg-panel);
  padding: 22px;
}

.diagram-frame-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

.sync-line {
  stroke: var(--border);
  stroke-width: 1.5;
}

.sync-line-active {
  stroke: var(--accent-blue);
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
  animation: dash-move 1.6s linear infinite;
}

@keyframes dash-move {
  to { stroke-dashoffset: -18; }
}

.node-box {
  fill: var(--bg-panel-2);
  stroke: var(--border);
}

.node-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  fill: var(--text-muted);
}

.node-title {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  fill: var(--text);
}

.node-amber { fill: var(--accent-amber); }
.node-green { fill: var(--accent-green); }
.node-blue { fill: var(--accent-blue); }

/* ==========================================================================
   Section shared
   ========================================================================== */
section { padding: 88px 0; }
section + section { /*border-top: 1px solid var(--border-soft);*/ }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 48px;
}

.section-head h2 { font-size: 28px; max-width: 22ch; }
.section-head .section-note {
  color: var(--text-muted);
  max-width: 34ch;
  font-size: 15px;
}

.section-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 10px;
}

/* ==========================================================================
   Workflow (steps)
   ========================================================================== */
.workflow-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  overflow: hidden;
}

.workflow-step {
  padding: 26px 22px;
  border-right: 1px solid var(--border-soft);
  position: relative;
}
.workflow-step:last-child { border-right: none; }

.workflow-step .num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-amber);
  display: block;
  margin-bottom: 14px;
}

.workflow-step h3 { font-size: 16px; margin-bottom: 8px; }
.workflow-step p { font-size: 14px; color: var(--text-muted); }

/* ==========================================================================
   Features (list style, not uniform cards)
   ========================================================================== */
.feature-list {
  display: flex;
  flex-direction: column;
}

.feature-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--border-soft);
  align-items: start;
}
.feature-row:last-child { border-bottom: 1px solid var(--border-soft); }

.feature-row .icon {
  width: 34px;
  height: 34px;
  color: var(--accent-blue);
}

.feature-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feature-heading h3 { font-size: 17px; }

.feature-row p {
  color: var(--text-muted);
  font-size: 14.5px;
  max-width: 60ch;
}

/* ==========================================================================
   API / developer section
   ========================================================================== */
.dev-section .wrap {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: center;
}

.dev-copy h2 { font-size: 26px; margin-bottom: 16px; }
.dev-copy p { color: var(--text-muted); font-size: 15px; margin-bottom: 14px; }

.dev-list {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dev-list li {
  font-size: 14px;
  color: var(--text-muted);
  padding-left: 18px;
  position: relative;
}
.dev-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  background: var(--accent-amber);
}

.code-block {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  overflow: hidden;
}

.code-block-head {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

.code-block pre {
  margin: 0;
  padding: 18px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}

.code-block .tok-key { color: var(--accent-blue); }
.code-block .tok-str { color: var(--accent-green); }
.code-block .tok-mut { color: var(--text-faint); }

/* ==========================================================================
   Pricing
   ========================================================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.price-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.price-card.is-featured {
  border-color: var(--accent-amber-dim);
  background: linear-gradient(180deg, rgba(242, 184, 75, 1), background: var(--bg));
}

.price-tier {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.price-value {
  font-family: var(--font-display);
  font-size: 34px;
  margin: 6px 0 4px;
}
.price-value span {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

.price-desc {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 22px;
}

.price-features {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.price-features li {
  font-size: 13.5px;
  color: var(--text);
  padding-left: 18px;
  position: relative;
}
.price-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 1.5px;
  background: var(--accent-blue);
}

/* ==========================================================================
   CTA band
   ========================================================================== */
.cta-band {
  text-align: left;
}
.cta-band .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  padding: 40px 44px;
  background: var(--bg-panel);
}
.cta-band h2 { font-size: 24px; max-width: 24ch; }
.cta-band .cta-actions { display: flex; gap: 12px; flex-shrink: 0; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 40px 0;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--text-muted); font-size: 13.5px; }
.footer-links a:hover { color: var(--text); }
.footer-fine { color: var(--text-faint); font-size: 12.5px; }

/* ==========================================================================
   Auth modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 18, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-overlay.is-open { display: flex; }

.modal {
  width: 100%;
  max-width: 380px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 28px;
  animation: modal-in 0.18s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.modal-head h2 { font-size: 19px; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  padding: 4px;
}
.modal-close:hover { color: var(--text); }

.tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  margin-bottom: 22px;
  overflow: hidden;
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 9px 0;
  font-size: 13.5px;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
}
.tab-btn:last-child { border-right: none; }
.tab-btn.is-active {
  background: var(--bg-panel-2);
  color: var(--text);
}

.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.is-active { display: flex; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--text-muted); }
.field input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.field input:focus { border-color: var(--accent-blue); }

.form-msg {
  font-size: 13px;
  padding: 9px 12px;
  border-radius: var(--radius-s);
  display: none;
}
.form-msg.is-error {
  display: block;
  background: rgba(224, 90, 90, 0.12);
  color: #e07a7a;
  border: 1px solid rgba(224, 90, 90, 0.3);
}
.form-msg.is-success {
  display: block;
  background: rgba(79, 209, 139, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(79, 209, 139, 0.3);
}

.field-note {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .dev-section .wrap { grid-template-columns: 1fr; }
  .workflow-list { grid-template-columns: repeat(2, 1fr); }
  .workflow-step:nth-child(2) { border-right: none; }
  .workflow-step:nth-child(1), .workflow-step:nth-child(2) {
    border-bottom: 1px solid var(--border-soft);
  }
  .pricing-grid { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: 1fr; }
  .cta-band .wrap { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 680px) {
  .main-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .hero { padding: 56px 0 64px; }
  .hero h1 { font-size: 32px; }
  section { padding: 56px 0; }
  .workflow-list { grid-template-columns: 1fr; }
  .workflow-step { border-right: none !important; border-bottom: 1px solid var(--border-soft); }
  .section-head { flex-direction: column; align-items: flex-start; }
}