/* OhGrocer site chrome for the legal and account pages: same language as the home page.
   One green accent over green-tinted neutrals, topographic contour layer, light and dark
   from the system setting. Shape rule: containers 22px, buttons are pills. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --font: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --bg: #eef2ec;
  --surface: #f8faf6;
  --tint: #dfe9dc;
  --tint-2: #d2e0cf;
  --ink: #0f2418;
  --ink-2: #3a4e41;
  --ink-3: #566a5c;
  --line: #c9d7c6;
  --brand: #0b6b3a;
  --brand-dark: #08582e;
  --on-brand: #ffffff;
  --contour: #0b6b3a;
  --danger-bg: #f6e3df;
  --danger-fg: #8f2a1f;
  --shadow-tint: 11, 60, 32;

  --r-box: 22px;
  --z-nav: 10;
  --z-grain: 20;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b130e;
    --surface: #121e16;
    --tint: #16261c;
    --tint-2: #1c3125;
    --ink: #e6efe7;
    --ink-2: #b2c3b6;
    --ink-3: #8fa394;
    --line: #243629;
    --brand: #4cc786;
    --brand-dark: #6fd9a0;
    --on-brand: #06150c;
    --contour: #4cc786;
    --danger-bg: #3a1c18;
    --danger-fg: #f2a79d;
    --shadow-tint: 0, 0, 0;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  font-variant-numeric: tabular-nums;
}
main { flex: 1; }
h1, h2, h3 { margin: 0; line-height: 1.06; letter-spacing: -0.03em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--brand); text-underline-offset: 3px; }
img { max-width: 100%; }
::selection { background: var(--tint-2); color: var(--ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -52px;
  z-index: var(--z-nav);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

/* Fixed, click-through film grain. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { body::after { mix-blend-mode: screen; opacity: 0.045; } }

/* Contour layer: the SVG is an alpha mask, so one file serves both themes. */
.topo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--contour);
  -webkit-mask: url("topo.svg") var(--mx, 70%) var(--my, 40%) / var(--ms, cover) no-repeat;
  mask: url("topo.svg") var(--mx, 70%) var(--my, 40%) / var(--ms, cover) no-repeat;
}

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 68px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.nav-brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a:not(.btn) { font-weight: 500; font-size: 0.95rem; color: var(--ink-2); text-decoration: none; }
.nav-links a:not(.btn):hover, .nav-links a[aria-current="page"] { color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
  padding: 15px 28px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 28px -8px rgba(var(--shadow-tint), 0.55);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -8px rgba(var(--shadow-tint), 0.6); }
.btn:active { transform: scale(0.98); }
.btn:disabled { background: var(--tint-2); color: var(--ink-3); box-shadow: none; transform: none; cursor: not-allowed; }
.btn-sm { padding: 11px 20px; font-size: 0.92rem; box-shadow: none; }

/* ── Page hero (contour band) ── */
.doc-hero { position: relative; isolation: isolate; overflow: hidden; }
.doc-hero .topo { z-index: -2; opacity: 0.4; --ms: 130%; --my: 35%; }
.doc-hero::after { /* fades the map in from the right so the title stays readable */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 40%, transparent 78%),
    linear-gradient(0deg, var(--bg) 0%, transparent 30%);
}
.doc-hero-inner { max-width: 1280px; margin: 0 auto; padding: 72px 28px 56px; }
.doc-hero h1 { font-size: clamp(2.8rem, 7vw, 5.6rem); font-weight: 800; letter-spacing: -0.04em; max-width: 12ch; }
.doc-hero p { margin-top: 14px; max-width: 46ch; color: var(--ink-2); font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.5; }
.doc-hero h1 + p { margin-top: 24px; }
.doc-hero p a { color: var(--ink); font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  .doc-hero-inner > * { animation: rise 0.9s var(--ease) both; }
  .doc-hero-inner > :nth-child(2) { animation-delay: 0.1s; }
  .doc-hero-inner > :nth-child(3) { animation-delay: 0.2s; }
  @keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
}

