/* ==========================================================================
   JURE POS - DEPLOYED BUILD AUDITOR REMEDIATION PATCH (v2.1 - Multi-Vertical)
   Target: https://www.jurepos.com/index-b.html & index.html
   ========================================================================== */

:root {
  --jure-bg-dark: #0b1120;
  --jure-card-dark: #111827;
  --jure-surface-dark: #020617;
  --jure-border-dark: #1e293b;
  --jure-text-light: #f8fafc;
  --jure-text-muted: #cbd5e1;
  --jure-emerald: #10b981;
  --jure-emerald-hover: #059669;
}

/* 1. Sticky Header Offset for All Hash Anchors (#features, #solutions, #sandbox, #pricing, #faq) */
section[id] {
  scroll-margin-top: 84px;
}

/* 2. Mobile Sticky Bottom CTA & Safe-Area Clearance (Prevents Footer Slicing on 360px Viewports) */
.mobile-sticky-cta {
  display: none;
}

@media (max-width: 1023px) {
  body {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 16px));
  }

  .main-footer {
    padding-bottom: calc(3rem + env(safe-area-inset-bottom, 16px));
  }
}

@media (max-width: 767px) {
  .mobile-sticky-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 950;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
    background: rgba(11, 17, 32, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--jure-border-dark);
    box-shadow: 0 -8px 24px rgba(2, 6, 23, 0.25);
  }

  .mobile-sticky-cta-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .mobile-sticky-cta-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--jure-text-light);
    line-height: 1.2;
  }

  .mobile-sticky-cta-sub {
    font-size: 0.72rem;
    color: var(--jure-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* 3. Universal Button & CTA Centering Lock (Phase 3 Standard) */
.btn-jure,
a[href*="auth"]:not(.drawer-link),
button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  line-height: 1.2;
  min-height: 44px;
  padding: 0.65rem 1.25rem;
  text-indent: 0;
  overflow: visible;
  max-width: 100%;
}

/* Keep header actions compact on narrow 360px screens */
@media (max-width: 767px) {
  .main-header .nav-container {
    padding: 0.5rem 0.85rem;
  }

  .main-header .nav-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }

  .main-header .sign-in-link {
    padding: 0.35rem 0.5rem;
    min-height: 36px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .main-header .hidden-mobile {
    display: none !important;
  }
}

/* 4. Eyebrow Pill & Badge Wrapping Lock (Prevents 360px Left/Right Text Bleed) */
.eyebrow-badge,
.sandbox-badge,
.hero-badge,
.badge-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  white-space: normal;
  flex-wrap: wrap;
  max-width: 100%;
  line-height: 1.35;
  padding: 0.375rem 0.85rem;
}

.brand-watermark-bar,
.watermark-bar {
  background-color: var(--jure-surface-dark);
  color: var(--jure-text-light);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  text-align: center;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--jure-border-dark);
}

.brand-watermark-bar .watermark-text,
.watermark-bar span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.brand-watermark-bar a,
.watermark-bar a {
  color: #34d399;
  text-decoration: underline;
  font-weight: 700;
}

.brand-watermark-bar .shield-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #34d399;
}

/* 5. Critical Fix for BUG-01: Interactive Sandbox High-Contrast Surface Enforcement */
#sandbox,
.sandbox-section,
.interactive-showcase-section {
  background: var(--jure-bg-dark) !important;
  background-color: var(--jure-bg-dark) !important;
  color: var(--jure-text-light) !important;
  border-top: 1px solid var(--jure-border-dark);
  border-bottom: 1px solid var(--jure-border-dark);
}

#sandbox .eyebrow-badge,
#sandbox .hero-badge {
  background-color: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7 !important;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#sandbox h2,
#sandbox h3,
#sandbox h4,
#sandbox .card-title {
  color: var(--jure-text-light) !important;
}

#sandbox p,
#sandbox .card-subtitle,
#sandbox .mapped-field-label,
#sandbox .sandbox-subtext {
  color: var(--jure-text-muted) !important;
}

#sandbox .sandbox-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

