/* =========================================================
   Lotia — Base styles
   ========================================================= */

:root {
  --navy:  #112B45;
  --navy-2:#1B3A5C;
  --teal:  #1FA7A0;
  --teal-d:#188A85;
  --green: #8EDB7B;
  --grey:  #D9E2EC;
  --grey-2:#EEF2F7;
  --ivory: #F7F9FC;
  --white: #FFFFFF;
  --text:  #112B45;
  --muted: #5A6B7B;
  --danger:#D97757;
  --shadow-card: 0 1px 3px rgba(17,43,69,0.06), 0 1px 2px rgba(17,43,69,0.04);
  --shadow-card-h: 0 8px 28px rgba(17,43,69,0.12), 0 2px 8px rgba(17,43,69,0.06);
}

html, body { background: var(--ivory); color: var(--text); }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; font-weight: 400; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4,h5,.font-display { font-family: 'Nunito', system-ui, sans-serif; font-weight: 800; color: var(--navy); letter-spacing: -0.025em; }
h1 { font-size: 56px; line-height: 1.0; }
h2 { font-size: 40px; line-height: 1.06; }
h3 { font-size: 28px; line-height: 1.18; }
h4 { font-size: 20px; line-height: 1.22; }
.small { font-size: 14px; }

@media (max-width: 768px) {
  h1 { font-size: 36px; }
  h2 { font-size: 28px; }
  h3 { font-size: 22px; }
}

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 15px; transition: all .18s ease; cursor: pointer; border: 1.5px solid transparent; white-space: nowrap; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-d); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(31,167,160,0.40); }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-ghost { color: var(--navy); background: transparent; }
.btn-ghost:hover { text-decoration: underline; }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 8px; }

/* ===== Cards ===== */
.card { background: #fff; border: 1px solid var(--grey); border-radius: 16px; box-shadow: var(--shadow-card); transition: box-shadow .2s ease, transform .2s ease; }
.card-pad { padding: 24px; }
.card-interactive:hover { box-shadow: var(--shadow-card-h); transform: translateY(-2px); }

/* Card with teal top accent */
.card-accent { border-top: 2px solid var(--teal); }

/* Glowing card for dark backgrounds */
.card-glow {
  box-shadow:
    0 0 0 1px rgba(31,167,160,0.22),
    0 32px 80px rgba(11,20,38,0.55),
    0 0 80px rgba(31,167,160,0.09);
}

/* ===== Header ===== */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(247,249,252,0.92); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); transition: box-shadow .2s ease, background .2s ease; border-bottom: 1px solid transparent; }
.site-header.scrolled { background: rgba(255,255,255,0.96); border-bottom-color: var(--grey); box-shadow: 0 1px 0 rgba(17,43,69,0.04); }
.site-header nav a { color: var(--navy); font-weight: 500; font-size: 15px; transition: color .15s ease; }
.site-header nav a:hover { color: var(--teal); }

/* ===== Pills ===== */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.pill-green  { background: rgba(142,219,123,0.14); color: #1E6B2A; }
.pill-teal   { background: rgba(31,167,160,0.12); color: var(--teal-d); }
.pill-navy   { background: rgba(17,43,69,0.09); color: var(--navy); }
.pill-orange { background: rgba(217,119,87,0.12); color: #B6531C; }
.pill-grey   { background: var(--grey-2); color: var(--muted); }

/* ===== Section label (replaces pill for section intros) ===== */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--teal-d);
}
.section-label::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 2px;
  background: var(--teal);
  border-radius: 1px;
  flex-shrink: 0;
}
.section-label-light {
  color: rgba(255,255,255,0.6);
}
.section-label-light::before {
  background: var(--teal);
  opacity: 0.7;
}

/* ===== KPI ===== */
.kpi-num   { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 40px; line-height: 1; color: var(--navy); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; }
.kpi-giant { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 88px; line-height: 0.9; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }

/* ===== Data strip (metric callout inside sections) ===== */
.data-strip {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: rgba(31,167,160,0.08);
  border: 1px solid rgba(31,167,160,0.18);
  border-radius: 12px;
}

/* ===== Sidebar — PRESERVED, DO NOT CHANGE ===== */
.app-sidebar { background: var(--navy); color: #fff; width: 240px; min-height: 100vh; padding: 22px 16px; position: sticky; top: 0; }
.app-sidebar .nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: rgba(255,255,255,0.78); font-size: 14px; font-weight: 500; cursor: pointer; position: relative; transition: all .15s ease; }
.app-sidebar .nav-item:hover { color: #fff; background: rgba(255,255,255,0.06); }
.app-sidebar .nav-item.active { background: rgba(31,167,160,0.18); color: #fff; }
.app-sidebar .nav-item.active::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; background: var(--teal); border-radius: 0 3px 3px 0; }

/* ===== Tables ===== */
table.l-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.l-table thead th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--grey); cursor: pointer; user-select: none; }
table.l-table thead th .arrow { opacity: 0.35; margin-left: 4px; }
table.l-table tbody td { padding: 14px; border-bottom: 1px solid var(--grey-2); color: var(--navy); }
table.l-table tbody tr:hover { background: var(--ivory); }
table.l-table tbody tr:last-child td { border-bottom: 0; }

