:root {
  --bg: #f3f6f8;
  --ink: #17232b;
  --muted: #5d6e79;
  --line: #d5dee4;
  --paper: #ffffff;
  --brand: #2d5f8b;
  --brand-strong: #1f4668;
  --good: #2f8f67;
  --warn: #a66b00;
  --bad: #b93b3b;
  --shadow: 0 18px 40px rgba(23, 35, 43, 0.08);
  --page-gutter: 16px;
  font-family: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
}

a { color: inherit; }

img { max-width: 100%; }

.site-wrap {
  min-height: 100vh;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-wrap > * {
  min-width: 0;
  max-width: 100%;
}

.site-header, .site-footer {
  position: relative;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.site-footer { border-bottom: 0; border-top: 1px solid var(--line); }

.site-header-inner, .site-footer-inner, .site-main, .hero-inner {
  box-sizing: border-box;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
  min-width: 0;
}

.site-header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header-inner > .brand {
  flex: 1 1 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  font-weight: 800;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
}

.site-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 1 1 auto;
  min-width: 0;
}

.header-bar-login {
  display: none;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--ink);
  border-radius: 99px;
  transition: transform 160ms ease, opacity 160ms ease;
}

.site-header.is-open .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header.is-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.is-open .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-links, .header-actions, .hero-actions, .plan-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 650;
}

.nav-links a:hover, .nav-links a.is-active { color: var(--brand-strong); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button.primary { background: var(--brand); color: #fff; }
.button.primary:hover { background: var(--brand-strong); }
.button.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.button.danger { background: var(--bad); color: #fff; }
.button.wide { width: 100%; }

.hero {
  padding: 40px 0 12px;
}

.hero-inner, .split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 32px;
  align-items: center;
  min-width: 0;
}

.hero-inner > *,
.split > *,
.grid-3 > *,
.grid-2 > *,
.stats > * {
  min-width: 0;
  max-width: 100%;
}

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

h1, h2, h3 { margin: 0 0 10px; line-height: 1.15; overflow-wrap: break-word; }
h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
p { color: var(--muted); line-height: 1.5; overflow-wrap: break-word; }

.hero-card, .panel, .plan, .auth-card, .stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.hero-card, .panel, .plan, .auth-card { padding: 22px; }
.site-main > .panel + .panel { margin-top: 14px; }

.hero-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.hero-list li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  color: var(--ink);
}

.hero-list li::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--good);
}

.section { padding: 32px 0 16px; }

.grid-3, .grid-2, .stats {
  display: grid;
  gap: 16px;
}

.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 20px 0 8px; }

.stat { padding: 16px; }
.stat strong { display: block; font-size: 1.15rem; }

.cta-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cta-panel h2 { margin-bottom: 6px; }

.provider-heading {
  margin: 28px 0 8px;
}

.provider-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.provider-list li {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  font-size: 0.92rem;
}

.billing-toggle {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  margin: 8px 0 18px;
}

.billing-toggle button {
  border: 0;
  background: transparent;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.billing-toggle button.is-active {
  background: var(--brand);
  color: #fff;
}

.plan {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.plan-adds {
  flex: 1 1 auto;
}

.plan .button {
  margin-top: auto;
  width: 100%;
}

.grid-3 .plan,
.grid-3 .panel {
  height: 100%;
}

.plan.featured {
  border-color: var(--brand);
  box-shadow: 0 16px 36px rgba(45, 95, 139, 0.16);
}

.price { font-size: 2rem; font-weight: 800; }
.price span { font-size: 1rem; color: var(--muted); font-weight: 650; }
.plan-price-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.4;
}

.plan ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
}

.auth-shell {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 40px var(--page-gutter);
}