/* ── Legal document: sticky contents on the left, text on the right ── */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 28px 120px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  column-gap: clamp(32px, 6vw, 96px);
  row-gap: 0;
}
.container > * { grid-column: 2; max-width: 70ch; }
.container > .table-wrap { max-width: none; }
.container > .toc { grid-column: 1; grid-row: 1 / span 999; max-width: none; position: sticky; top: 92px; align-self: start; }

.container p, .container li { color: var(--ink-2); font-size: 1.04rem; line-height: 1.75; }
.container p { margin-bottom: 14px; }
.container strong { color: var(--ink); font-weight: 650; }
.container a { color: var(--brand); }
.container a:hover { color: var(--brand-dark); }
.container ul, .container ol { padding-left: 22px; margin: 0 0 18px; }
.container li { margin-bottom: 6px; }
.container li::marker { color: var(--brand); }

.container h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  font-weight: 700;
  margin: 72px 0 18px;
  scroll-margin-top: 92px;
}
.container h3 {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 30px 0 8px;
  color: var(--ink);
}
.container > :first-child { margin-top: 0; }
.container hr { border: 0; border-top: 1px solid var(--line); margin: 56px 0 24px; }
.container .footer-links { color: var(--ink-3); }
.container .footer-links a { color: var(--ink-2); font-weight: 600; }

.toc h3 { margin: 0 0 14px; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; border-left: 1px solid var(--line); }
.toc li { margin: 0; counter-increment: toc; }
.toc li::marker { content: none; }
.container .toc li { font-size: 0.93rem; line-height: 1.35; }
.toc a {
  display: block;
  padding: 7px 0 7px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.container .toc a { color: var(--ink-3); }
.toc a:hover, .container .toc a:hover { color: var(--ink); }
.toc a[aria-current="true"], .container .toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--brand); font-weight: 600; }

.box, .highlight-box {
  background: var(--tint);
  border-radius: var(--r-box);
  padding: 22px 26px;
  margin: 22px 0;
  color: var(--ink);
}
.container .box ul, .container .box p:last-child { margin-bottom: 0; }
.container .box ul { margin-top: 10px; }
.container .highlight-box, .container .highlight-box strong { color: var(--ink); font-size: 1.04rem; }

.table-wrap { overflow-x: auto; margin: 24px 0; border-radius: var(--r-box); background: var(--surface); }
.table-wrap table { border-collapse: collapse; width: 100%; min-width: 600px; font-size: 0.95rem; }
.table-wrap th, .table-wrap td { padding: 16px 20px; text-align: left; vertical-align: top; color: var(--ink-2); line-height: 1.55; }
.table-wrap th { background: var(--tint); color: var(--ink); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; }
.table-wrap tbody tr:nth-child(even) { background: color-mix(in srgb, var(--tint) 45%, transparent); }
.table-wrap td strong { color: var(--ink); }

/* ── Account deletion ── */
.page-grid {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 28px 120px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 28px clamp(32px, 6vw, 88px);
  align-items: start;
}
.form-card h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 700; margin-bottom: 8px; }
.subtitle { color: var(--ink-2); font-size: 1.04rem; margin-bottom: 32px; max-width: 46ch; }

.field { margin-bottom: 24px; }
.field label { display: block; font-weight: 600; font-size: 0.95rem; color: var(--ink); margin-bottom: 8px; }
.required { color: var(--danger-fg); margin-left: 2px; }
.field input[type="text"], .field input[type="email"], .field select, .field textarea {
  width: 100%;
  padding: 15px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: box-shadow 0.2s, background-color 0.2s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); opacity: 1; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--brand), 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}
.field textarea { min-height: 120px; resize: vertical; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 44px; }

.checkbox-group { display: flex; align-items: flex-start; gap: 12px; margin: 8px 0 30px; padding: 18px 20px; border-radius: 14px; background: var(--tint); }
.checkbox-group input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex-shrink: 0; }
.checkbox-group label { font-size: 0.95rem; line-height: 1.55; color: var(--ink-2); cursor: pointer; }

