/* ============================================================
   SWIFTLY — SHARED STYLESHEET v1.0
   Single source of truth for design tokens + components.
   Imported by every page (index, platform, voice, chat,
   swiftstream, pricing).
   ============================================================ */

/* ---------- DESIGN TOKENS ---------- */
:root {
  /* Brand blues */
  --blue-50:  #EAF4FF;
  --blue-100: #D6E9FF;
  --blue-200: #A8CFFF;
  --blue-400: #5BA8F5;
  --blue-500: #3B8DEC;
  --blue-600: #2E72D9;

  /* Brand gradients */
  --grad: linear-gradient(135deg, #7CC1FF 0%, #3B8DEC 100%);
  --grad-soft: linear-gradient(180deg, #F4FAFF 0%, #E8F2FF 100%);

  /* Neutrals */
  --ink: #0B1220;
  --ink-2: #1A2238;
  --slate: #475569;
  --slate-2: #64748B;
  --line: #E2E8F0;
  --line-2: #CBD5E1;
  --paper: #FBFCFE;
  --paper-2: #FFFFFF;

  /* Signal */
  --warn: #FF6B35;
  --success: #10B981;
  --success-bg: #ECFDF5;
  --success-border: #A7F3D0;

  /* Spacing */
  --space-section: 120px;
  --space-section-mobile: 80px;
  --max-width: 1280px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 100px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* ---------- NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(251, 252, 254, 0.85);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo-img {
  height: 36px;
  width: auto;
  max-width: 160px;
  display: block;
}
.logo-mark {
  width: 28px; height: 28px;
  background: var(--grad);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  -webkit-text-fill-color: #fff;
}
.nav-links {
  display: flex;
  gap: 32px;
  font-size: 14px;
  color: var(--slate);
  font-weight: 500;
}
.nav-links a { transition: color 0.15s; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--blue-600); font-weight: 600; }
.nav-cta { display: flex; gap: 12px; align-items: center; }

/* ---------- BUTTONS ---------- */
.btn {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 16px rgba(59, 141, 236, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(59, 141, 236, 0.35);
}
.btn-dark {
  background: var(--ink);
  color: #fff;
}
.btn-dark:hover { background: var(--ink-2); }
.btn-lg { padding: 16px 28px; font-size: 16px; border-radius: 12px; }

/* ---------- COMMON HEADINGS ---------- */
.section-eyebrow {
  font-family: 'Inter Tight', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-600);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.section-eyebrow::before {
  content: '';
  width: 24px; height: 2px;
  background: var(--grad);
  border-radius: 2px;
}
.section-h {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 800;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  max-width: 18ch;
  color: var(--ink);
}
.section-h em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-sub {
  color: var(--slate);
  font-size: 17px;
  line-height: 1.55;
  max-width: 60ch;
  margin-bottom: 56px;
}

/* ---------- SECTION SHELLS ---------- */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-section) 32px;
}
.section.dark {
  background: var(--ink);
  color: #fff;
  position: relative;
  overflow: hidden;
  max-width: none;
  padding: var(--space-section) 0;
}
.section.dark::before {
  content: '';
  position: absolute;
  top: -300px; right: -300px;
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(59, 141, 236, 0.2) 0%, transparent 60%);
  pointer-events: none;
}
.section.dark .section-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}
.section.dark .section-h { color: #fff; }
.section.dark .section-eyebrow { color: var(--blue-200); }
.section.dark .section-eyebrow::before { background: var(--blue-200); }
.section.dark .section-sub { color: rgba(255, 255, 255, 0.7); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 96px 32px 80px;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 1200px; height: 700px;
  background: radial-gradient(ellipse at center, rgba(124, 193, 255, 0.35) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-600);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 32px;
  padding: 8px 16px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-pill);
}
.hero-eyebrow .dot {
  width: 6px; height: 6px;
  background: var(--blue-500);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--blue-400);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.hero h1 {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 800;
  font-size: clamp(48px, 7.5vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.04em;
  max-width: 18ch;
  margin: 0 auto 32px;
  color: var(--ink);
}
.hero h1 em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: 20px;
  line-height: 1.5;
  color: var(--slate);
  max-width: 60ch;
  margin: 0 auto 40px;
}
.hero-sub strong { color: var(--ink); font-weight: 600; }
.hero-cta {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.hero-meta {
  display: inline-flex;
  gap: 32px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--slate);
  font-weight: 500;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta span::before {
  content: '✓';
  color: var(--blue-500);
  font-weight: 700;
}

/* ---------- CARDS ---------- */
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 32px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  border-color: var(--blue-200);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -12px rgba(59, 141, 236, 0.2);
}
.card-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-500);
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}
.card h3 {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--ink);
}
.card p {
  color: var(--slate);
  font-size: 15px;
  line-height: 1.55;
}