.auth-card { width: min(480px, 100%); max-width: 100%; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field span { font-weight: 700; font-size: 0.9rem; }
.input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.notice, .error, .ok {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-weight: 650;
}

.error { background: #fff5f5; color: var(--bad); }
.ok { background: #f3fbf7; color: var(--good); }
.notice { background: #f3f7fb; color: var(--brand-strong); }

.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 0.94rem; }
th { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }

.badge {
  display: inline-flex;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  background: #eef3f7;
}

.badge.active, .badge.trialing { background: #e7f6ee; color: var(--good); }
.badge.past_due, .badge.warn { background: #fff4dc; color: var(--warn); }
.badge.canceled, .badge.disabled { background: #fdeeee; color: var(--bad); }

.plan[data-plan="starter"] { border-top: 6px solid #7a8d99; }
.plan[data-plan="ministry"] { border-top: 6px solid var(--brand); }
.plan[data-plan="campus"] { border-top: 6px solid #1b3d2f; }

.plan-adds, .plan-missing, .plan-unique {
  padding: 12px;
  border-radius: 10px;
}

.plan-adds {
  background: #eef5fb;
}

.plan-missing {
  background: #f6f7f8;
  border: 1px dashed var(--line);
}

.plan-adds strong,
.plan-missing strong,
.plan-unique strong {
  display: block;
  margin-bottom: 6px;
}

.plan-adds ul,
.plan-missing ul,
.plan-adds-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
}

.plan-also {
  margin: 0;
  font-size: 0.92rem;
}

.plan-missing-label {
  margin: 10px 0 4px;
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--muted);
}

.plan-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  background: #eef3f7;
}

.plan-chip.starter { background: #e8eef2; color: #445560; }
.plan-chip.ministry { background: #e4eef7; color: var(--brand-strong); }
.plan-chip.campus { background: #e5f3ea; color: #1b3d2f; }

.plan-included {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.plan-included li.is-included,
.compare-table td.is-included { color: var(--good); font-weight: 700; }
.plan-included li.is-missing,
.compare-table td.is-missing { color: var(--muted); font-weight: 500; }

.compare-table th, .compare-table td { white-space: nowrap; }
.compare-table td:first-child, .compare-table th:first-child { white-space: normal; }
.compare-table thead th[data-plan="starter"] { color: #445560; }
.compare-table thead th[data-plan="ministry"] { color: var(--brand-strong); }
.compare-table thead th[data-plan="campus"] { color: #1b3d2f; }

.compare-group th {
  background: #f4f7f9;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.92rem;
  color: var(--ink);
  padding-top: 14px;
}

.compare-group small {
  display: block;
  margin-top: 2px;
  font-weight: 500;
  color: var(--muted);
  text-transform: none;
}

.mark {
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.mark.yes { background: #e7f6ee; color: var(--good); font-size: 1.05rem; }
.mark.no { background: #f1f3f5; color: var(--muted); }

.plan-snapshot h3 { font-size: 1.15rem; }
.plan-snapshot-missing { font-size: 0.9rem; margin: 8px 0 14px; }

.demo-banner {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  background: #17324a;
  color: #fff;
  font-weight: 700;
}

.demo-banner button {
  min-height: 36px;
}

.site-footer-inner {
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

@media (max-width: 860px) {
  :root { --page-gutter: 8px; }
  html, body { overflow-x: hidden; }
  .site-header {
    padding-top: max(8px, env(safe-area-inset-top, 0px));
  }
  .site-header-inner { gap: 8px; }
  .site-header-inner > .brand { min-width: 0; }
  .header-bar-login, .menu-toggle { flex: 0 0 auto; }
  .hero-inner, .split, .grid-3, .grid-2, .stats {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .hero { padding: 24px 0 8px; }
  .section { padding: 24px 0 12px; }
  .hero-card, .panel, .plan, .auth-card { padding: 16px; }
  .auth-shell { padding: 24px var(--page-gutter); }
  .auth-card { width: 100%; }
  .hero-actions, .plan-actions, .cta-panel {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .button, .cta-panel .button { width: 100%; }
  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 56px;
    padding: 12px 0;
  }
  .site-footer-inner span { max-width: 100%; overflow-wrap: break-word; }
  .table-wrap { margin-inline: 0; -webkit-overflow-scrolling: touch; }
  .compare-table th, .compare-table td { white-space: normal; }
  h1 { font-size: 1.7rem; }
  .demo-banner {
    padding: 10px var(--page-gutter);
    flex-wrap: wrap;
  }
  .header-bar-login { display: inline-flex; flex-shrink: 0; margin-left: auto; }
  .header-bar-login + .menu-toggle { margin-left: 0; }
  .site-menu .header-cta-login { display: none; }
  .menu-toggle { display: inline-grid; align-content: center; flex-shrink: 0; margin-left: 0; }
  body.is-menu-open { overflow: hidden; }
  .site-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 50;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 10px var(--page-gutter) 14px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 8px 16px rgba(23, 35, 43, 0.14);
  }
  .site-header.is-open .site-menu { display: flex; }
  .nav-links, .header-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .nav-links a, .header-actions .button {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
  }
  .nav-links a {
    padding: 10px 4px;
  }
  body.is-home .site-header-inner > .header-cta-signup,
  body.is-home .site-header-inner > .header-cta-demo {
    display: none;
  }
}