.btn-submit { width: 100%; padding: 18px 28px; }
.spinner { display: none; width: 18px; height: 18px; border: 2px solid color-mix(in srgb, var(--on-brand) 35%, transparent); border-top-color: var(--on-brand); border-radius: 50%; animation: spin 0.7s linear infinite; }
.loading .spinner { display: inline-block; }
.loading .btn-text { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

.message { display: none; padding: 16px 20px; border-radius: 14px; font-size: 0.98rem; line-height: 1.5; margin-bottom: 24px; }
.message.success { display: block; background: var(--tint-2); color: var(--ink); }
.message.error { display: block; background: var(--danger-bg); color: var(--danger-fg); }
.message.success::before { content: "Received. "; font-weight: 700; color: var(--brand-dark); }
.message.error::before { content: "Not sent. "; font-weight: 700; }

.info-box { position: sticky; top: 92px; isolation: isolate; overflow: hidden; background: var(--tint); border-radius: var(--r-box); padding: 36px; }
.info-box::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.22; background: var(--contour); -webkit-mask: url("topo.svg") 15% 70% / 320% no-repeat; mask: url("topo.svg") 15% 70% / 320% no-repeat; }
.info-box h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 18px; }
.info-box ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: step; }
.info-box li { counter-increment: step; display: grid; grid-template-columns: 2.2rem 1fr; color: var(--ink-2); line-height: 1.55; }
.info-box li::before { content: counter(step); font-family: var(--mono); font-weight: 500; color: var(--brand); }

/* ── Shared form bits (survey, join) ── */
.icon { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.btn-primary { /* same as .btn; kept because the survey markup names it */ }
.btn-secondary { background: var(--tint); color: var(--ink); box-shadow: none; }
.btn-secondary:hover { background: var(--tint-2); box-shadow: none; }
.step-desc { color: var(--ink-2); font-size: 1.04rem; margin-bottom: 28px; max-width: 46ch; }
.hint { font-size: 0.88rem; color: var(--ink-3); margin-top: 8px; }
.choice-list { display: grid; gap: 10px; }
.choice-list label, .checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line);
  color: var(--ink-2);
  font-weight: 400;
  font-size: 0.98rem;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.choice-list label:hover, .checkbox-grid label:hover { background: var(--tint); }
.choice-list label:has(input:checked), .checkbox-grid label:has(input:checked) { background: var(--tint-2); box-shadow: inset 0 0 0 2px var(--brand); color: var(--ink); font-weight: 600; }
.choice-list input, .checkbox-grid input { accent-color: var(--brand); width: 18px; height: 18px; flex-shrink: 0; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.checkbox-grid .icon { width: 20px; height: 20px; color: var(--brand); }

/* ── Survey ── */
.survey-col { grid-column: 1 / -1; max-width: 680px; width: 100%; }
.progress-wrap { margin-bottom: 36px; }
.progress-bar { height: 6px; border-radius: 999px; background: var(--tint-2); overflow: hidden; }
.progress-fill { height: 100%; width: 25%; border-radius: 999px; background: var(--brand); transition: width 0.4s var(--ease); }
.progress-label { margin-top: 10px; font-family: var(--mono); font-size: 0.82rem; color: var(--ink-3); }
.step { display: none; }
.step.active { display: block; }
@media (prefers-reduced-motion: no-preference) { .step.active { animation: stepIn 0.5s var(--ease); } }
@keyframes stepIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.step h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 700; margin-bottom: 8px; }
.btn-row { display: flex; gap: 12px; margin-top: 32px; }
.btn-row .spacer { flex: 1; }
.step .btn-submit { margin-top: 12px; }
.rating-group { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 6px; }
.rating-group input { position: absolute; opacity: 0; pointer-events: none; }
.rating-group label { margin: 0; font-size: 2.6rem; line-height: 1; cursor: pointer; color: var(--tint-2); transition: color 0.15s, transform 0.25s var(--ease); }
.rating-group label:hover, .rating-group label:hover ~ label, .rating-group input:checked ~ label { color: var(--brand); }
.rating-group label:hover { transform: scale(1.12); }
.rating-group input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 4px; }
#successState { display: none; padding: 24px 0; }
#successState .check { color: var(--brand); margin-bottom: 18px; }
#successState h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; margin-bottom: 12px; }
#successState p { color: var(--ink-2); font-size: 1.1rem; max-width: 40ch; }

