/* Akretion ERP — mobile-first. Designed at 390px, enhanced upward.
   No framework, no build step: this file is the whole design system. */

:root {
  --ink: #0a0f1e;
  --ink-2: #1b2440;
  --paper: #ffffff;
  --paper-2: #f6f7fb;
  --line: #e3e6ef;
  --muted: #5b6478;
  --brand: #5b4bff;
  --brand-dark: #4536e8;
  --accent: #ffb020;
  --ok: #0fa36b;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(10, 15, 30, .06), 0 12px 32px rgba(10, 15, 30, .07);
  --shadow-lg: 0 24px 64px rgba(10, 15, 30, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper);
  line-height: 1.55; font-size: 16px; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); /* room for mobile CTA */
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 750; }
h1 { font-size: clamp(2rem, 8.6vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 5.4vw, 2.3rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .9em; background: var(--paper-2); padding: .12em .4em; border-radius: 6px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 720px; }
.center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.muted-small { color: var(--muted); font-size: .875rem; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; border-radius: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 650; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .18s ease, background-color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.995); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 20px rgba(91, 75, 255, .32); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--paper-2); }
.btn-lg { min-height: 54px; padding: 0 24px; font-size: 1.02rem; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn.is-disabled { opacity: .45; pointer-events: none; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(10, 15, 30, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255,255,255,.08); }
.nav-inner { display: flex; align-items: center; gap: 12px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 750; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 0 4px rgba(255,176,32,.18); }
.brand-tag { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; background: rgba(255,255,255,.14); padding: 2px 6px; border-radius: 5px; color: #dfe3f2; }
.nav-links { display: none; gap: 22px; margin-left: auto; }
.nav-links a { color: #c9cfe4; font-size: .93rem; font-weight: 550; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.nav-actions .btn-ghost { color: #e8ebf5; display: none; }
.nav-actions .btn-primary { min-height: 42px; padding: 0 16px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 8% 0%, #1d2a63 0%, #0a0f1e 55%, #070a14 100%); color: #fff; padding: 56px 0 48px; }
.hero-glow { position: absolute; inset: -30% -10% auto auto; width: 70vw; height: 70vw; max-width: 720px; max-height: 720px; background: radial-gradient(circle at 30% 30%, rgba(91,75,255,.55), transparent 62%), radial-gradient(circle at 70% 60%, rgba(255,176,32,.22), transparent 60%); filter: blur(20px); pointer-events: none; animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-4%, 4%, 0) scale(1.06); } }
.hero-inner { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: #b9c1de; margin-bottom: 18px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(15,163,107,.7); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(15,163,107,0); } 100% { box-shadow: 0 0 0 0 rgba(15,163,107,0); } }
.hero h1 { max-width: 18ch; }
.lede { font-size: 1.06rem; color: #c7cde0; max-width: 56ch; }
.hero-actions { display: flex; flex-direction: column; gap: 10px; margin: 26px 0 30px; }
.hero-proof { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .9rem; color: #b9c1de; }
.hero-proof li::before { content: "✓"; color: var(--ok); margin-right: 8px; font-weight: 700; }

/* ---------- strip ---------- */
.strip { background: #fff; border-bottom: 1px solid var(--line); }
.strip-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 8px; padding: 18px 20px; text-align: center; }
.strip-inner strong { display: block; font-size: .95rem; letter-spacing: -.01em; }
.strip-inner span { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ---------- sections ---------- */
.section { padding: 52px 0; }
.section-alt { background: var(--paper-2); }
.section-dark { background: var(--ink); color: #fff; }
.section-dark .section-head p, .section-dark .agent-note { color: #b9c1de; }
.section-dark a { color: #fff; }
.section-head { max-width: 620px; margin-bottom: 28px; }
.section-head p { color: var(--muted); margin: 0; }
.section-form { min-height: 60vh; }

/* ---------- plans ---------- */
.plans { display: grid; gap: 16px; }
.plan { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.plan-featured { border-color: rgba(91,75,255,.5); box-shadow: 0 18px 48px rgba(91,75,255,.16); }
.plan-badge { position: absolute; top: -12px; left: 20px; margin: 0; background: var(--brand); color: #fff; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; }
.plan h3 { font-size: 1.3rem; margin-bottom: .2em; }
.plan-tag { color: var(--muted); font-size: .92rem; min-height: 2.6em; }
.plan-price { display: flex; align-items: baseline; gap: 2px; margin: 8px 0 0; }
.plan-price .cur { font-size: 1rem; color: var(--muted); }
.plan-price .val { font-size: 2.6rem; font-weight: 780; letter-spacing: -.03em; }
.plan-price .per { color: var(--muted); }
.plan-annual { font-size: .82rem; color: var(--muted); margin-bottom: 14px; }
.plan-limits { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 16px; }
.plan-limits li { font-size: .78rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.plan-features { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; font-size: .92rem; }
.plan-features li { padding-left: 22px; position: relative; }
.plan-features li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.plan-not { font-size: .8rem; color: var(--muted); margin: 0 0 16px; }
.plan .btn { margin-top: auto; }
.plans-note { font-size: .88rem; color: var(--muted); margin-top: 20px; }

/* ---------- steps ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: s; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step-n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(91,75,255,.1); color: var(--brand); font-weight: 750; margin-bottom: 10px; }
.steps p { margin: 0; color: var(--muted); font-size: .93rem; }

/* ---------- faq ---------- */
.faq { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 620; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--brand); line-height: 1; }
.faq[open] summary::after { content: "–"; }
.faq p { color: var(--muted); margin: 0 0 16px; font-size: .95rem; }

/* ---------- agents ---------- */
.agent-grid { display: grid; gap: 10px; }
.agent-card { display: flex; flex-direction: column; gap: 4px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-sm); padding: 16px; }
.agent-card:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.agent-card code { background: rgba(255,255,255,.14); color: #fff; align-self: flex-start; }
.agent-card span { font-size: .85rem; color: #b9c1de; }
.agent-note { font-size: .88rem; margin-top: 16px; }
.section-dark .agent-note code { background: rgba(255,255,255,.14); color: #fff; }

/* ---------- cta ---------- */
.cta-final h2 { margin-bottom: .3em; }
.cta-final p { color: var(--muted); margin-bottom: 22px; }

/* ---------- forms ---------- */
.crumb { font-size: .85rem; margin-bottom: 10px; }
.form-title { margin-bottom: .25em; }
.form-sub { color: var(--muted); max-width: 60ch; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; box-shadow: var(--shadow); }
.field { margin-bottom: 18px; }
.field label, .field-group legend { display: block; font-weight: 620; font-size: .9rem; margin-bottom: 6px; }
.field input {
  width: 100%; min-height: 50px; padding: 12px 14px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #cfd4e2; border-radius: var(--radius-sm);
}
.field input:focus { outline: 3px solid rgba(91,75,255,.18); border-color: var(--brand); }
.hint { font-size: .8rem; color: var(--muted); margin: 6px 0 0; }
.opt { font-weight: 400; color: var(--muted); font-size: .82em; }
.field-group { border: 0; padding: 0; margin: 0 0 20px; }
.plan-picker { display: grid; gap: 8px; }
.plan-option { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.plan-option input { position: absolute; opacity: 0; pointer-events: none; }
.plan-option.is-on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91,75,255,.12); }
.po-name { font-weight: 650; }
.po-price { font-weight: 700; text-align: right; }
.po-lim { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
.legal { font-size: .78rem; color: var(--muted); margin: 14px 0 0; }
.alert { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .92rem; }
.dev-box { margin-top: 24px; padding: 16px; border: 1px dashed #cfd4e2; border-radius: var(--radius-sm); background: var(--paper-2); }
.dev-title { font-weight: 650; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.dev-form { display: flex; gap: 8px; flex-wrap: wrap; }
.dev-form input { flex: 1 1 200px; min-height: 46px; padding: 10px 12px; border: 1px solid #cfd4e2; border-radius: var(--radius-sm); font: inherit; }
.auth-grid { display: grid; gap: 10px; margin-top: 22px; }
.gicon { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--paper-2); font-weight: 750; font-size: .8rem; }

/* ---------- status / tables ---------- */
.status-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: #fff; box-shadow: var(--shadow); margin: 24px 0; }
.status-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.badge { display: inline-block; font-size: .74rem; font-weight: 650; letter-spacing: .03em; padding: 4px 10px; border-radius: 999px; background: var(--paper-2); color: var(--muted); border: 1px solid var(--line); text-transform: lowercase; }
.badge-ready { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge-queued, .badge-provisioning { background: #fff7ed; color: #b45309; border-color: #fed7aa; }
.badge-failed, .badge-cancelled { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.timeline { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; counter-reset: t; }
.timeline li { position: relative; padding-left: 26px; color: var(--muted); font-size: .92rem; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 6px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #cfd4e2; background: #fff; }
.timeline li.on { color: var(--ink); font-weight: 600; }
.timeline li.on::before { border-color: var(--ok); background: var(--ok); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: var(--paper-2); }
.table tr:last-child td { border-bottom: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 20px; }
.count { font-size: .8rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); }
.count.is-on { border-color: var(--brand); color: var(--brand); background: rgba(91,75,255,.06); }
.count strong { color: var(--ink); margin-left: 4px; }
.empty { text-align: center; padding: 40px 20px; border: 1px dashed #cfd4e2; border-radius: var(--radius); color: var(--muted); }

/* ---------- footer / mobile CTA ---------- */
.footer { background: var(--ink); color: #b9c1de; padding: 36px 0 28px; font-size: .88rem; }
.footer-inner { display: grid; gap: 18px; }
.footer-brand { color: #fff; font-weight: 700; margin-bottom: 6px; }
.footer-note { margin: 0; font-size: .82rem; max-width: 44ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.footer-links a { color: #b9c1de; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); font-size: .76rem; }
.mobile-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: center; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.mobile-cta-price { display: flex; flex-direction: column; line-height: 1.2; }
.mobile-cta-price strong { font-size: .95rem; }
.mobile-cta-price span { font-size: .72rem; color: var(--muted); }
.mobile-cta .btn { margin-left: auto; min-width: 130px; }

/* ---------- enhancement: tablet ---------- */
@media (min-width: 640px) {
  .strip-inner { grid-template-columns: repeat(5, 1fr); }
  .plans { grid-template-columns: 1fr 1fr; }
  .agent-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .hero-actions { flex-direction: row; }
  .auth-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1.4fr 1fr; }
}

/* ---------- enhancement: desktop ---------- */
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .mobile-cta { display: none; }
  .nav-links { display: flex; }
  .nav-actions { margin-left: 0; }
  .nav-actions .btn-ghost { display: inline-flex; }
  .hero { padding: 92px 0 76px; }
  .lede { font-size: 1.18rem; }
  .section { padding: 76px 0; }
  .plans { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .plan-featured { transform: translateY(-8px); }
  .agent-grid { grid-template-columns: repeat(4, 1fr); }
  .card { padding: 32px 28px; }
  .plan-picker { grid-template-columns: repeat(3, 1fr); }
  .plan-option { grid-template-columns: 1fr; text-align: center; }
  .po-price { text-align: center; }
  .po-lim { grid-column: 1; }
}

/* ---------- responsive tables (card layout on phones) ---------- */
@media (max-width: 719px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table td { border: 0; padding: 6px 14px; }
  .table td::before { content: attr(data-label); display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
  .table-wrap { border-radius: var(--radius-sm); }
}

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

@media print {
  .nav, .mobile-cta, .footer { display: none; }
  body { padding: 0; }
}