/* ---------- BADGES ---------- */
.badge {
  font-family: 'Inter Tight', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.badge.live {
  color: #047857;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
}
.badge.live::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}
.badge.info {
  color: var(--blue-600);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
}
.badge.warn {
  color: #C2410C;
  background: #FFF7ED;
  border: 1px solid #FED7AA;
}
.badge.beta {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
}

/* ---------- FOOTER ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--ink);
  color: rgba(255, 255, 255, 0.7);
  padding: 64px 32px 32px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand .logo {
  margin-bottom: 16px;
}
.footer-brand p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.55);
  max-width: 32ch;
}
.footer-col h4 {
  font-family: 'Inter Tight', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { padding: 6px 0; }
.footer-col a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.15s;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* ---------- FOOTER CTA SECTION ---------- */
.cta-block {
  padding: 120px 32px;
  text-align: center;
  background: var(--grad-soft);
  border-top: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.cta-block::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(124, 193, 255, 0.3) 0%, transparent 60%);
  pointer-events: none;
}
.cta-block-inner { position: relative; z-index: 2; }
.cta-block h2 {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 800;
  font-size: clamp(40px, 6vw, 80px);
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  max-width: 18ch;
  margin-left: auto;
  margin-right: auto;
  color: var(--ink);
}
.cta-block h2 em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cta-block p {
  color: var(--slate);
  font-size: 18px;
  max-width: 50ch;
  margin: 0 auto 40px;
}

