/* ==========================================================================
   Ziptastic — modern theme
   A single design system for the marketing site, dashboard, and auth pages.
   Dark-first, agent-forward, with shims so legacy Materialize-class pages
   still inherit the look.
   ========================================================================== */

:root {
  /* Palette */
  --bg:            #0a0b14;
  --bg-2:          #0f1120;
  --surface:       #141729;
  --surface-2:     #1b1f36;
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text:          #e8eaf3;
  --text-dim:      #a3a9c2;
  --text-faint:    #6b7192;

  --brand:         #6c5ce7;   /* indigo */
  --brand-2:       #00d2ff;   /* cyan   */
  --brand-3:       #a66bff;   /* violet */
  --accent:        #2bd9a0;   /* mint (success / live) */
  --danger:        #ff6b81;
  --warn:          #ffb454;

  --grad: linear-gradient(120deg, var(--brand) 0%, var(--brand-3) 45%, var(--brand-2) 100%);
  --grad-soft: linear-gradient(120deg, rgba(108,92,231,.18), rgba(0,210,255,.12));

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --shadow:    0 10px 40px -12px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 0 1px var(--border), 0 24px 60px -20px rgba(108, 92, 231, 0.45);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;

  --maxw: 1140px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* ambient glow */
  background-image:
    radial-gradient(900px 500px at 12% -8%, rgba(108, 92, 231, 0.18), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(0, 210, 255, 0.12), transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand-2); text-decoration: none; transition: color .15s ease; }
a:hover { color: #7ee7ff; }

h1, h2, h3, h4, h5, h6 { line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; color: var(--text); margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.35rem; }
p  { color: var(--text-dim); }

::selection { background: rgba(108, 92, 231, 0.4); color: #fff; }

img { max-width: 100%; height: auto; }

/* gradient text helper */
.gradient-text,
.ziptastic {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 800;
}

/* ------------------------------------------------------------------ layout */
.container, .wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

main { flex: 1 0 auto; width: 100%; }

section { padding: 64px 0; }
.section-tight { padding: 40px 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-2);
  margin-bottom: 14px;
}

.muted { color: var(--text-faint); }
.center { text-align: center; }
.lead { font-size: 1.15rem; color: var(--text-dim); max-width: 60ch; }

/* ------------------------------------------------------------------ navbar */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 11, 20, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand .dot {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--grad);
  display: inline-grid;
  place-items: center;
  font-size: 14px;
  box-shadow: 0 4px 14px -2px rgba(108, 92, 231, 0.7);
}
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  margin-left: auto;
  flex-wrap: wrap;
}
.nav-links a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--text-dim);
  font-size: .92rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.nav-toggle { display: none; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 11px;
  font-weight: 600;
  font-size: .95rem;
  font-family: var(--font-sans);
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(108, 92, 231, 0.8);
}
.btn-primary:hover { color: #fff; box-shadow: 0 14px 38px -10px rgba(108, 92, 231, 1); transform: translateY(-1px); }
.btn-ghost {
  background: rgba(255,255,255,.04);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255,255,255,.08); color: var(--text); }
.btn-lg { padding: 14px 28px; font-size: 1.02rem; border-radius: 13px; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: .85rem; border-radius: 9px; }
.btn-danger { background: rgba(255,107,129,.12); border-color: rgba(255,107,129,.35); color: var(--danger); }
.btn-danger:hover { background: rgba(255,107,129,.2); color: #ffd0d8; }

/* ------------------------------------------------------------------ cards */
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card-glow { box-shadow: var(--shadow-glow); }

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

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.feature:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.feature .ico {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 22px;
  margin-bottom: 16px;
}
.feature h3 { font-size: 1.1rem; margin-bottom: 6px; }
.feature p { font-size: .95rem; margin: 0; }

/* badges / pills */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .8rem; font-weight: 600;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.badge.live { color: var(--accent); border-color: rgba(43,217,160,.35); background: rgba(43,217,160,.1); }
.badge .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(43,217,160,.6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(43,217,160,.5); }
  70%  { box-shadow: 0 0 0 8px rgba(43,217,160,0); }
  100% { box-shadow: 0 0 0 0 rgba(43,217,160,0); }
}