/* ===== Inputs ===== */
.input { width: 100%; padding: 11px 14px; border: 1.5px solid var(--grey); border-radius: 10px; background: #fff; font-size: 14px; color: var(--navy); transition: border-color .15s ease, box-shadow .15s ease; font-family: inherit; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31,167,160,0.15); }
.input::placeholder { color: #9AA8B6; }
label.lbl { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; display: block; }

/* Focus */
*:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(31,167,160,0.35); border-radius: 8px; }

/* Section spacing */
.section { padding: 96px 0; }
@media (max-width: 768px) { .section { padding: 64px 0; } }

/* Container */
.container-x { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== Hero: light variant (secondary pages) ===== */
.hero-bg { position: relative; overflow: hidden; }
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 400px at 90% -10%, rgba(31,167,160,0.08), transparent 60%),
    radial-gradient(700px 300px at -10% 110%, rgba(142,219,123,0.06), transparent 60%);
  pointer-events: none;
}

/* ===== Hero: dark variant (index.html) ===== */
.hero-dark {
  background: var(--navy);
  position: relative;
  overflow: hidden;
}
/* Technical dot grid */
.hero-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle 1.5px at 1.5px 1.5px, rgba(31,167,160,0.22) 1.5px, transparent 0);
  background-size: 26px 26px;
  pointer-events: none;
  mask-image: linear-gradient(160deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.18) 45%, transparent 72%);
  -webkit-mask-image: linear-gradient(160deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.18) 45%, transparent 72%);
}
/* Ambient teal glow */
.hero-dark::after {
  content: "";
  position: absolute;
  top: -180px;
  right: -80px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(31,167,160,0.16) 0%, transparent 55%);
  pointer-events: none;
}
/* Text overrides inside dark hero text column */
.hero-text { --muted: rgba(255,255,255,0.62); }
.hero-text h1,
.hero-text h2,
.hero-text h3,
.hero-text h4 { color: #fff; }
.hero-text .text-muted { color: rgba(255,255,255,0.65); }
.hero-text .text-sub  { color: rgba(255,255,255,0.42); }
.hero-text .btn-outline {
  border-color: rgba(255,255,255,0.28);
  color: rgba(255,255,255,0.88);
}
.hero-text .btn-outline:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.45);
  color: #fff;
}
.hero-text .pill-teal {
  background: rgba(31,167,160,0.22);
  color: #82DDD8;
}
.hero-text .trust-badge { color: rgba(255,255,255,0.48); }

.hero-preview-shell {
  position: relative;
}

.hero-preview-frame {
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(31,167,160,0.24);
  background: rgba(255,255,255,0.06);
  box-shadow:
    0 0 0 1px rgba(31,167,160,0.18),
    0 32px 80px rgba(11,20,38,0.55),
    0 0 80px rgba(31,167,160,0.08);
  transform: rotate(0.4deg);
}

.hero-preview-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-preview-badge {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(17,43,69,0.72);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-preview-badge strong {
  color: #fff;
  font-weight: 700;
}

.metric-inline {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.metric-inline .metric-unit {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  line-height: 1;
}

/* ===== Page-load animations (hero elements, CSS-only) ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up-1 { animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fade-up-2 { animation: fadeUp 0.6s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fade-up-3 { animation: fadeUp 0.6s 0.18s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fade-up-4 { animation: fadeUp 0.6s 0.28s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fade-up-5 { animation: fadeUp 0.6s 0.40s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* SVG line draw animation */
@keyframes drawLine {
  from { stroke-dashoffset: 440; }
  to   { stroke-dashoffset: 0; }
}
.line-draw { animation: drawLine 1.8s 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.line-draw-2 { animation: drawLine 1.8s 0.8s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ===== Dark sections (ROI banner, CTA) ===== */
.section-dot-bg {
  position: relative;
  overflow: hidden;
}
.section-dot-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle 1.5px at 1.5px 1.5px, rgba(31,167,160,0.14) 1.5px, transparent 0);
  background-size: 28px 28px;
  pointer-events: none;
}

/* Social proof bar */
.logo-mark { color: var(--muted); opacity: 0.45; transition: opacity .22s ease; }
.logo-mark:hover { opacity: 0.85; }

/* Toasts */
.toast { position: fixed; bottom: 28px; right: 28px; background: var(--teal); color: #fff; padding: 14px 18px; border-radius: 10px; box-shadow: 0 10px 30px rgba(31,167,160,0.4); font-weight: 600; font-size: 14px; z-index: 100; animation: toastIn .35s ease; }
@keyframes toastIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(17,43,69,0.52); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadeIn .2s ease; }
.modal { background: #fff; border-radius: 16px; max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 32px; box-shadow: 0 40px 100px rgba(17,43,69,0.35); animation: modalIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { transform: translateY(16px) scale(0.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

/* Animated geometric motif (login right pane) */
.geo-pulse line, .geo-pulse circle { animation: pulse 3s ease-in-out infinite; }
.geo-pulse line:nth-child(2) { animation-delay: 0.4s; }
.geo-pulse line:nth-child(3) { animation-delay: 0.8s; }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* Chart fade-in */
.chart-fade { animation: chartFade .8s ease both; }
@keyframes chartFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Underline link */
a.tertiary { color: var(--navy); font-weight: 500; }
a.tertiary:hover { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }

/* Compact app layout */
@media (max-width: 760px) {
  .app-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s ease; z-index: 60; }
  .app-sidebar.open { transform: translateX(0); }
}

/* ===== Public mobile navigation ===== */
body.mobile-nav-open,
body.sidebar-open { overflow: hidden; }

.site-header-mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--grey);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.site-header-mobile-toggle:hover {
  border-color: var(--teal);
  color: var(--teal-d);
  background: rgba(31,167,160,0.06);
}

.site-mobile-backdrop,
.app-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17,43,69,0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.site-mobile-backdrop {
  z-index: 69;
}

.app-sidebar-backdrop {
  z-index: 55;
}

.site-mobile-backdrop.visible,
.app-sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.site-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 88vw);
  height: 100vh;
  padding: 18px 18px 24px;
  background: #fff;
  border-left: 1px solid var(--grey);
  box-shadow: -24px 0 60px rgba(17,43,69,0.18);
  transform: translateX(100%);
  transition: transform .25s ease;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.site-mobile-drawer.open {
  transform: translateX(0);
}

