:root {
  --bg: #f3f7f2;
  --bg-deep: #dfeee2;
  --surface: #ffffff;
  --text: #112016;
  --muted: #4c6855;
  --brand: #146c43;
  --brand-2: #2f9e44;
  --line: #d0dfd3;
  --danger: #a61e4d;
  --shadow: 0 20px 40px rgba(20, 108, 67, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
}

.bg-landing {
  background:
    radial-gradient(50vw 35vw at 95% 0%, #caecd3 0%, transparent 70%),
    radial-gradient(55vw 45vw at 0% 100%, #c2e2ff 0%, transparent 75%),
    var(--bg);
}

.bg-auth,
.bg-app {
  background:
    linear-gradient(140deg, #eef8f1 0%, #f9fcfa 35%, #edf4ff 100%);
}

.site-header,
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.logo {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: var(--text);
  font-size: 1.2rem;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
}

nav a.active,
nav a:hover {
  color: var(--text);
  background: #e7f3ea;
}

.section,
.app-main {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.section {
  padding: 46px 0;
}

.hero {
  padding: 90px 0 50px;
  animation: rise 650ms ease both;
}

.eyebrow {
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
  max-width: 16ch;
}

h2 {
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
  margin-bottom: 18px;
}

.lead {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.06rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 32px;
}

.btn {
  border: none;
  border-radius: 12px;
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  padding: 11px 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn-sm {
  padding: 7px 11px;
  font-size: 0.9rem;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.kpi-grid,
.flow-grid,
.audience-grid {
  display: grid;
  gap: 14px;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flow-grid,
.audience-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.flow span {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: #e9f8ee;
  color: var(--brand);
  margin-bottom: 8px;
}

.flow p,
.audience-grid p,
.kpi p {
  color: var(--muted);
}

.center-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.auth-card {
  width: min(500px, 94vw);
}

.auth-card p {
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.auth-separator {
  margin: 14px 0;
  position: relative;
  text-align: center;
}

.auth-separator::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--line);
}

.auth-separator span {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 0 10px;
  background: #fff;
  color: #6a8571;
  font-size: 0.88rem;
  font-weight: 600;
}

.btn-google {
  width: 100%;
  border: 1px solid #d7dfe5;
  border-radius: 12px;
  background: #fff;
  color: #1f2b34;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.98rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.btn-google svg {
  width: 20px;
  height: 20px;
  display: block;
}

.btn-google:hover {
  border-color: #bec8d0;
  box-shadow: 0 8px 16px rgba(14, 33, 48, 0.08);
  transform: translateY(-1px);
}

.btn-google:active {
  transform: translateY(0);
}

.auth-alt {
  margin: 12px 0 8px;
  font-size: 0.95rem;
}

.auth-alt a {
  color: #0f5d38;
  font-weight: 600;
  text-decoration: none;
}

.auth-alt a:hover {
  text-decoration: underline;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
}

.error-text {
  color: var(--danger);
  min-height: 1.2em;
}

.muted-link {
  color: var(--muted);
  font-size: 0.95rem;
}

.app-main {
  padding: 24px 0 50px;
  display: grid;
  gap: 16px;
}

.app-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.session-chip {
  background: #e8f7ee;
  border: 1px solid #c5e6d2;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.86rem;
}

.split-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.2fr 1fr;
  align-items: flex-start;
}

.pricing-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.pricing-card h3 {
  margin-bottom: 4px;
}

.pricing-card .timeline {
  margin: 10px 0 14px;
}

.pricing-card {
  display: grid;
  gap: 8px;
  align-content: start;
  grid-template-rows: auto auto 1fr auto;
  height: 100%;
}

.pricing-card .btn {
  margin-top: auto;
}

.pricing-card.is-selected {
  border-color: #8fbfa0;
  box-shadow: 0 10px 22px rgba(18, 74, 45, 0.16);
}

.dashboard-picker {
  margin-bottom: 10px;
}

.dashboard-picker select {
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stack {
  display: grid;
  gap: 10px;
}

.status-text {
  min-height: 1.2em;
  color: var(--muted);
}

.debug-box {
  background: #0f1e15;
  color: #d8f5e4;
  border-radius: 12px;
  padding: 11px;
  overflow-x: auto;
  min-height: 120px;
  white-space: pre-wrap;
  word-break: break-word;
}

.timeline {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.inline-check {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.flow-list {
  color: var(--muted);
}

.criteria-editor {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fbfefc;
}

.criteria-editor h3 {
  margin: 0;
  font-size: 1rem;
}

.criteria-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.criteria-builder-row {
  border: 1px solid #c6d9cc;
  border-left: 4px solid #8fbfa0;
  border-radius: 12px;
  background: #f8fcf9;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.criteria-builder-row:hover {
  border-color: #9fc7ad;
  background: #f3faf5;
}

.criteria-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  align-items: center;
}

.criteria-row p {
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

.criteria-row small {
  color: var(--muted);
}

.logs-controls {
  display: flex;
  align-items: end;
  gap: 10px;
}

.logs-controls label {
  font-size: 0.9rem;
  gap: 4px;
}

.logs-pager {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.log-row {
  cursor: pointer;
}

.log-row:hover {
  background: #f3fbf6;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stack .card.is-selected {
  border-color: #8fbfa0;
  box-shadow: 0 10px 22px rgba(18, 74, 45, 0.16);
}

.standards-list-card {
  border: 1px solid #c9ddcf;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcf9 100%);
  display: grid;
  gap: 8px;
}

.standards-list-card.is-selected {
  border-color: #7eb895;
  box-shadow: 0 12px 26px rgba(18, 74, 45, 0.2);
}

.standards-list-title {
  margin: 0;
}

.standards-list-description {
  margin: 0;
  color: var(--muted);
}

.standards-list-meta {
  margin: 0;
}

.standards-criteria-list {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0;
  display: grid;
  gap: 6px;
}

.standards-criteria-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #d7e6db;
  border-radius: 10px;
  background: #ffffff;
}

.standards-criteria-name {
  color: var(--text);
  font-weight: 600;
}

.standards-criteria-weight {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.table-wrap tbody tr[data-analysis-id] {
  cursor: pointer;
}

.table-wrap tbody tr[data-analysis-id]:hover {
  background: #f2faf4;
}

.table-wrap tbody tr.is-selected {
  background: #e7f5ec;
}

/* Landing v2 */
.landing-main {
  width: min(1160px, 92vw);
  margin: 0 auto;
}

.bg-landing {
  background:
    radial-gradient(55vw 30vw at 85% 2%, rgba(46, 160, 95, 0.25), transparent 72%),
    radial-gradient(45vw 34vw at 0% 100%, rgba(19, 100, 165, 0.2), transparent 75%),
    linear-gradient(180deg, #eef7f2 0%, #f7fbff 52%, #eff8f1 100%);
}

.landing-hero {
  padding-top: 72px;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items: center;
}

.hero-copy h1 {
  margin-top: 6px;
  max-width: 15ch;
}

.trust-line {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trust-line span {
  border: 1px solid #cbe4d1;
  background: rgba(233, 247, 238, 0.7);
  color: #1f5f3e;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 600;
}

.hero-visual {
  position: relative;
  min-height: 290px;
  display: grid;
  align-items: center;
}

.pulse-orb {
  position: absolute;
  right: -16%;
  top: -26%;
  width: 290px;
  height: 290px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(52, 184, 111, 0.72), rgba(52, 184, 111, 0.14) 63%, transparent 79%);
  filter: blur(1px);
  animation: orbPulse 3.2s ease-in-out infinite;
  pointer-events: none;
}

.pipeline-card {
  position: relative;
  z-index: 2;
  padding: 22px;
  background: linear-gradient(160deg, #ffffff 0%, #f4fbf7 65%, #eef6ff 100%);
}

.pipeline-title {
  margin: 0;
  font-weight: 700;
  color: #174a30;
}

.pipeline-list {
  margin: 12px 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.pipeline-list li {
  color: #355547;
  font-weight: 500;
}

.pipeline-note {
  margin: 0;
  color: #527063;
  font-size: 0.9rem;
}

.landing-kpi {
  margin-top: 18px;
}

.kpi h3 span {
  color: var(--brand);
}

.motion-card {
  --rx: 0deg;
  --ry: 0deg;
  transition: transform 240ms ease, box-shadow 240ms ease, border-color 240ms ease;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(0);
  will-change: transform;
}

.motion-card:hover {
  border-color: #8fbfa0;
  box-shadow:
    0 44px 90px rgba(16, 73, 44, 0.28),
    0 12px 26px rgba(16, 73, 44, 0.2);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-14px);
}

.flow-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flow h3 {
  margin-bottom: 8px;
}

.cta-card {
  padding: 28px;
  background: linear-gradient(130deg, #ffffff 0%, #f2fbf6 45%, #edf4ff 100%);
}

.cta-card h2 {
  margin-bottom: 8px;
}

.cta-card p {
  margin-top: 0;
  color: var(--muted);
  max-width: 66ch;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes orbPulse {
  0% {
    transform: translateY(20px) scale(0.9);
    opacity: 0.68;
  }
  50% {
    transform: translateY(-26px) scale(1.14);
    opacity: 1;
  }
  100% {
    transform: translateY(20px) scale(0.9);
    opacity: 0.68;
  }
}

@keyframes rise {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-grid,
  .audience-grid,
  .split-layout,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .hero-layout {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: auto;
  }

  .site-header,
  .app-header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  nav {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .motion-card,
  .reveal,
  .pulse-orb {
    transition: none;
    animation: none;
    transform: none;
  }
}