/* ── Join (invite landing) ── */
.join { position: relative; isolation: isolate; overflow: hidden; flex: 1; display: grid; place-items: center; padding: 32px 20px; }
.join .topo { z-index: -1; opacity: 0.35; --mx: 60%; --my: 45%; --ms: 150%; }
.join-card { width: 100%; max-width: 440px; padding: 44px 36px 36px; border-radius: var(--r-box); background: var(--surface); text-align: center; box-shadow: 0 30px 60px -30px rgba(var(--shadow-tint), 0.5); }
.join-card .logo { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 22px; }
.join-card h1 { font-size: clamp(1.9rem, 5vw, 2.4rem); font-weight: 800; margin-bottom: 10px; }
.join-card > p { color: var(--ink-2); margin-bottom: 28px; }
.code-box { margin-bottom: 24px; padding: 20px 16px; border-radius: 14px; background: var(--tint); font-family: var(--mono); font-weight: 500; font-size: 2rem; letter-spacing: 0.3em; text-indent: 0.3em; color: var(--brand); overflow-wrap: anywhere; }
#openAppBtn { width: 100%; }
.btn-secondary-full { display: block; width: 100%; margin-top: 12px; padding: 14px 24px; border: 0; border-radius: 999px; background: var(--tint); color: var(--ink); font-family: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: background-color 0.2s, transform 0.25s var(--ease); }
.btn-secondary-full:hover { background: var(--tint-2); }
.btn-secondary-full:active { transform: scale(0.98); }
.fallback-text { margin-top: 22px; font-size: 0.9rem; color: var(--ink-3); }
.join-card .store-badges { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.join-card .store-badge { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 24px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 1rem; font-weight: 700; text-decoration: none; transition: transform 0.25s var(--ease); }
.join-card .store-badge:hover { transform: translateY(-2px); }
.join-card .store-badge svg { width: 22px; height: 22px; fill: currentColor; }
.join-card .store-badge small { display: block; font-size: 0.72rem; font-weight: 500; opacity: 0.75; }
.join-card .store-badge.disabled { background: var(--tint); color: var(--ink-3); pointer-events: none; }
.hidden { display: none; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--line); padding: 36px 28px; color: var(--ink-3); text-align: center; }
.site-footer .links { margin-bottom: 12px; }
.site-footer .links a { margin: 0 12px; font-size: 0.92rem; color: var(--ink-2); text-decoration: none; }
.site-footer .links a:hover { color: var(--brand); }
.site-footer .copyright { font-size: 0.85rem; }

/* ── Collapse ── */
@media (max-width: 960px) {
  .container { grid-template-columns: minmax(0, 1fr); padding-top: 12px; }
  .container > * { grid-column: 1; }
  .container > .toc { grid-column: 1; grid-row: auto; position: static; margin: 0 0 40px; }
  .toc ol { column-width: 220px; border-left: 0; }
  .toc a { border-left: 0; padding-left: 0; }
  .page-grid { grid-template-columns: minmax(0, 1fr); }
  .info-box { position: relative; top: auto; }
}
@media (max-width: 600px) {
  .nav-inner { padding: 0 18px; }
  .nav-links { gap: 14px; }
  .nav-links a:not(.btn) { display: none; }
  .doc-hero-inner { padding: 44px 18px 36px; }
  .doc-hero::after { background: linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 60%, transparent 100%); }
  .container, .page-grid { padding-left: 18px; padding-right: 18px; padding-bottom: 80px; }
  .container h2 { margin-top: 56px; }
  .info-box { padding: 28px 22px; }
  .site-footer { padding: 28px 18px; }
}