.site-mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-mobile-drawer-close {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--grey);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
}

.site-mobile-links {
  display: grid;
  gap: 6px;
}

.site-mobile-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 12px;
  border-radius: 12px;
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  background: transparent;
  transition: background .15s ease, color .15s ease;
}

.site-mobile-links a:hover,
.site-mobile-links a.active {
  background: rgba(31,167,160,0.10);
  color: var(--teal-d);
}

.site-mobile-cta {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--grey);
}

.site-mobile-cta .btn {
  width: 100%;
  justify-content: center;
}

/* ===== Scrollable tables ===== */
.table-scroll-hint {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.table-scroll table {
  width: max-content;
  min-width: 100%;
}

.table-scroll.l-table-wrap table.l-table {
  min-width: 760px;
}

.table-scroll.cmp-table-wrap table.cmp-table {
  min-width: 920px;
}

@media (max-width: 767px) {
  .site-header .container-x { padding: 0 16px; }
  .site-header nav { display: none !important; }
  .site-header-actions { display: none !important; }
  .site-header-mobile-toggle { display: inline-flex; }
  .site-mobile-drawer { width: min(360px, 88vw); }
  .table-scroll-hint { display: flex; }
  .table-scroll table th,
  .table-scroll table td { white-space: nowrap; }
  .table-scroll table th:first-child,
  .table-scroll table td:first-child { white-space: normal; }
  .hero-preview-frame { transform: none; border-radius: 22px; }
  .hero-preview-badge {
    position: static;
    margin-top: 14px;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 760px) {
  .app-sidebar { width: min(82vw, 320px); }
  .app-topbar { padding: 0 16px !important; }
  #app-main { padding: 20px 16px !important; }
  .hero-preview-shell { margin-top: 12px; }
}

/* ===== App content sizing ===== */
.app-layout #app-main > div,
.app-layout #app-main > section {
  width: 100%;
  max-width: none;
}

.app-layout #app-main > section.grid.grid-cols-2.md\:grid-cols-4 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
}

.app-layout #app-main > section.grid.grid-cols-1.lg\:grid-cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
}

.app-layout #app-main > section.grid.grid-cols-1.lg\:grid-cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
}

.app-layout #app-main > section.grid.grid-cols-1.lg\:grid-cols-3 .lg\:col-span-2 {
  grid-column: span 2 / span 2 !important;
}

@media (max-width: 899px) {
  .app-layout #app-main > section.grid.grid-cols-1.lg\:grid-cols-3 .lg\:col-span-2 {
    grid-column: span 1 / span 1 !important;
  }
}

@media (max-width: 767px) {
  .app-layout #app-main > section.grid.grid-cols-2.md\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 479px) {
  .app-layout #app-main > section.grid.grid-cols-2.md\:grid-cols-4 {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .app-layout .app-topbar-search {
    display: none !important;
  }

  .app-layout .app-topbar h2 {
    white-space: nowrap;
    font-size: 20px !important;
  }

  .app-layout #app-main .card-pad {
    padding: 20px;
  }

  .app-layout #app-main .kpi-num {
    font-size: 34px;
  }
}

@media (max-width: 767px) {
  .app-layout .app-topbar h2 {
    white-space: nowrap;
    font-size: 20px !important;
  }

  .app-layout #app-main .card-pad {
    padding: 18px;
  }

  .app-layout #app-main .kpi-num {
    font-size: 32px;
  }

  .app-layout #app-main .btn {
    white-space: normal;
  }
}