/* ---------- TIER CARDS ---------- */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.tier {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 32px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.tier:hover {
  border-color: var(--blue-200);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px -16px rgba(59, 141, 236, 0.25);
}
.tier.featured {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.tier.featured::before {
  content: 'MOST POPULAR';
  position: absolute;
  top: -12px;
  left: 32px;
  background: var(--grad);
  color: #fff;
  font-family: 'Inter Tight', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.tier-name {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.tier.featured .tier-name {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tier-tag {
  color: var(--slate);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.4;
}
.tier.featured .tier-tag { color: rgba(255, 255, 255, 0.65); }
.tier-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}
.tier-price .num {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 800;
  font-size: 48px;
  letter-spacing: -0.03em;
}
.tier-price .unit { color: var(--slate); font-size: 15px; }
.tier.featured .tier-price .unit { color: rgba(255, 255, 255, 0.6); }
.tier-billing {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--slate-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 28px;
}
.tier.featured .tier-billing { color: rgba(255, 255, 255, 0.5); }
.tier ul {
  list-style: none;
  margin-bottom: 32px;
  flex-grow: 1;
}
.tier ul li {
  padding: 10px 0;
  font-size: 14px;
  color: var(--slate);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: start;
}
.tier.featured ul li {
  color: rgba(255, 255, 255, 0.75);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.tier ul li::before {
  content: '✓';
  color: var(--blue-500);
  font-weight: 700;
}
.tier.featured ul li::before { color: var(--blue-200); }
.tier .btn { width: 100%; padding: 14px; justify-content: center; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  :root {
    --space-section: var(--space-section-mobile);
  }
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .tier-grid { grid-template-columns: 1fr; }
  .hero { padding: 64px 24px; }
  .section { padding: 80px 24px; }
}

/* ==== AskSquirrel UI fixes (appended) ==== */
/* ==========================================================================
   AskSquirrel — UI fixes
   Each rule targets a measured defect (bounding-box scan at 1440/768/390).
   Loaded after bootstrap + custom.css so it only overrides, never rewrites.
   ========================================================================== */

/* 1. Images can never overflow their box (broken/oversized logos pushed rows wide) */
img { max-width: 100%; height: auto; }

/* 2. Horizontal bleed: Bootstrap .row uses negative margins, so at <=575px the
   row is wider than its container (measured 383px row inside a 362px wrapper).
   That is what makes cards/edges look overlapped and pushed off-screen. */
@media (max-width: 991.98px) {
  .row { margin-left: 0 !important; margin-right: 0 !important; }
  .row > [class*="col"] { padding-left: .5rem !important; padding-right: .5rem !important; }
  .main-wrapper, .container, .container-fluid, #billingSection { overflow-x: hidden; }
}

/* 3. Nothing may cause the page to scroll sideways */
html, body { max-width: 100%; overflow-x: hidden; }

/* 4. Long strings (emails, urls, ids, hashes in tables/cards) wrap instead of
   pushing the layout wider than the viewport */
.card, .card-body, .list-group-item, .modal-body, .table td, .table th,
.badge, .text-truncate-none, .user-email, td, th { overflow-wrap: anywhere; }

/* 5. Code / JSON dumps inside <pre> were 614px wide in a 331px box */
pre { overflow-x: auto; -webkit-overflow-scrolling: touch; }
pre, pre code { white-space: pre-wrap !important; word-break: break-word !important; }

/* 6. Buttons with long labels (top-up buttons) overflowed to 416px on a 390px screen */
.btn { white-space: normal; }
@media (max-width: 575.98px) {
  .btn { max-width: 100%; }
  .btn-group, .d-flex.gap-2, .card-actions { flex-wrap: wrap; }
}

/* 7. App navbar: allow wrap so nav items never sit on top of the logo */
.navbar, .navbar > .container, .navbar > .container-fluid { flex-wrap: wrap; gap: .25rem; }
.navbar-brand { flex-shrink: 0; }
.navbar-brand img, img.navbar-logo { max-height: 38px; width: auto; }

/* 8. Off-canvas activity panel must never be wider than the viewport */
.activity-sidebar, .offcanvas, .modal { max-width: 100vw; }
@media (max-width: 575.98px) {
  .modal-dialog { margin: .5rem; max-width: calc(100vw - 1rem); }
  .offcanvas { width: 100vw !important; }
}

/* 9. Charts: Apex/metric containers keep their own scroll, never the page's */
.apexcharts-canvas, .apexcharts-canvas svg, .chart-container { max-width: 100% !important; }
.card-body > .apexcharts-canvas { overflow: hidden; }

/* 10. Tables: keep them inside their card on small screens */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 11. Marketing masthead (home): nav spilled 56px past a 390px viewport */
@media (max-width: 720px) {
  .masthead { flex-wrap: wrap; height: auto !important; padding: .65rem 1rem !important; gap: .5rem; }
  .masthead-brand { border-right: 0 !important; padding-right: 0 !important; }
  .masthead-brand img { height: 30px !important; }
  .masthead-nav { width: 100%; flex-wrap: wrap; gap: .5rem 1rem !important; justify-content: flex-start; }
  .masthead-nav a { font-size: .72rem !important; }
  .masthead-nav .nav-cta, .masthead-nav .nav-login { padding: .4rem .8rem; color: #fff; }
}

/* 12. Marketing launch pages (pricing/voice/chat/platform): .nav-cta spilled
   235px past a 390px viewport, and the CTA label rendered dark-on-dark */
@media (max-width: 860px) {
  .nav-inner { flex-wrap: wrap; gap: .5rem !important; }
  .nav-inner .logo-img { max-height: 30px; }
  .nav-links { flex-wrap: wrap; gap: .5rem 1rem !important; }
  .nav-cta { max-width: 100%; flex: 0 1 auto; }
  .nav-cta > a, .nav-cta .btn { max-width: 100%; }
}
.nav-cta, .masthead-nav .nav-cta { color: #fff !important; }
.nav-cta:hover, .masthead-nav .nav-cta:hover { color: #fff !important; }

/* 13. Card grids: equal heights stop one card's shadow/edge sitting on the next */
@media (min-width: 768px) {
  .pricing-grid, .cards, .row.g-3 > [class*="col"] { display: flex; }
  .pricing-card, .card { height: 100%; }
}

/* 14. Focus rings must not paint over neighbouring text */
a:focus-visible, button:focus-visible { outline-offset: 2px; }

/* 15. Feature comparison table (760px wide inside a 390px viewport, bodyW 795):
   give the wrapper a hard width so the table scrolls inside it, never the page */
.matrix-wrap { max-width: 100%; }
@media (max-width: 900px) {
  .matrix-wrap { width: 100%; max-width: 100%; overflow-x: auto !important;
                 -webkit-overflow-scrolling: touch; }
  table.matrix { min-width: 700px; }
  section.section { max-width: 100%; overflow-x: clip; }
}

/* 16. Marketing nav buttons wrapped to two lines inside the header at 390px */
@media (max-width: 860px) {
  .nav-inner .btn, .nav-cta .btn, .masthead-nav a.nav-cta, .masthead-nav a.nav-login {
    white-space: nowrap !important;
    font-size: .76rem !important;
    padding: .45rem .7rem !important;
  }
  .nav-inner, .masthead { row-gap: .5rem; }
}
