/* HostAiHub — Clean Light SaaS design system
   Plain-CSS component library used alongside Tailwind Play CDN.
   Tokens map to the approved palette. */

:root {
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --border: #E5E7EB;
  --border-strong: #D8DCE3;
  --brand: #4F46E5;
  --brand-dark: #4338CA;
  --brand-soft: #EEF2FF;
  --text: #0F172A;
  --muted: #64748B;
  --subtle: #94A3B8;
  --success: #16A34A;
  --success-soft: #DCFCE7;
  --warning: #D97706;
  --warning-soft: #FEF3C7;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;
  --info: #0EA5E9;
  --info-soft: #E0F2FE;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, .07), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, .12);
  --ring: 0 0 0 4px rgba(79, 70, 229, .15);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---- Typography ---- */
.eyebrow {
  font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand);
}
.h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.05; font-weight: 800; letter-spacing: -.02em; }
.h2 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.h3 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.lead { font-size: 18px; color: var(--muted); line-height: 1.6; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---- Layout ---- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.section { padding: 84px 0; }
.section-sm { padding: 52px 0; }
.grad-text {
  background: linear-gradient(95deg, #4F46E5, #7C5CFF 55%, #0EA5E9);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-glow {
  background:
    radial-gradient(60% 120% at 80% -10%, rgba(79,70,229,.10), transparent 60%),
    radial-gradient(50% 100% at 10% 0%, rgba(14,165,233,.08), transparent 55%);
}
.grid-bg {
  background-image:
    linear-gradient(rgba(15,23,42,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,.035) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 14.5px; line-height: 1; cursor: pointer;
  padding: 11px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  transition: all .16s ease; white-space: nowrap; user-select: none;
}
.btn svg, .btn i { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-dark); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #F1F5F9; color: var(--text); }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger-soft); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-lg { padding: 14px 24px; font-size: 15.5px; border-radius: 12px; }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---- Cards ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 24px; }
.card-hover { transition: all .18s ease; }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--border-strong); }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; line-height: 1.2;
}
.badge .dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.badge-success { background: var(--success-soft); color: #15803D; }
.badge-warning { background: var(--warning-soft); color: #B45309; }
.badge-danger { background: var(--danger-soft); color: #B91C1C; }
.badge-info { background: var(--info-soft); color: #0369A1; }
.badge-brand { background: var(--brand-soft); color: var(--brand-dark); }
.badge-muted { background: #F1F5F9; color: var(--muted); }

/* ---- Forms ---- */
.label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.input, .select, .textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 14.5px; color: var(--text);
  font-family: inherit; transition: border .15s, box-shadow .15s;
}
.input::placeholder { color: var(--subtle); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.input-affix { position: relative; }
.input-affix .toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px;
}
.input-affix .toggle:hover { background: #F1F5F9; color: var(--text); }

/* ---- Switch / toggle ---- */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { display: none; }
.switch .track { width: 42px; height: 24px; background: #CBD5E1; border-radius: 999px; transition: .2s; position: relative; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 999px; transition: .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* ---- Nav ---- */
.topnav {
  position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.82);
  backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--border);
}
.topnav .inner { height: 66px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #4F46E5, #7C5CFF); box-shadow: var(--shadow-sm);
}
.navlink { color: var(--muted); font-weight: 500; font-size: 14.5px; padding: 8px 12px; border-radius: 8px; transition: .15s; }
.navlink:hover { color: var(--text); background: #F1F5F9; }

/* ---- Pricing ---- */
.price { font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
.price small { font-size: 15px; font-weight: 500; color: var(--muted); }
.tick { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; font-size: 14.5px; color: #334155; }
.tick i { color: var(--brand); width: 18px; height: 18px; flex: none; margin-top: 1px; }
.ribbon {
  position: absolute; top: 16px; right: 16px; background: var(--brand); color: #fff;
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px;
}

/* ---- Stat tile ---- */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }

/* ---- Table ---- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--subtle); padding: 12px 16px; border-bottom: 1px solid var(--border); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); color: #334155; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #FAFBFC; }

/* ---- Deploy stage tracker ---- */
.tracker { display: flex; align-items: center; width: 100%; }
.tracker .step { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; width: 92px; text-align: center; }
.tracker .dot {
  width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--border-strong); color: var(--subtle); font-weight: 700; font-size: 13px;
}
.tracker .step .lbl { font-size: 12px; color: var(--muted); font-weight: 500; }
.tracker .line { height: 2px; background: var(--border-strong); flex: 1 1 auto; margin-bottom: 26px; border-radius: 2px; }
.tracker .step.done .dot { background: var(--success); border-color: var(--success); color: #fff; }
.tracker .step.done + .line, .tracker .line.done { background: var(--success); }
.tracker .step.active .dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 5px rgba(79,70,229,.16); animation: pulse 1.8s infinite; }
.tracker .step.active .lbl { color: var(--brand); font-weight: 600; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 5px rgba(79,70,229,.16);} 50% { box-shadow: 0 0 0 9px rgba(79,70,229,.06);} }

/* ---- App shell (dashboard / admin) ---- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow:auto; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 14.5px; transition: .14s; margin-bottom: 2px; }
.side-link i { width: 18px; height: 18px; }
.side-link:hover { background: #F1F5F9; color: var(--text); }
.side-link.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.side-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--subtle); padding: 16px 12px 6px; }
.main { padding: 0; background: var(--bg); }
.topbar { height: 64px; background: rgba(255,255,255,.8); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.content { padding: 28px; }
.avatar { width: 34px; height: 34px; border-radius: 999px; background: linear-gradient(135deg,#4F46E5,#7C5CFF); color:#fff; display:grid; place-items:center; font-weight:700; font-size:13px; }

/* ---- Logo chips for agents ---- */
.agent-ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; }
.ic-openclaw { background: linear-gradient(135deg,#F97316,#FB923C); }
.ic-hermes { background: linear-gradient(135deg,#4F46E5,#7C5CFF); }
.ic-n8n { background: linear-gradient(135deg,#EA4B71,#F472B6); }
.ic-soon { background: linear-gradient(135deg,#94A3B8,#CBD5E1); }

/* ---- Misc ---- */
.divider { height: 1px; background: var(--border); border: none; margin: 0; }
.kbd { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; background: #F1F5F9; border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; color: #334155; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
details.faq { border-bottom: 1px solid var(--border); padding: 18px 4px; }
details.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq[open] summary i { transform: rotate(180deg); }
details.faq summary i { transition: .2s; color: var(--muted); }
details.faq p { color: var(--muted); margin: 12px 0 0; }

/* ---- Floating mockup screen switcher ---- */
#mockbar {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90;
  background: rgba(15,23,42,.92); backdrop-filter: blur(8px); border-radius: 999px;
  padding: 6px; display: flex; gap: 2px; box-shadow: var(--shadow-lg); max-width: 94vw; overflow:auto;
}
#mockbar a { color: #CBD5E1; font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 999px; white-space: nowrap; transition: .14s; }
#mockbar a:hover { color: #fff; background: rgba(255,255,255,.1); }
#mockbar a.active { background: #fff; color: #0F172A; }
#mockbar .mb-label { color: #64748B; font-size: 11px; font-weight: 700; padding: 7px 10px; text-transform: uppercase; letter-spacing:.05em; }
@media (max-width: 720px){ #mockbar .mb-label{ display:none; } }
