/* ============================================
   ESG SOFTWARE SHOWCASE PAGE
   Scoped styles (prefix: .sw-) — layered on top of the
   global styles.css design tokens. Self-contained app
   mockup palette so the product UI reads like a real
   screenshot in both light and dark site themes.
   ============================================ */

.sw {
  /* App mockup palette (independent of site theme) */
  --app-bg: #eef2f6;
  --app-panel: #ffffff;
  --app-ink: #0b1412;
  --app-muted: #64748b;
  --app-line: #e2e8f0;
  --app-sidebar: #0e1a18;
  --app-sidebar-2: #11231f;
  --app-emerald: #0b6f5c;
  --app-emerald-light: #12a389;
  --app-blue: #1f7ae0;
  --app-gold: #f1b93a;
  --app-red: #e2574c;
}

/* --------------------------------------------
   HERO
-------------------------------------------- */
.sw-hero {
  position: relative;
  text-align: center;
  padding: clamp(40px, 6vw, 72px) 0 0 !important;
  overflow: hidden;
}
.sw-hero .container { position: relative; z-index: 2; }
.sw-hero .breadcrumbs { justify-content: center; }
.sw-hero h1 {
  margin: 10px auto 14px;
  max-width: 18ch;
}
.sw-hero .lead {
  max-width: 64ch;
  margin: 0 auto;
  text-align: center !important;
}
.sw-hero-actions {
  justify-content: center;
  margin-top: 26px;
}
.sw-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  justify-content: center;
  margin-top: 28px;
}
.sw-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-primary);
  background: rgba(11, 111, 92, 0.08);
  border: 1px solid rgba(11, 111, 92, 0.16);
  padding: 7px 13px;
  border-radius: 999px;
}
.sw-badge svg { width: 15px; height: 15px; }

/* --------------------------------------------
   SCROLL-TILT DEVICE (Aceternity-style, vanilla)
-------------------------------------------- */
.sw-scroll {
  padding: 0 0 clamp(40px, 6vw, 80px) !important;
}
.sw-scroll-stage {
  perspective: 1200px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 24px);
}
.sw-scroll-title {
  text-align: center;
  margin-bottom: clamp(18px, 3vw, 34px);
  will-change: transform;
}
.sw-scroll-title .sw-eyebrow {
  color: var(--brand-primary);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.sw-scroll-title h2 { margin: 8px 0 0; }
.sw-scroll-title .sw-hintline {
  margin: 12px 0 0;
  font-size: 0.95rem;
  opacity: 0.66;
}

.sw-device {
  will-change: transform;
  transform-style: preserve-3d;
  border-radius: 28px;
  border: 6px solid #1c2b28;
  background: #16221f;
  padding: 14px;
  box-shadow:
    0 0 #0000004d, 0 9px 20px #0000002a,
    0 37px 37px #00000026, 0 84px 50px #00000014,
    0 149px 60px #0000000a;
}
.sw-device-screen {
  border-radius: 16px;
  overflow: hidden;
  background: var(--app-bg);
  aspect-ratio: 16 / 10;
}

/* Caption under the device, updates with the selected screen */
.sw-caption {
  max-width: 64ch;
  min-height: 2.8em;
  margin: 24px auto 0;
  font-size: 0.95rem;
  color: var(--app-muted);
  text-align: center !important;
}
html[data-theme="dark"] .sw-caption { color: rgba(255,255,255,0.66); }

/* --------------------------------------------
   APP SHELL (shared by every screen mockup)
-------------------------------------------- */
.sw-app {
  display: grid;
  grid-template-columns: 168px 1fr;
  height: 100%;
  font-size: 12px;
  line-height: 1.4;
  color: var(--app-ink);
  text-align: left;
  background: var(--app-bg);
}
.sw-app * { box-sizing: border-box; }
.sw-side {
  background: linear-gradient(180deg, var(--app-sidebar), var(--app-sidebar-2));
  color: rgba(255,255,255,0.72);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sw-side-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; color: #fff; font-size: 13px;
  padding: 4px 8px 14px;
}
.sw-side-brand i {
  width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, var(--app-emerald-light), var(--app-emerald));
  display: inline-block; flex: none;
}
.sw-nav-i {
  display: flex; align-items: center; gap: 9px;
  width: 100%; text-align: left;
  appearance: none; border: 0; font: inherit;
  padding: 8px 10px; border-radius: 8px;
  color: rgba(255,255,255,0.66); font-weight: 500;
  background: transparent; cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.sw-nav-i svg { width: 15px; height: 15px; opacity: 0.9; flex: none; }
.sw-nav-i:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sw-nav-i:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(18,163,137,0.7);
}
.sw-nav-i.is-active {
  background: rgba(18, 163, 137, 0.18);
  color: #fff;
  box-shadow: inset 2px 0 0 var(--app-emerald-light);
}

