/* =========================================================
   Trade Automate Labs — Design System
   Premium dark fintech theme. CSS variables, components,
   layout, responsive rules, accessibility, motion.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---------------------------------------------------------
   1. Design Tokens
   --------------------------------------------------------- */
:root {
  /* Surfaces */
  --bg-base: #090d16;
  --bg-raised: #0e1424;
  --bg-card: #11182b;
  --bg-card-hover: #141d34;
  --bg-elevated: #171f38;
  --bg-inset: #0c1120;

  /* Borders */
  --border-subtle: #1c263f;
  --border-default: #232f4d;
  --border-strong: #2d3b5e;

  /* Text */
  --text-primary: #eef1f8;
  --text-secondary: #a6b0c8;
  --text-muted: #6c7893;
  --text-faint: #4a5470;

  /* Brand accents — restrained, single hue family */
  --accent: #4f7dfb;
  --accent-strong: #6f92ff;
  --accent-soft: rgba(79, 125, 251, 0.12);
  --accent-border: rgba(79, 125, 251, 0.35);
  --accent-teal: #2fd6c0;
  --accent-teal-soft: rgba(47, 214, 192, 0.12);

  /* Semantic */
  --success: #34d399;
  --warning: #f5b95c;
  --danger: #f3685f;
  --danger-soft: rgba(243, 104, 95, 0.12);

  /* Typography */
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 2.875rem;
  --fs-4xl: 3.5rem;

  /* Spacing scale (4/8px rhythm) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadow / elevation */
  --shadow-sm: 0 1px 2px rgba(2, 6, 16, 0.4);
  --shadow-md: 0 8px 24px rgba(2, 6, 16, 0.45);
  --shadow-lg: 0 24px 64px rgba(2, 6, 16, 0.55);
  --shadow-glow: 0 0 0 1px var(--accent-border), 0 12px 40px rgba(79, 125, 251, 0.18);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-base: 220ms;
  --dur-slow: 320ms;

  /* Layout */
  --container-max: 1240px;
  --header-h: 76px;
  --z-header: 100;
  --z-overlay: 200;
  --z-toast: 300;
}

/* ---------------------------------------------------------
   2. Reset & Base
   --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-4);
  color: var(--text-primary);
}
h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p { margin: 0 0 var(--space-4); color: var(--text-secondary); max-width: 68ch; }
p:last-child { margin-bottom: 0; }

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

ul, ol { padding-left: 1.25em; color: var(--text-secondary); }

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
  border-radius: 4px;
}
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }

::selection { background: var(--accent-soft); color: var(--text-primary); }

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -60px;
  background: var(--accent);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top var(--dur-base) var(--ease-out);
  font-weight: 600;
}
.skip-link:focus { top: var(--space-4); }

/* ---------------------------------------------------------
   3. Layout helpers
   --------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.section { padding-block: var(--space-9); }
.section--tight { padding-block: var(--space-8); }
.section-head { max-width: 720px; margin-bottom: var(--space-7); }
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-4);
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-strong);
  flex-shrink: 0;
}

.lede { font-size: var(--fs-md); color: var(--text-secondary); }

.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

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

/* ---------------------------------------------------------
   4. Buttons
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
  white-space: nowrap;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { box-shadow: 0 0 0 1px var(--accent-border), 0 16px 48px rgba(79, 125, 251, 0.28); }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--accent-border); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-elevated); }

.btn-block { width: 100%; }
.btn-lg { min-height: 56px; padding: 0 var(--space-7); font-size: var(--fs-base); }
.btn-sm { min-height: 40px; padding: 0 var(--space-4); font-size: var(--fs-xs); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------------------------------------------------------
   5. Header / Navigation
   --------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(9, 13, 22, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--fs-md);
  color: var(--text-primary);
  flex-shrink: 0;
}
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-name { line-height: 1.15; }
.brand-name small {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.nav-primary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}
.nav-primary a {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.nav-primary a:hover { color: var(--text-primary); background: var(--bg-elevated); }
.nav-primary a[aria-current="page"] { color: var(--text-primary); background: var(--accent-soft); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Mobile nav */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-primary {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: var(--space-1);
    padding: var(--space-5);
    background: var(--bg-base);
    border-top: 1px solid var(--border-subtle);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility var(--dur-base);
    overflow-y: auto;
  }
  .nav-primary.is-open {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }
  .nav-primary a {
    padding: var(--space-4);
    font-size: var(--fs-md);
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0;
  }
  .nav-primary .btn-primary {
    display: inline-flex;
    margin-top: var(--space-5);
  }
}