/* ------------------------------------------------------------------ hero */
.hero { padding: 80px 0 56px; position: relative; overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.hero h1 { margin-bottom: 18px; }
.hero .lead { font-size: 1.25rem; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero-stats { display: flex; gap: 36px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats .stat .num { font-size: 1.8rem; font-weight: 800; }
.hero-stats .stat .lbl { font-size: .82rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .08em; }

/* ------------------------------------------------------------------ code / terminal */
pre, code, kbd, samp { font-family: var(--font-mono); }
code {
  font-size: .88em;
  background: rgba(255,255,255,.07);
  padding: .15em .4em;
  border-radius: 6px;
  color: #c8d0ff;
}
pre {
  background: #0c0e1a;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  overflow-x: auto;
  font-size: .88rem;
  line-height: 1.65;
  color: #d6dcff;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

.terminal {
  background: #0b0d18;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
}
.terminal-bar .dot { width: 12px; height: 12px; border-radius: 50%; }
.terminal-bar .dot.r { background: #ff5f57; }
.terminal-bar .dot.y { background: #febc2e; }
.terminal-bar .dot.g { background: #28c840; }
.terminal-bar .title { margin-left: 8px; font-family: var(--font-mono); font-size: .8rem; color: var(--text-faint); }
.terminal pre { border: 0; border-radius: 0; margin: 0; background: transparent; }
.terminal .json-key { color: #7ee7ff; }
.terminal .json-str { color: #b8f5d0; }
.terminal .json-num { color: #ffd17a; }

/* tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.tab {
  padding: 7px 14px;
  border-radius: 9px;
  font-size: .85rem; font-weight: 600;
  cursor: pointer;
  color: var(--text-dim);
  border: 1px solid transparent;
  background: transparent;
  font-family: var(--font-sans);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ------------------------------------------------------------------ live demo widget */
.demo {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-glow);
}
.demo-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.demo-head .req-line { font-family: var(--font-mono); font-size: .82rem; color: var(--text-faint); }
.demo-form { display: flex; gap: 10px; flex-wrap: wrap; }
.demo-form .field { flex: 1 1 120px; }
.demo-out { margin-top: 16px; }

.field label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
  margin-bottom: 6px;
}

/* ------------------------------------------------------------------ forms */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .95rem;
  font-family: var(--font-sans);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.25);
}
input::placeholder { color: var(--text-faint); }
select option { background: var(--bg-2); color: var(--text); }
label { color: var(--text-dim); font-size: .92rem; }

.form-narrow { max-width: 440px; margin: 0 auto; }
.form-row { margin-bottom: 16px; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
th { color: var(--text-faint); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
td { color: var(--text-dim); }
tbody tr:hover { background: rgba(255,255,255,.02); }

/* progress */
progress {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px; border: 0; border-radius: 999px;
  background: var(--surface-2); overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--grad); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--brand); border-radius: 999px; }

/* details */
details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  background: rgba(255,255,255,.02);
}
details summary { cursor: pointer; font-weight: 600; color: var(--text); }
details[open] summary { margin-bottom: 10px; }

/* definition lists (FAQ) */
dl dt { font-weight: 700; color: var(--text); margin-top: 22px; font-size: 1.05rem; }
dl dd { margin: 8px 0 0; color: var(--text-dim); }

/* copy button */
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  font-size: .72rem; padding: 4px 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-dim); cursor: pointer;
  font-family: var(--font-sans);
}
.copy-btn:hover { color: var(--text); background: rgba(255,255,255,.12); }
.code-wrap { position: relative; }

/* ------------------------------------------------------------------ footer */
.footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: rgba(10, 11, 20, 0.6);
  padding: 48px 0 32px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 32px;
}
.footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 9px; }
.footer a { color: var(--text-dim); font-size: .92rem; }
.footer a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 36px; padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  color: var(--text-faint); font-size: .85rem;
}

/* messages / alerts */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); margin-bottom: 16px; font-size: .92rem;
}
.alert-error { background: rgba(255,107,129,.1); border-color: rgba(255,107,129,.3); color: #ffd0d8; }
.alert-info  { background: rgba(0,210,255,.08); border-color: rgba(0,210,255,.25); color: #bdeeff; }
.alert-field-text { color: var(--danger); font-size: .85rem; margin: 4px 0 8px; }

/* page header band */
.page-head { padding: 56px 0 8px; }
.page-head h1 { margin-bottom: 10px; }

/* coverage chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: .8rem;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

/* ==========================================================================
   Legacy Materialize-class shims — so not-yet-rewritten pages stay on-theme.
   ========================================================================== */
.row { display: block; margin-bottom: 0; }
.row::after { content: ""; display: table; clear: both; }
[class*="col s"], [class*="col m"], [class*="col l"] { width: 100%; padding: 0; }
.flow-text { font-size: 1.05rem; color: var(--text-dim); }
.collection { list-style: none; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.collection-item { padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.collection-item:last-child { border-bottom: 0; }
.input-field { margin-bottom: 16px; }
.input-field label { display: block; margin-bottom: 6px; }
.btn-large {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px; border-radius: 13px; font-weight: 600;
  background: var(--grad); color: #fff; cursor: pointer; border: 0;
}
.btn-large:hover { color: #fff; }
.center-image { display: block; margin: 0 auto; }
.documentation-nav { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; }
.documentation-nav li { color: var(--text-faint); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: 12px; gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle {
    display: inline-grid; place-items: center; margin-left: auto;
    width: 40px; height: 40px; border-radius: 10px;
    background: rgba(255,255,255,.05); border: 1px solid var(--border);
    color: var(--text); cursor: pointer; font-size: 20px;
  }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
  section { padding: 48px 0; }
}