/* Sidebar footer (faux signed-in user) */
.sw-side-foot {
  margin-top: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 8px 2px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sw-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--app-emerald-light), var(--app-blue));
}
.sw-side-foot b { color: #fff; font-size: 11px; display: block; line-height: 1.2; }
.sw-side-foot small { color: rgba(255,255,255,0.5); font-size: 9.5px; }

/* Swappable screens */
.sw-screens { min-width: 0; height: 100%; }
.sw-main { display: none; height: 100%; overflow: hidden; flex-direction: column; }
.sw-main.is-active { display: flex; }
.sw-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; background: var(--app-panel);
  border-bottom: 1px solid var(--app-line);
}
.sw-top h3 { margin: 0; font-size: 15px; font-weight: 800; }
.sw-top p { margin: 2px 0 0; color: var(--app-muted); font-size: 11px; }
.sw-top-actions { display: flex; gap: 8px; align-items: center; }
.sw-chip {
  font-size: 10.5px; font-weight: 700; padding: 5px 10px;
  border-radius: 999px; background: rgba(11,111,92,0.1);
  color: var(--app-emerald);
}
.sw-btn {
  font-size: 11px; font-weight: 700; padding: 7px 12px;
  border-radius: 8px; background: var(--app-emerald); color: #fff;
}
.sw-body { padding: 16px 18px; overflow: auto; flex: 1; }

/* KPI cards */
.sw-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.sw-kpi {
  background: var(--app-panel); border: 1px solid var(--app-line);
  border-radius: 12px; padding: 13px;
}
.sw-kpi-label { color: var(--app-muted); font-size: 10.5px; font-weight: 600; }
.sw-kpi-val { font-size: 21px; font-weight: 800; margin: 6px 0 2px; letter-spacing: -0.5px; }
.sw-kpi-val small { font-size: 11px; font-weight: 700; color: var(--app-muted); }
.sw-delta { font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.sw-delta.down { color: var(--app-emerald); }
.sw-delta.up { color: var(--app-red); }

/* Generic panel */
.sw-card {
  background: var(--app-panel); border: 1px solid var(--app-line);
  border-radius: 12px; padding: 14px;
}
.sw-card h4 { margin: 0 0 2px; font-size: 12.5px; font-weight: 800; }
.sw-card .sw-sub { color: var(--app-muted); font-size: 10.5px; margin: 0 0 12px; }
.sw-grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; margin-top: 12px; }

/* Bar chart */
.sw-bars { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding-top: 6px; }
.sw-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.sw-bar {
  width: 60%; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--app-emerald-light), var(--app-emerald));
}
.sw-bar.alt { background: linear-gradient(180deg, #5aa7ee, var(--app-blue)); }
.sw-bar-x { font-size: 9.5px; color: var(--app-muted); font-weight: 600; }

/* Donut */
.sw-donut-wrap { display: flex; align-items: center; gap: 14px; }
.sw-donut { width: 104px; height: 104px; flex: none; }
.sw-legend { display: flex; flex-direction: column; gap: 7px; }
.sw-legend span { display: flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 600; }
.sw-legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }

/* Progress / targets */
.sw-track { margin-top: 11px; }
.sw-track-top { display: flex; justify-content: space-between; font-size: 10.5px; font-weight: 600; margin-bottom: 5px; }
.sw-track-top b { font-weight: 800; }
.sw-meter { height: 7px; border-radius: 999px; background: var(--app-line); overflow: hidden; }
.sw-meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--app-emerald-light), var(--app-emerald)); }

