/* ── HeskAPI Design System ────────────────────────────────────────────────── */

:root {
  --hapi-navy:    #0D1B2A;
  --hapi-navy-90: #0f2035;
  --hapi-blue:    #1A73E8;
  --hapi-blue-d:  #1558b0;
  --hapi-accent:  #00B4D8;
  --hapi-light:   #F0F4F8;
  --hapi-muted:   #4B5563;
  --hapi-border:  #DEE2E6;
  --hapi-success: #22C55E;
}

/* WCAG AA: Bootstrap muted text on the light-grey section bg (contrast fix) */
.bg-hapi-light .text-muted,
.bg-hapi-light .text-body-secondary { color: #4B5563 !important; }

/* ── Base overrides ────────────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #1a1a2e;
}

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.navbar.hapi-nav {
  background-color: var(--hapi-navy) !important;
  border-bottom: 1px solid rgba(255,255,255,.07);
  padding-top: .75rem;
  padding-bottom: .75rem;
}
.navbar.hapi-nav .navbar-brand {
  font-size: 1.25rem;
  letter-spacing: -.015em;
  color: #fff !important;
}
.navbar.hapi-nav .nav-link {
  color: rgba(255,255,255,.8) !important;
  font-size: .9rem;
  padding-left: .9rem !important;
  padding-right: .9rem !important;
  transition: color .15s;
}
.navbar.hapi-nav .nav-link:hover,
.navbar.hapi-nav .nav-link.active {
  color: #fff !important;
}
.btn-hapi {
  background-color: var(--hapi-blue);
  border-color: var(--hapi-blue);
  color: #fff;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}
.btn-hapi:hover {
  background-color: var(--hapi-blue-d);
  border-color: var(--hapi-blue-d);
  color: #fff;
}
.btn-hapi-outline {
  border: 2px solid rgba(255,255,255,.6);
  color: #fff;
  font-weight: 600;
  background: transparent;
  transition: background .15s, border-color .15s;
}
.btn-hapi-outline:hover {
  border-color: #fff;
  background: rgba(255,255,255,.1);
  color: #fff;
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hapi-hero {
  background: linear-gradient(135deg, var(--hapi-navy) 0%, #0f2a45 100%);
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hapi-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(0,180,216,.12) 0%, transparent 65%);
  pointer-events: none;
}
.hapi-hero .container { position: relative; z-index: 1; }
.hapi-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  color: #fff;
  letter-spacing: -.03em;
}
.hapi-hero .hero-sub {
  font-size: 1.15rem;
  color: rgba(255,255,255,.75);
  max-width: 520px;
  line-height: 1.6;
}

/* ── Trust strip ───────────────────────────────────────────────────────────── */
.hapi-trust {
  background: var(--hapi-light);
  border-top: 1px solid var(--hapi-border);
  border-bottom: 1px solid var(--hapi-border);
  padding: .9rem 0;
  font-size: .85rem;
  color: var(--hapi-muted);
  font-weight: 500;
  letter-spacing: .01em;
}
.hapi-trust .sep { margin: 0 .6rem; opacity: .5; }

/* ── Screenshot card ───────────────────────────────────────────────────────── */
.hapi-screenshot {
  background: #111827;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.08);
}
.hapi-screenshot .ss-bar {
  display: flex;
  gap: .4rem;
  margin-bottom: .8rem;
}
.hapi-screenshot .ss-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.hapi-screenshot .ss-dot-r { background: #FF5F57; }
.hapi-screenshot .ss-dot-y { background: #FFBD2E; }
.hapi-screenshot .ss-dot-g { background: #28CA41; }
.hapi-screenshot img { border-radius: 6px; width: 100%; display: block; }

/* ── Section headings ──────────────────────────────────────────────────────── */
.hapi-section-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--hapi-navy);
  letter-spacing: -.025em;
}
.hapi-section-sub {
  color: var(--hapi-muted);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Feature cards ─────────────────────────────────────────────────────────── */
.hapi-feature-card {
  border: 1px solid var(--hapi-border);
  border-radius: 10px;
  padding: 1.5rem;
  height: 100%;
  background: #fff;
  transition: box-shadow .2s, transform .2s;
}
.hapi-feature-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.hapi-feature-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26,115,232,.1);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}
.hapi-feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .4rem;
  color: var(--hapi-navy);
}
.hapi-feature-card p {
  font-size: .9rem;
  color: var(--hapi-muted);
  margin: 0;
  line-height: 1.55;
}