@media (min-width: 1024px) {
  #sandbox .sandbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#sandbox .sandbox-card,
#sandbox .interactive-widget-card {
  background-color: var(--jure-card-dark) !important;
  border: 1px solid var(--jure-border-dark) !important;
  color: var(--jure-text-light) !important;
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: 0 20px 40px -15px rgba(2, 6, 23, 0.7);
}

#sandbox .sandbox-inner-panel {
  background-color: var(--jure-surface-dark) !important;
  border: 1px solid var(--jure-border-dark) !important;
  border-radius: 0.75rem;
  padding: 1.15rem;
  color: var(--jure-text-light) !important;
}

#sandbox .sandbox-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

#sandbox .sandbox-kpi-box {
  background-color: #0f172a;
  border: 1px solid var(--jure-border-dark);
  border-radius: 0.625rem;
  padding: 0.75rem;
}

#sandbox .sandbox-kpi-box.profit {
  background-color: rgba(6, 78, 59, 0.35);
  border-color: rgba(16, 185, 129, 0.35);
}

#sandbox .sandbox-table-wrap {
  width: 100%;
  overflow-x: auto;
}

#sandbox .sandbox-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

#sandbox .sandbox-table th {
  text-align: left;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--jure-border-dark);
  color: #94a3b8 !important;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#sandbox .sandbox-table th:not(:first-child),
#sandbox .sandbox-table td:not(:first-child) {
  text-align: right;
}

#sandbox .sandbox-table td {
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid rgba(30, 41, 59, 0.7);
  color: #f1f5f9 !important;
}

#sandbox .sandbox-table td.buying-col {
  color: #cbd5e1 !important;
}

#sandbox .sandbox-table td.margin-col {
  color: #34d399 !important;
  font-weight: 700;
}

#sandbox .mapper-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background-color: var(--jure-surface-dark);
  border: 1px solid var(--jure-border-dark);
  border-radius: 0.625rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.8rem;
}

#sandbox .mapper-source {
  color: #cbd5e1 !important;
  font-weight: 500;
}

#sandbox .mapper-source strong {
  color: #34d399 !important;
}

#sandbox .mapping-label {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.38);
  color: #6ee7b7 !important;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  transition: all 0.35s ease;
}

/* 6. Segmented 2-Tab Switcher (Owner / Cashier) Isolation */
.role-switcher-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  background-color: var(--jure-surface-dark);
  padding: 0.25rem;
  border-radius: 0.625rem;
  border: 1px solid var(--jure-border-dark);
  gap: 0.25rem;
}

.role-switcher-btn {
  min-height: 44px;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 0.5rem;
  border: none;
  background-color: transparent;
  color: var(--jure-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 150ms cubic-bezier(0.22, 1, 0.36, 1), color 150ms ease;
}

.role-switcher-btn[aria-selected="true"],
.role-switcher-btn.active-toggle {
  background-color: var(--jure-emerald) !important;
  color: #022c22 !important;
}

/* 7. Fintech Tabular Numerals Lock (KES Revenue, Margins, Pricing) */
.tabular-nums,
#sandbox table td,
#sandbox .kpi-value,
#pricing .price-amount,
#pricing .amount {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* 8. Fix BUG-05: 4-Column Desktop Pricing Grid (Eliminates Orphaned Enterprise Card) */
#pricing .pricing-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

@media (min-width: 768px) {
  #pricing .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  #pricing .pricing-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.bb-grid-section .pricing-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .bb-grid-section .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .bb-grid-section .pricing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.popular-ribbon {
  max-width: calc(100% - 2rem);
  white-space: normal;
  text-align: center;
}

/* 9. Fix UX-04: Modal Backdrop Isolation & Opacity Bleed Prevention */
.modal-overlay,
.jure-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9998 !important;
  background-color: rgba(2, 6, 23, 0.84) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  overscroll-behavior: contain;
}

.info-modal {
  z-index: 9999 !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  min-width: 44px;
  min-height: 44px;
  top: 12px;
  right: 12px;
}

/* 10. Inline SVG Icon Sizing & Alignment (BUG-08) */
.jure-inline-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  display: inline-block;
}

.btn-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
}