/* ---------------------------------------------------------
   6. Hero
   --------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: var(--space-8) var(--space-6);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 640px;
  background: radial-gradient(60% 60% at 30% 20%, rgba(79, 125, 251, 0.16), transparent 70%),
              radial-gradient(45% 45% at 80% 10%, rgba(47, 214, 192, 0.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero .container { position: relative; z-index: 1; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-8);
  align-items: center;
}
.hero-copy h1 { font-size: clamp(2.25rem, 4.4vw, var(--fs-4xl)); }
.hero-actions { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-6); }

.capability-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}
.capability-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
}
.capability-chip svg { width: 14px; height: 14px; color: var(--accent-strong); }

/* Hero visual — compact architecture flow */
.hero-visual {
  position: relative;
  max-width: 380px;
  width: 100%;
  margin-inline: auto;
}

/* Trust strip */
.trust-strip {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-raised);
  padding-block: var(--space-4);
  position: relative;
  z-index: 1;
}
.trust-strip ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3) var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.trust-strip li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.trust-strip li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-strong);
  flex-shrink: 0;
}
.trust-strip li:first-child::before { display: none; }

/* ---------------------------------------------------------
   7. Cards
   --------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.card:hover {
  border-color: var(--accent-border);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
}

.service-card { display: flex; flex-direction: column; gap: var(--space-4); }
.service-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-strong);
  flex-shrink: 0;
}
.service-icon svg { width: 24px; height: 24px; }
.service-card h3 { margin-bottom: var(--space-2); }
.service-card .card-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent-strong);
}
.service-card .card-link svg { width: 16px; height: 16px; transition: transform var(--dur-base) var(--ease-out); }
.service-card:hover .card-link svg { transform: translateX(3px); }

.service-benefit {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent-teal);
  margin-top: var(--space-3);
}
.service-benefit svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

/* Mini flow visual — portfolio cards */
.mini-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.mini-flow .flow-step {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.mini-flow .flow-arrow { width: 14px; height: 14px; color: var(--accent-strong); flex-shrink: 0; }

.tag-list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
}

/* ---------------------------------------------------------
   8. Architecture diagram
   --------------------------------------------------------- */
.arch-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  max-width: 460px;
  margin-inline: auto;
}
.arch-node {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  transition: border-color var(--dur-base) var(--ease-out);
}
.arch-node span {
  display: block;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
  text-transform: none;
}
.arch-node:hover { border-color: var(--accent-border); }
.arch-node--accent { border-color: var(--accent-border); background: var(--accent-soft); }
.arch-connector {
  width: 2px;
  height: 32px;
  background: linear-gradient(var(--border-strong), var(--accent-border));
  position: relative;
}
.arch-connector::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 50%;
  width: 8px; height: 8px;
  transform: translateX(-50%) rotate(45deg);
  border-right: 2px solid var(--accent-border);
  border-bottom: 2px solid var(--accent-border);
}

/* Compact variant — used in the hero */
.arch-diagram--compact { max-width: 340px; }
.arch-diagram--compact .arch-node {
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-xs);
}
.arch-diagram--compact .arch-connector { height: 18px; }

/* ---------------------------------------------------------
   9. Timeline / process steps
   --------------------------------------------------------- */
.timeline {
  display: grid;
  gap: var(--space-5);
  counter-reset: step;
}
.timeline-step {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--space-5);
  position: relative;
  padding-bottom: var(--space-7);
}
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step::before {
  content: '';
  position: absolute;
  left: 35px;
  top: 72px;
  bottom: 0;
  width: 3px;
  background: linear-gradient(var(--accent-border), var(--border-subtle));
}
.timeline-step:last-child::before { display: none; }
.step-index {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg-card));
  border: 2px solid var(--accent-border);
  box-shadow: 0 0 0 4px var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-lg);
  color: var(--accent-strong);
  flex-shrink: 0;
}
.step-body { padding-top: var(--space-3); }
.step-body h3 { font-size: var(--fs-xl); margin-bottom: var(--space-2); }

/* ---------------------------------------------------------
   10. Forms
   --------------------------------------------------------- */
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}
.form-section-head { margin-bottom: var(--space-5); }
.form-section-head .step-tag {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--accent-strong);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.form-section-head h2 { font-size: var(--fs-xl); margin-bottom: var(--space-1); }
.form-section-head p { font-size: var(--fs-sm); }

.algo-form { max-width: 960px; margin-inline: auto; }

