/* R2Flow landing theme. Token names follow the shadcn convention used by
 * the orchestrator app (--background, --primary, …); --spruce-* are the
 * brand dark-green extension. */
:root {
  --background: #f4f7f4;
  --foreground: #111111;
  --card: #ffffff;
  --card-foreground: #111111;
  --primary: #2e7d4f;
  --primary-foreground: #ffffff;
  --secondary: #e7f3ec;
  --secondary-foreground: #448361;
  --muted: #eef1ee;
  --muted-foreground: #747a75;
  --accent: #d9ecd2;
  --accent-foreground: #0d211a;
  --destructive: #d44c47;
  --border: rgba(0, 0, 0, 0.08);
  --input: rgba(0, 0, 0, 0.15);
  --ring: #2e7d4f;
  --radius: 14px;
  --spruce: #152e22;
  --spruce-soft: #cfe6d6;
  --spruce-ink: #f2f5f2;
  --spruce-muted: #b9c9bf;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
h1 { font-family: "Source Serif 4", Georgia, serif; font-weight: 600; font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.05; }
h1 em { color: #8fd0a6; }
h2 { font-family: "Source Serif 4", Georgia, serif; font-weight: 600; font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin-bottom: 1.5rem; }
a { color: inherit; }

/* Anchor jumps must clear the sticky header. */
section[id] { scroll-margin-top: 84px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.8rem 1.5rem;
  background: rgba(244, 247, 244, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; text-decoration: none; }
.brand-mark { display: inline-flex; width: 30px; height: 30px; border-radius: 8px; background: var(--spruce); align-items: center; justify-content: center; }
.topnav { display: flex; gap: 1.2rem; margin-left: auto; }
.topnav a { text-decoration: none; font-size: 0.9rem; color: var(--muted-foreground); }
.topnav a:hover { color: var(--foreground); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid transparent;
  padding: 0.55rem 1.1rem; font: inherit; font-weight: 600; font-size: 0.92rem;
  cursor: pointer; text-decoration: none; transition: transform 0.08s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: #276b44; }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--secondary); }
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover { background: rgba(0, 0, 0, 0.05); }
.btn-lg { padding: 0.8rem 1.6rem; font-size: 1rem; }

.hero {
  background:
    radial-gradient(60% 90% at 85% 0%, rgba(46, 125, 79, 0.35), transparent 70%),
    var(--spruce);
  color: var(--spruce-ink);
  border-radius: 0 0 28px 28px;
}
.hero-inner { max-width: 1080px; margin: 0 auto; padding: 4.5rem 1.5rem 3.5rem; }
.kicker { color: var(--spruce-soft); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; font-weight: 600; margin: 0 0 1rem; }
.lead { max-width: 620px; color: var(--spruce-muted); font-size: 1.08rem; line-height: 1.6; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.8rem 0 2.5rem; }
.hero .btn-outline { border-color: var(--spruce-soft); color: #e2f0e7; }
.hero .btn-outline:hover { background: rgba(255, 255, 255, 0.08); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.stats div { border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 0.8rem; }
.stats dt { font-family: "Source Serif 4", Georgia, serif; font-size: 1.5rem; color: #fff; }
.stats dd { margin: 0.2rem 0 0; color: var(--spruce-muted); font-size: 0.88rem; }

.section { max-width: 1080px; margin: 0 auto; padding: 4rem 1.5rem 1rem; }
.section-dark {
  background:
    radial-gradient(50% 100% at 10% 100%, rgba(46, 125, 79, 0.28), transparent 70%),
    var(--spruce);
  color: var(--spruce-ink);
  border-radius: 22px; margin-top: 3rem; padding: 3rem 2rem;
}
.section-dark .steps { color: var(--spruce-muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.card h3 { margin-bottom: 0.5rem; }
.card p { margin: 0; color: var(--muted-foreground); font-size: 0.94rem; line-height: 1.55; }
.steps { margin: 0 0 2rem; padding-left: 1.2rem; line-height: 2; }
.steps strong { color: #fff; }

.stub {
  background: var(--card); border: 1px dashed var(--primary);
  border-radius: var(--radius); padding: 1.6rem; max-width: 640px;
}
.stub p { color: var(--muted-foreground); margin: 0.6rem 0 0; line-height: 1.55; }
.stub-badge {
  display: inline-block; margin: 0; padding: 0.25rem 0.7rem;
  background: var(--secondary); color: var(--primary);
  border-radius: 999px; font-size: 0.8rem; font-weight: 700;
}

.footer {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  max-width: 1080px; margin: 3rem auto 0; padding: 1.5rem;
  border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: 0.88rem;
}
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; font-weight: 600; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(21, 46, 34, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  position: relative; width: 100%; max-width: 400px;
  background: var(--card); border-radius: 18px; padding: 1.8rem;
  box-shadow: 0 24px 64px rgba(21, 46, 34, 0.35);
}
.modal h3 { margin-bottom: 1rem; }
.modal-x {
  position: absolute; top: 0.8rem; right: 1rem;
  background: none; border: 0; font-size: 1.5rem; line-height: 1;
  color: var(--muted-foreground); cursor: pointer;
}
.tabs { display: flex; gap: 0.4rem; margin-bottom: 1.2rem; }
.tab {
  flex: 1; padding: 0.55rem; border-radius: 9px; border: 1px solid var(--border);
  background: transparent; font: inherit; font-size: 0.9rem; font-weight: 600;
  color: var(--muted-foreground); cursor: pointer;
}
.tab.active { background: var(--secondary); border-color: var(--primary); color: var(--primary); }
#authForm label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--muted-foreground); margin-bottom: 0.9rem; }
#authForm input {
  display: block; width: 100%; margin-top: 0.3rem;
  padding: 0.65rem 0.8rem; border-radius: 9px;
  border: 1px solid var(--input); font: inherit; font-size: 0.95rem;
}
#authForm input:focus { outline: 2px solid var(--ring); outline-offset: -1px; }
#authForm .btn { width: 100%; margin-top: 0.3rem; }
.form-error { color: var(--destructive); font-size: 0.85rem; margin: 0 0 0.8rem; }
.modal-note { color: var(--muted-foreground); font-size: 0.8rem; margin: 1rem 0 0; line-height: 1.5; }

@media (max-width: 640px) {
  .topnav { display: none; }
  .topbar { gap: 1rem; }
  .hero-inner { padding: 3rem 1.2rem 2.5rem; }
  section[id] { scroll-margin-top: 72px; }
}
