/* ============================================================
   Sober Living Companion — site styles
   Brand palette mirrors the mobile app (calm teal-green + warm accent)
   ============================================================ */

:root {
  --primary: #3E8E7E;
  --primary-dark: #2F6B5F;
  --primary-light: #E4F1ED;
  --accent: #E8A87C;
  --accent-light: #FBEDE3;
  --bg: #F7F5F1;
  --surface: #FFFFFF;
  --surface-alt: #F0EEE8;
  --text: #2B2B2B;
  --text-2: #6B6B6B;
  --text-muted: #9A9A9A;
  --border: #E3E0D9;
  --success: #5FA877;
  --warning: #D9A441;
  --crisis: #C0392B;

  --maxw: 1140px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(47, 107, 95, 0.08);
  --shadow-lg: 0 20px 50px rgba(47, 107, 95, 0.14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; color: var(--text); margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800; letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1rem; color: var(--text-2); }
a { color: var(--primary-dark); text-decoration: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--primary-dark);
  background: var(--primary-light); padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: inherit; font-size: 1rem; font-weight: 700; cursor: pointer;
  padding: .85rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease; text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-ghost { background: transparent; color: var(--primary-dark); border-color: var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }
.btn-light { background: #fff; color: var(--primary-dark); }
.btn-light:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }

/* ---------- Top utility bar (powered by) ---------- */
.topbar { background: var(--primary-dark); color: #fff; font-size: .85rem; }
.topbar .container { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .5rem 24px; text-align: center; flex-wrap: wrap; }
.topbar a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.topbar a:hover { color: var(--accent-light); }

/* ---------- Founders ---------- */
.founder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.founder { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; display: flex; gap: 1.25rem; align-items: flex-start; }
.founder img { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; flex: none; border: 3px solid var(--primary-light); }
.founder .ph { width: 92px; height: 92px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 2rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), #cf8050); border: 3px solid var(--accent-light); }
.founder h3 { margin-bottom: .15rem; }
.founder .role { color: var(--primary-dark); font-weight: 700; font-size: .9rem; margin-bottom: .6rem; }
.founder p { font-size: .92rem; margin: 0; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 245, 241, 0.85); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--text); font-size: 1.1rem; white-space: nowrap; }
.brand > span { line-height: 1.15; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 1.1rem;
}
.brand small { display: block; font-size: .68rem; font-weight: 600; color: var(--text-muted); letter-spacing: .02em; }
.nav-links { display: flex; align-items: center; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text-2); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.nav-links a:hover { color: var(--primary-dark); }
.nav-cta { display: flex; align-items: center; gap: .75rem; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; transition: .2s; }