/* Mode toggle — Guided Form vs Upload Existing Specification */
.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.mode-option { display: block; cursor: pointer; }
.mode-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.mode-option-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  height: 100%;
  border: 1.5px solid var(--border-default);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: all var(--dur-base) var(--ease-out);
}
.mode-option input:checked + .mode-option-card {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  box-shadow: var(--shadow-glow);
}
.mode-option input:focus-visible + .mode-option-card {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}
.mode-icon {
  width: 44px; height: 44px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--accent-strong);
}
.mode-icon svg { width: 22px; height: 22px; }
.mode-text strong { display: block; font-size: var(--fs-md); color: var(--text-primary); margin-bottom: var(--space-1); }
.mode-text small { display: block; font-size: var(--fs-xs); color: var(--text-secondary); font-weight: 400; line-height: 1.5; }

/* Sticky form progress indicator */
.form-progress {
  position: sticky;
  top: calc(var(--header-h) + var(--space-3));
  z-index: 20;
  background: rgba(9, 13, 22, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
}
.form-progress-track {
  height: 4px;
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: var(--space-3);
}
.form-progress-fill {
  height: 100%;
  width: 14%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width var(--dur-slow) var(--ease-out);
}
.form-progress-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.form-progress-steps li { transition: color var(--dur-base) var(--ease-out); }
.form-progress-steps li.is-active { color: var(--accent-strong); font-weight: 600; }
.form-progress-steps li.is-done { color: var(--text-muted); }

.form-section--emphasis {
  border-color: var(--accent-border);
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg-card));
}

.field-grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(2, 1fr); }
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field--full { grid-column: 1 / -1; }

.field label,
.field legend {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
}
fieldset.field { border: none; margin: 0; }
.field legend { margin-bottom: var(--space-1); width: 100%; }
.field .required { color: var(--danger); }
.field .hint { font-size: var(--fs-xs); color: var(--text-muted); margin: 0; }
.field .error-msg {
  font-size: var(--fs-xs);
  color: var(--danger);
  display: none;
  align-items: center;
  gap: var(--space-2);
}
.field.has-error .error-msg { display: flex; }
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--danger); }

input[type="text"], input[type="email"], input[type="tel"], input[type="search"], select, textarea {
  min-height: 48px;
  padding: 0 var(--space-4);
  background: var(--bg-inset);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  width: 100%;
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
textarea { min-height: 120px; padding: var(--space-3) var(--space-4); resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a6b0c8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-8);
}

/* Choice chips (checkbox/radio groups styled as chips) */
.choice-grid { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.choice-chip { position: relative; }
.choice-chip input {
  position: absolute;
  opacity: 0;
  width: 100%; height: 100%;
  margin: 0;
  cursor: pointer;
}
.choice-chip label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  background: var(--bg-inset);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
}
.choice-chip input:checked + label {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--text-primary);
}
.choice-chip input:focus-visible + label { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.choice-chip label::before {
  content: '';
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  transition: all var(--dur-fast) var(--ease-out);
}
.choice-chip input:checked + label::before {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.choice-chip.is-radio label::before { border-radius: 50%; }

/* Larger choice grid — Development Type */
.choice-grid--lg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--space-3);
}
.choice-grid--lg .choice-chip label {
  width: 100%;
  min-height: 64px;
  padding: 0 var(--space-5);
  font-size: var(--fs-base);
  font-weight: 600;
  gap: var(--space-3);
}
.chip-icon { width: 22px; height: 22px; color: var(--accent-strong); flex-shrink: 0; }

/* Consent checkbox */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-block: var(--space-5);
}
.consent-row input {
  width: 20px; height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.consent-row label { font-size: var(--fs-sm); color: var(--text-secondary); }

/* Upload dropzone */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-7) var(--space-5);
  text-align: center;
  background: var(--bg-inset);
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 36px; height: 36px; color: var(--accent-strong); margin: 0 auto var(--space-3); }
.dropzone .dz-formats { margin-top: var(--space-3); }
.file-list { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: flex; flex-direction: column; gap: var(--space-2); }
.file-list li {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}
.file-list .file-remove {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: var(--space-1);
  display: inline-flex;
}
.file-list .file-remove:hover { color: var(--danger); }
.file-list .file-remove svg { width: 16px; height: 16px; }