/* Data entry form */
.sw-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.sw-field { display: flex; flex-direction: column; gap: 5px; }
.sw-field.full { grid-column: 1 / -1; }
.sw-field label { font-size: 10.5px; font-weight: 700; color: var(--app-muted); }
.sw-input {
  border: 1px solid var(--app-line); border-radius: 8px; background: #fbfdfe;
  padding: 9px 11px; font-size: 11.5px; color: var(--app-ink);
  display: flex; align-items: center; justify-content: space-between;
}
.sw-input.sel::after { content: "▾"; color: var(--app-muted); }
.sw-input b { font-weight: 700; }
.sw-input .ph { color: #9aa7b2; }
.sw-form-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.sw-hint { font-size: 10.5px; color: var(--app-muted); display: flex; align-items: center; gap: 6px; }
.sw-hint b { color: var(--app-emerald); }

/* Table (metrics) */
.sw-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.sw-table th {
  text-align: left; color: var(--app-muted); font-weight: 700; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px;
  border-bottom: 1px solid var(--app-line);
}
.sw-table td { padding: 9px 10px; border-bottom: 1px solid var(--app-line); font-weight: 600; }
.sw-table tr:last-child td { border-bottom: 0; }
.sw-tag { font-size: 9.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.sw-tag.ok { background: rgba(11,111,92,0.12); color: var(--app-emerald); }
.sw-tag.warn { background: rgba(241,185,58,0.18); color: #a9810f; }
.sw-tag.due { background: rgba(31,122,224,0.12); color: var(--app-blue); }
.sw-spark { width: 70px; height: 22px; display: block; }

/* Report preview */
.sw-report { display: grid; grid-template-columns: 1fr 1.35fr; gap: 14px; height: 100%; }
.sw-report-side { display: flex; flex-direction: column; gap: 10px; }
.sw-doc {
  background: #fff; border: 1px solid var(--app-line); border-radius: 10px;
  padding: 18px 20px; box-shadow: var(--shadow-soft); overflow: hidden;
}
.sw-doc-h { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--app-emerald); padding-bottom: 10px; margin-bottom: 12px; }
.sw-doc-h b { font-size: 13px; }
.sw-doc-h span { font-size: 9.5px; color: var(--app-muted); font-weight: 700; }
.sw-doc h5 { margin: 0 0 7px; font-size: 11.5px; color: var(--app-emerald); }
.sw-line { height: 7px; border-radius: 999px; background: #eef2f6; margin-bottom: 7px; }
.sw-line.w90 { width: 90%; } .sw-line.w75 { width: 75%; } .sw-line.w60 { width: 60%; } .sw-line.w40 { width: 40%; }
.sw-doc-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 12px 0; }
.sw-doc-stat { background: #f6f9fb; border-radius: 8px; padding: 9px; text-align: center; }
.sw-doc-stat b { display: block; font-size: 16px; color: var(--app-emerald); }
.sw-doc-stat span { font-size: 8.5px; color: var(--app-muted); font-weight: 700; }
.sw-fmt {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px;
  border: 1px solid var(--app-line); border-radius: 9px; background: var(--app-panel); font-weight: 700; font-size: 11px;
}
.sw-fmt i { width: 26px; height: 26px; border-radius: 7px; flex: none; display: grid; place-items: center; color: #fff; font-size: 9px; font-weight: 800; }
.sw-fmt small { display: block; color: var(--app-muted); font-weight: 600; font-size: 9.5px; }
.sw-fmt.pdf i { background: var(--app-red); }
.sw-fmt.xls i { background: var(--app-emerald); }
.sw-fmt.docx i { background: var(--app-blue); }

/* --------------------------------------------
   FEATURE GRID + COMPLIANCE + PRICING
-------------------------------------------- */
.sw-feature-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(18,163,137,0.16), rgba(31,122,224,0.12));
  color: var(--brand-primary); margin-bottom: 12px;
}
.sw-feature-icon svg { width: 22px; height: 22px; }

.sw-license {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.sw-plan {
  background: var(--surface-light); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; position: relative;
}
html[data-theme="dark"] .sw-plan { background: var(--surface-dark); border-color: var(--border-dark); }
.sw-plan.featured { border-color: var(--brand-primary); box-shadow: var(--shadow-medium); }
.sw-plan-flag {
  position: absolute; top: -12px; left: 24px;
  background: var(--brand-primary); color: #fff; font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px;
}
.sw-plan h3 { margin: 0 0 4px; font-size: 1.15rem; }
.sw-plan-desc { color: var(--app-muted); font-size: 0.88rem; min-height: 40px; }
html[data-theme="dark"] .sw-plan-desc { color: rgba(255,255,255,0.62); }
.sw-plan-price { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; margin: 14px 0 2px; }
.sw-plan-price small { font-size: 0.85rem; font-weight: 600; color: var(--app-muted); }
.sw-plan ul { list-style: none; padding: 0; margin: 18px 0 22px; display: grid; gap: 10px; }
.sw-plan li { display: flex; gap: 9px; align-items: flex-start; font-size: 0.9rem; }
.sw-plan li svg { width: 17px; height: 17px; color: var(--brand-primary); flex: none; margin-top: 2px; }
.sw-plan .cta { margin-top: auto; text-align: center; }
.sw-plan .cta--ghost {
  background: #fff !important;
  color: var(--brand-primary) !important;
  border: 1.5px solid var(--brand-primary);
  box-shadow: none;
}
.sw-plan .cta--ghost:hover {
  background: rgba(11,111,92,0.08) !important;
  color: var(--brand-primary) !important;
  box-shadow: var(--shadow-soft);
}
html[data-theme="dark"] .sw-plan .cta--ghost {
  background: transparent !important;
}

/* --------------------------------------------
   RESPONSIVE
-------------------------------------------- */
@media (max-width: 860px) {
  .sw-license { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  /* Collapse the in-device sidebar to icons so it stays legible on phones */
  .sw-app { grid-template-columns: 56px 1fr; font-size: 11px; }
  .sw-side { padding: 12px 6px; }
  .sw-side-brand span, .sw-nav-i span, .sw-side-foot div { display: none; }
  .sw-side-brand { justify-content: center; padding: 4px 0 14px; }
  .sw-nav-i { justify-content: center; padding: 9px 0; }
  .sw-side-foot { justify-content: center; }
  .sw-kpis { grid-template-columns: repeat(2, 1fr); }
  .sw-grid-2, .sw-report { grid-template-columns: 1fr; }
  .sw-form { grid-template-columns: 1fr; }
  .sw-report-side { display: none; }
  .sw-device-screen { aspect-ratio: 3 / 4; }
}
@media (max-width: 480px) {
  .sw-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .sw-kpi-val { font-size: 17px; }
}

/* Reduced motion: no tilt */
@media (prefers-reduced-motion: reduce) {
  .sw-device, .sw-scroll-title { transform: none !important; }
}