/* ---------- Hero ---------- */
.hero { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.hero h1 span { color: var(--primary-dark); }
.hero p.lead { font-size: 1.2rem; max-width: 34ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.75rem 0 1.25rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: .9rem; color: var(--text-2); }
.hero-trust span { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.check { color: var(--success); font-weight: 900; }

/* phone mock */
.phone {
  position: relative; width: 280px; max-width: 100%; margin: 0 auto;
  background: #1f1f1f; border-radius: 42px; padding: 12px; box-shadow: var(--shadow-lg);
}
.phone .screen { background: var(--bg); border-radius: 32px; overflow: hidden; aspect-ratio: 9 / 19; }
.phone .notch { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); width: 110px; height: 24px; background: #1f1f1f; border-radius: 0 0 16px 16px; z-index: 2; }
.app-top { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; padding: 38px 18px 18px; }
.app-top h4 { color: #fff; margin: 0 0 2px; font-size: 1.05rem; }
.app-top p { color: rgba(255,255,255,.85); margin: 0; font-size: .8rem; }
.app-body { padding: 14px; display: grid; gap: 10px; }
.app-card { background: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: 0 4px 12px rgba(0,0,0,.04); }
.app-card .label { font-size: .7rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.app-card .big { font-size: 1.25rem; font-weight: 800; color: var(--text); }
.app-pill { display: inline-block; font-size: .68rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.pill-green { background: var(--primary-light); color: var(--primary-dark); }
.pill-accent { background: var(--accent-light); color: #b5663a; }
.app-sos { background: var(--crisis); color: #fff; text-align: center; padding: 12px; border-radius: 14px; font-weight: 800; }

/* ---------- Sections ---------- */
section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 2.5rem; }
.section-head p { font-size: 1.1rem; }

/* logos / org strip */
.trustbar { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.trustbar .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2rem; padding-top: 1.5rem; padding-bottom: 1.5rem; }
.trustbar span { font-weight: 700; color: var(--text-muted); font-size: .9rem; display: inline-flex; gap: .5rem; align-items: center; }

/* who it's for */
.audience-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.audience-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem 1.75rem; transition: .2s; }
.audience-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--primary-light); }
.audience-card .ico { font-size: 2rem; margin-bottom: .75rem; }
.audience-card h3 { margin-bottom: .4rem; }
.audience-card p { font-size: .95rem; margin: 0; }

/* features */
.features { background: var(--surface); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.feature { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; transition: .2s; }
.feature:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.feature .ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; background: var(--primary-light); margin-bottom: 1rem; }
.feature.accent .ico { background: var(--accent-light); }
.feature h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.feature p { font-size: .92rem; margin: 0; }

/* how it works */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; counter-reset: step; }
.step { text-align: center; }
.step .num { width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; font-size: 1.25rem; display: grid; place-items: center; margin: 0 auto 1rem; }
.step h3 { font-size: 1.05rem; }
.step p { font-size: .92rem; }

/* stats */
.stats { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.stats .section-head h2, .stats .section-head p { color: #fff; }
.stats .section-head p { opacity: .9; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; text-align: center; }
.stat .n { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 800; }
.stat .l { opacity: .9; font-size: .95rem; }

/* split feature highlight (payments) */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.split.alt .split-media { order: -1; }
.split-media { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); }
.split ul { list-style: none; padding: 0; margin: 1rem 0 0; }
.split li { display: flex; gap: .65rem; align-items: flex-start; margin-bottom: .65rem; color: var(--text-2); }
.split li .check { margin-top: 2px; }

/* mini payments chart */
.donut { width: 160px; height: 160px; border-radius: 50%; margin: 0 auto 1rem;
  background: conic-gradient(var(--success) 0 62%, var(--warning) 62% 82%, var(--crisis) 82% 100%);
  display: grid; place-items: center; position: relative; }
.donut::after { content: ""; width: 96px; height: 96px; background: var(--surface); border-radius: 50%; }
.donut .center { position: absolute; text-align: center; }
.donut .center b { font-size: 1.4rem; display: block; color: var(--text); }
.donut .center small { color: var(--text-muted); }
.legend { display: grid; gap: .5rem; }
.legend div { display: flex; align-items: center; justify-content: space-between; font-size: .9rem; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: .5rem; }
.roster { margin-top: 1rem; border-top: 1px solid var(--border); }
.roster .r { display: flex; justify-content: space-between; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }

/* HIPAA / security */
.security-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.sec { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.sec h3 { font-size: 1.05rem; display: flex; gap: .5rem; align-items: center; }
.sec p { font-size: .9rem; margin: 0; }

/* CTA / contact */
.cta { background: var(--surface); }
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.contact-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: .35rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 1rem; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.contact-list { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.contact-list li { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: 1rem; }
.contact-list .ico { font-size: 1.3rem; }
.form-note { font-size: .8rem; color: var(--text-muted); }
.form-success { display: none; background: var(--primary-light); color: var(--primary-dark); padding: 1rem; border-radius: var(--radius-sm); font-weight: 600; }

/* footer */
.site-footer { background: var(--text); color: #cfcdc8; padding: 3rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.site-footer .brand { color: #fff; }
.site-footer .brand small { color: #8d8b86; }
.site-footer h4 { color: #fff; font-size: .95rem; margin: 0 0 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .6rem; }
.site-footer a { color: #cfcdc8; font-size: .92rem; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2.5rem; padding-top: 1.5rem; font-size: .85rem; color: #8d8b86; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }

/* ---------- Login page ---------- */
.auth-wrap { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 3rem 0; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 1.6rem; text-align: center; }
.auth-card .sub { text-align: center; margin-bottom: 1.5rem; }
.seg { display: flex; background: var(--surface-alt); border-radius: 999px; padding: 4px; margin-bottom: 1.5rem; }
.seg button { flex: 1; border: 0; background: none; padding: .6rem; border-radius: 999px; font-weight: 700; font-family: inherit; cursor: pointer; color: var(--text-2); }
.seg button.active { background: #fff; color: var(--primary-dark); box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.auth-foot { text-align: center; font-size: .88rem; margin-top: 1.25rem; color: var(--text-2); }
.store-badges { display: flex; gap: .75rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.store-badge { display: inline-flex; align-items: center; gap: .5rem; background: var(--text); color: #fff; padding: .6rem 1rem; border-radius: 12px; font-weight: 700; font-size: .85rem; }
.notice { background: var(--accent-light); color: #8a4f28; padding: .85rem 1rem; border-radius: var(--radius-sm); font-size: .85rem; margin-top: 1.25rem; }

/* ---------- Legal pages (privacy / terms) ---------- */
.legal { max-width: 820px; margin: 0 auto; padding: 3rem 0; }
.legal h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: .25rem; }
.legal .updated { color: var(--text-muted); font-size: .9rem; margin-bottom: 2rem; }
.legal h2 { font-size: 1.35rem; margin: 2.25rem 0 .75rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.legal h3 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
.legal p, .legal li { color: var(--text-2); }
.legal ul { padding-left: 1.25rem; margin: 0 0 1rem; }
.legal li { margin-bottom: .5rem; }
.legal a { color: var(--primary-dark); text-decoration: underline; }
.legal .callout { background: var(--primary-light); border-radius: var(--radius-sm); padding: 1.25rem 1.5rem; margin: 1.5rem 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: .92rem; }
.legal th, .legal td { text-align: left; padding: .65rem .75rem; border: 1px solid var(--border); vertical-align: top; }
.legal th { background: var(--surface-alt); font-weight: 700; color: var(--text); }
.legal .toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 2rem; }
.legal .toc ol { margin: .5rem 0 0; padding-left: 1.25rem; }
.legal .toc a { text-decoration: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .split, .split.alt .split-media, .contact-wrap, .founder-grid { grid-template-columns: 1fr; }
  .split.alt .split-media { order: 0; }
  .audience-grid, .feature-grid, .security-grid { grid-template-columns: 1fr 1fr; }
  .steps, .stat-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-media { margin-top: 1rem; }
}
/* Collapse the inline nav to a hamburger before it gets cramped */
@media (max-width: 1024px) {
  .nav-links, .nav-cta .btn-ghost { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: flex-start; position: absolute; top: 72px; left: 0; right: 0;
    background: var(--surface); padding: 1rem 24px 1.5rem; border-bottom: 1px solid var(--border); gap: 1rem;
    box-shadow: var(--shadow);
  }
  .nav-links.open a { font-size: 1rem; }
}

@media (max-width: 640px) {
  .audience-grid, .feature-grid, .security-grid, .steps, .stat-grid, .footer-grid { grid-template-columns: 1fr; }
  .founder { flex-direction: column; align-items: center; text-align: center; gap: 1rem; padding: 1.5rem; }
  .founder img, .founder .ph { width: 80px; height: 80px; }
}