/* Form submit / status */
.form-submit-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-6);
}
.form-note {
  display: flex;
  gap: var(--space-3);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-top: var(--space-6);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.form-note svg { width: 20px; height: 20px; color: var(--accent-strong); flex-shrink: 0; margin-top: 2px; }

.form-status {
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-top: var(--space-6);
  display: none;
  gap: var(--space-3);
  font-size: var(--fs-sm);
}
.form-status.is-visible { display: flex; }
.form-status--success { background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.35); color: var(--text-primary); }
.form-status--error { background: var(--danger-soft); border: 1px solid rgba(243, 104, 95, 0.35); color: var(--text-primary); }
.form-status svg { width: 22px; height: 22px; flex-shrink: 0; }
.form-status--success svg { color: var(--success); }
.form-status--error svg { color: var(--danger); }

/* Simple contact form (contact.html) reuses .field styles */

/* ---------------------------------------------------------
   11. Sections: architecture / why-us / cta
   --------------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
}

.feature-list { display: flex; flex-direction: column; gap: var(--space-5); }
.feature-item { display: flex; gap: var(--space-4); }
.feature-item .icon-badge {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-strong);
  flex-shrink: 0;
}
.feature-item .icon-badge svg { width: 20px; height: 20px; }
.feature-item h3 { font-size: var(--fs-base); margin-bottom: var(--space-1); }
.feature-item p { font-size: var(--fs-sm); }

.cta-panel {
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg-card));
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-9) var(--space-7);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(50% 80% at 50% 0%, rgba(79, 125, 251, 0.14), transparent 70%);
  pointer-events: none;
}
.cta-panel > * { position: relative; z-index: 1; }
.cta-panel h2 { max-width: 620px; margin-inline: auto; }
.cta-panel .btn { margin-top: var(--space-6); }

/* Disclaimer banner */
.disclaimer-note {
  display: flex;
  gap: var(--space-3);
  background: var(--bg-inset);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.disclaimer-note svg { width: 20px; height: 20px; color: var(--text-muted); flex-shrink: 0; margin-top: 2px; }

/* Legal content */
.legal-content h2 { margin-top: var(--space-7); font-size: var(--fs-lg); }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p, .legal-content li { color: var(--text-secondary); }
.legal-content ul { margin-bottom: var(--space-4); }
.legal-updated { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: var(--space-7); }
.legal-review-note {
  margin-top: var(--space-8);
  background: var(--danger-soft);
  border: 1px solid rgba(243, 104, 95, 0.3);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  font-size: var(--fs-sm);
}

/* 404 */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-block: var(--space-9);
}
.error-code {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 700;
  color: var(--accent-strong);
  line-height: 1;
  margin-bottom: var(--space-4);
}

/* Breadcrumb-ish page header */
.page-header { padding-block: var(--space-8) var(--space-7); border-bottom: 1px solid var(--border-subtle); }
.page-header .eyebrow { margin-bottom: var(--space-4); }
.page-header p { font-size: var(--fs-md); }

/* ---------------------------------------------------------
   12. Footer
   --------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding-block: var(--space-8) var(--space-6);
  background: var(--bg-raised);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-7);
  padding-bottom: var(--space-7);
}
.footer-brand p { font-size: var(--fs-sm); margin-top: var(--space-4); max-width: 32ch; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.footer-col a { font-size: var(--fs-sm); color: var(--text-secondary); transition: color var(--dur-base) var(--ease-out); }
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--text-secondary); }

/* ---------------------------------------------------------
   13. Responsive
   --------------------------------------------------------- */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 320px; }
  .split { grid-template-columns: 1fr; }
  .split .hero-visual, .split .arch-diagram { order: -1; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .field-grid { grid-template-columns: 1fr; }
  .form-progress { position: static; }
}

@media (max-width: 640px) {
  :root { --header-h: 68px; }
  .container { padding-inline: var(--space-4); }
  .section { padding-block: var(--space-7); }
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-xl); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: var(--space-6); }
  .hero-actions .btn { width: 100%; }
  .cta-panel { padding: var(--space-7) var(--space-5); }
  .timeline-step { grid-template-columns: 56px 1fr; gap: var(--space-4); }
  .step-index { width: 56px; height: 56px; font-size: var(--fs-base); box-shadow: 0 0 0 3px var(--accent-soft); }
  .timeline-step::before { left: 27px; top: 56px; width: 2px; }
  .mode-toggle { grid-template-columns: 1fr; }
  .choice-grid--lg { grid-template-columns: 1fr; }
  .form-progress-steps { font-size: 0.65rem; gap: var(--space-1) var(--space-3); }
}

@media (min-width: 1600px) {
  :root { --container-max: 1400px; }
}