/* ── Webhook strip ─────────────────────────────────────────────────────────── */
.hapi-webhook-strip {
  background: linear-gradient(90deg, #0f2a45 0%, var(--hapi-navy) 100%);
  border-radius: 12px;
  padding: 2.5rem;
  border: 1px solid rgba(255,255,255,.08);
}

/* ── Pricing table ─────────────────────────────────────────────────────────── */
.hapi-pricing-card {
  border: 2px solid var(--hapi-border);
  border-radius: 12px;
  padding: 2rem;
  background: #fff;
  height: 100%;
  position: relative;
  transition: box-shadow .2s;
}
.hapi-pricing-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,.1);
}
.hapi-pricing-card.featured {
  border-color: var(--hapi-blue);
  box-shadow: 0 0 0 1px var(--hapi-blue), 0 8px 32px rgba(26,115,232,.15);
}
.hapi-pricing-card .price-amount {
  font-size: 2.75rem;
  font-weight: 900;
  color: var(--hapi-navy);
  line-height: 1;
  letter-spacing: -.04em;
}
.hapi-pricing-card .price-per {
  font-size: .85rem;
  color: var(--hapi-muted);
}
.hapi-pricing-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--hapi-blue);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .8rem;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.hapi-check-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.hapi-check-list li {
  padding: .35rem 0;
  font-size: .9rem;
  color: #374151;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.hapi-check-list li::before {
  content: '✓';
  color: #16A34A;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Bundle box ────────────────────────────────────────────────────────────── */
.hapi-bundle-box {
  background: linear-gradient(135deg, var(--hapi-navy) 0%, #0f2a45 100%);
  border-radius: 12px;
  padding: 2.5rem;
  border: 1px solid rgba(255,255,255,.1);
  color: #fff;
}
.hapi-bundle-badge {
  background: #f59e0b;
  color: #000;
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .6rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── FAQ accordion ─────────────────────────────────────────────────────────── */
.hapi-faq .accordion-button {
  font-weight: 600;
  color: var(--hapi-navy);
  background: #fff;
}
.hapi-faq .accordion-button:not(.collapsed) {
  color: var(--hapi-blue);
  background: #f0f7ff;
  box-shadow: none;
}
.hapi-faq .accordion-button::after {
  filter: none;
}
.hapi-faq .accordion-item {
  border: 1px solid var(--hapi-border);
  margin-bottom: .5rem;
  border-radius: 8px !important;
  overflow: hidden;
}
.hapi-faq .accordion-body {
  font-size: .95rem;
  color: #374151;
  line-height: 1.65;
}

/* ── CTA banner ────────────────────────────────────────────────────────────── */
.hapi-cta-banner {
  background: var(--hapi-blue);
  background: linear-gradient(135deg, var(--hapi-blue) 0%, #0ea5e9 100%);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  color: #fff;
}
.hapi-cta-banner h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: .5rem;
}
.hapi-cta-banner p {
  opacity: .9;
  margin-bottom: 1.5rem;
}

/* ── Code block ────────────────────────────────────────────────────────────── */
.hapi-code {
  background: #0d1117;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  border: 1px solid rgba(255,255,255,.07);
}
.hapi-code pre {
  margin: 0;
  color: #e6edf3;
  font-size: .85rem;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  line-height: 1.7;
  white-space: pre;
}
.hapi-code .token-key    { color: #79c0ff; }
.hapi-code .token-string { color: #a5d6ff; }
.hapi-code .token-num    { color: #ff7b72; }
.hapi-code .token-bool   { color: #ffa657; }
.hapi-code .token-null   { color: #8b949e; }

/* ── Docs sidebar layout ───────────────────────────────────────────────────── */
.hapi-docs-nav {
  position: sticky;
  top: 1.5rem;
}
.hapi-docs-nav .nav-link {
  font-size: .875rem;
  color: var(--hapi-muted);
  padding: .3rem .75rem;
  border-left: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.hapi-docs-nav .nav-link:hover,
.hapi-docs-nav .nav-link.active {
  color: var(--hapi-blue);
  border-left-color: var(--hapi-blue);
}

/* ── Table ─────────────────────────────────────────────────────────────────── */
.hapi-table {
  font-size: .875rem;
}
.hapi-table thead th {
  background: var(--hapi-navy);
  color: #fff;
  font-weight: 600;
  border: none;
}
.hapi-table code {
  background: #f0f4f8;
  color: #d63384;
  padding: .1rem .3rem;
  border-radius: 4px;
  font-size: .8rem;
}

/* ── Badge pill ────────────────────────────────────────────────────────────── */
.badge-hesk {
  background: rgba(26,115,232,.1);
  color: var(--hapi-blue);
  font-size: .75rem;
  font-weight: 600;
  padding: .25rem .6rem;
  border-radius: 20px;
  border: 1px solid rgba(26,115,232,.2);
}
.badge-get    { background: #d1fae5; color: #065f46; font-size:.7rem; font-weight:700; padding:.1rem .45rem; border-radius:4px; }
.badge-post   { background: #dbeafe; color: #1e3a8a; font-size:.7rem; font-weight:700; padding:.1rem .45rem; border-radius:4px; }
.badge-delete { background: #fee2e2; color: #7f1d1d; font-size:.7rem; font-weight:700; padding:.1rem .45rem; border-radius:4px; }

/* ── Step dots ─────────────────────────────────────────────────────────────── */
.hapi-steps { counter-reset: steps; }
.hapi-step {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  align-items: flex-start;
}
.hapi-step-num {
  counter-increment: steps;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--hapi-blue);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hapi-step-num::before { content: counter(steps); }
.hapi-step-body h4 { font-size: 1rem; font-weight: 700; color: var(--hapi-navy); margin-bottom: .25rem; }
.hapi-step-body p  { font-size: .9rem; color: var(--hapi-muted); margin: 0; }

/* ── Renewal / form ────────────────────────────────────────────────────────── */
.hapi-form-card {
  background: #fff;
  border: 1px solid var(--hapi-border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
}

/* ── Admin panel ───────────────────────────────────────────────────────────── */
.hapi-admin-table td, .hapi-admin-table th { font-size: .85rem; }
.status-pending  { color: #d97706; font-weight:600; }
.status-active   { color: #16a34a; font-weight:600; }
.status-expired  { color: #dc2626; font-weight:600; }

/* ── Mobile: long inline code tokens (URLs/JSON) wrap instead of overflowing ──── */
code { overflow-wrap: anywhere; }
.hapi-code, .hapi-code pre { overflow-wrap: normal; }   /* scrollable code blocks keep their own overflow-x:auto */
.status-revoked  { color: #6b7280; font-weight:600; }

/* ── Footer ────────────────────────────────────────────────────────────────── */
footer.hapi-footer {
  background: var(--hapi-navy);
  color: rgba(255,255,255,.6);
  border-top: 1px solid rgba(255,255,255,.07);
  margin-top: 0;
  padding: 2.5rem 0 1.5rem;
}
footer.hapi-footer a {
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: color .15s;
}
footer.hapi-footer a:hover { color: #fff; }
footer.hapi-footer .footer-nav a {
  font-size: .85rem;
}
footer.hapi-footer .footer-legal {
  border-top: 1px solid rgba(255,255,255,.07);
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  font-size: .8rem;
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.text-hapi-blue   { color: var(--hapi-blue) !important; }
.text-hapi-accent { color: var(--hapi-accent) !important; }
.text-hapi-navy   { color: var(--hapi-navy) !important; }
.bg-hapi-navy     { background-color: var(--hapi-navy) !important; }
.bg-hapi-light    { background-color: var(--hapi-light) !important; }
.section-pad      { padding: 4.5rem 0; }
.section-pad-sm   { padding: 3rem 0; }
