/* Shopify Sales Tracker site: welcome, uninstall and privacy pages. Same tokens as the extension
   (shadcn/ui-like: neutral base, one blue accent). */

:root {
  color-scheme: light;
  --background: #f6f7f9;
  --foreground: #09090b;
  --muted-foreground: #52525b;
  --card: #ffffff;
  --border: #e4e4e7;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --ring: #2563eb;
  --radius: 0.75rem;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 1px 3px rgb(0 0 0 / 0.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #09090b;
    --foreground: #fafafa;
    --muted-foreground: #a1a1aa;
    --card: #111113;
    --border: #27272a;
    --primary: #60a5fa;
    --primary-soft: #172554;
    --ring: #60a5fa;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font: 1rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

.page { max-width: 64rem; margin: 0 auto; padding: 3rem 1rem 3.5rem; }

/* Only the section of the current mode is shown. */
.mode { display: none; }
body[data-mode="pin"] .mode-pin,
body[data-mode="usage"] .mode-usage { display: block; }

.logo { display: block; width: 4rem; height: 4rem; margin: 0 auto 1rem; }

h1 {
  margin: 0 0 1rem;
  text-align: center;
  font-size: clamp(1.875rem, 4vw + 0.5rem, 2.75rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 42rem;
  margin: 0 auto 1.75rem;
  text-align: center;
  font-size: 1.125rem;
}

/* Step numbers inside sentences, matching the numbered marks on the pictures. */
.n {
  display: inline-grid; place-items: center;
  width: 1.5rem; height: 1.5rem; margin: 0 0.125rem;
  border: 2px solid var(--primary); border-radius: 50%;
  color: var(--primary); font-size: 0.8125rem; font-weight: 800; line-height: 1;
  vertical-align: 0.1em;
}

.shot { max-width: 54rem; margin: 0 auto 2.75rem; }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { margin-top: 0.75rem; text-align: center; color: var(--muted-foreground); font-size: 0.9375rem; }
.shot-toolbar { margin-bottom: 2.5rem; }

/* ---- usage steps ---- */
.steps { list-style: none; margin: 0 auto; padding: 0; max-width: 54rem; display: flex; flex-direction: column; gap: 1.25rem; }

.step {
  display: grid; grid-template-columns: 1fr 17.5rem; gap: 2rem; align-items: center;
  padding: 1.75rem;
  background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}

.step h2 { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.75rem; font-size: 1.375rem; line-height: 1.25; }
.step p { margin: 0 0 0.75rem; }
.step p:last-child { margin-bottom: 0; }

.num {
  display: inline-grid; place-items: center; flex: none;
  width: 2rem; height: 2rem;
  border: 2px solid var(--primary); border-radius: 50%;
  color: var(--primary); font-size: 1rem; font-weight: 800;
}

.popup { margin: 0; }
/* Wide capture (dashboard): text on top, the picture full width below. */
.step-wide { grid-template-columns: 1fr; gap: 1.25rem; }
/* Half-width capture (notifications panel). */
.step-half { grid-template-columns: 1fr 1fr; }

/* Honest note under the steps: the numbers are estimates. */
.estimate {
  display: flex; gap: 0.75rem; align-items: flex-start;
  max-width: 54rem; margin: 1.25rem auto 0; padding: 1rem 1.25rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--primary-soft);
  font-size: 0.9375rem;
}
.estimate svg {
  flex: none; width: 1.25rem; height: 1.25rem; margin-top: 0.125rem; color: var(--primary);
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.popup img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.12);
}

/* Inline icon + label, e.g. "▷ Start". */
.ico { white-space: nowrap; }
.ico svg {
  width: 1em; height: 1em; margin-right: 0.2em; vertical-align: -0.12em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.ico svg polygon { fill: currentColor; }

/* A reassuring side note under a step (e.g. what Chrome's permission dialog says). */
.aside { color: var(--muted-foreground); font-size: 0.9375rem; padding-left: 0.75rem; border-left: 2px solid var(--border, #e4e4e7); }
.switch { margin: 2.5rem 0 0; text-align: center; color: var(--muted-foreground); }
.switch a {
  display: inline-block; padding: 0.625rem 0.25rem; margin-left: 0.25rem;
  color: var(--primary); font-weight: 600; text-underline-offset: 3px;
}
.switch a:hover { text-decoration-thickness: 2px; }

.credits {
  max-width: 64rem; margin: 0 auto; padding: 1.5rem 1rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center; color: var(--muted-foreground); font-size: 0.8125rem; line-height: 1.5;
}
.credits p { margin: 0; }
/* Inline links padded to a 44 px touch target without breaking the sentence flow. */
.credits a {
  display: inline-block; padding: 0.875rem 0; margin: -0.5rem 0;
  color: inherit; text-underline-offset: 3px;
}
.credits a:hover { color: var(--foreground); }

/* Text pages (privacy policy): narrow column for comfortable reading. */
.doc { max-width: 46rem; }
.doc h1 { text-align: left; margin: 1.5rem 0 0.25rem; font-size: 2rem; line-height: 1.2; letter-spacing: -0.02em; }
.doc h2 { margin: 2rem 0 0.5rem; font-size: 1.25rem; line-height: 1.3; }
.doc p, .doc li { overflow-wrap: anywhere; }
.doc ul { padding-left: 1.25rem; }
.doc li + li { margin-top: 0.25rem; }
.doc .updated { margin-top: 0; color: var(--muted-foreground); }
.doc a { color: var(--primary); text-underline-offset: 3px; }
.doc-home {
  display: inline-flex; align-items: center; gap: 0.625rem; min-height: 2.75rem;
  color: var(--foreground) !important; font-weight: 600; text-decoration: none;
}
.doc-home img { border-radius: 0.5rem; }

/* Uninstall page: one question with one-click reasons. */
.bye { max-width: 36rem; }
.bye .lead { margin-bottom: 1.5rem; }
.bye-form, .thanks {
  padding: 1.25rem;
  background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}
.reasons { display: grid; gap: 0.5rem; margin: 0 0 1.25rem; padding: 0; border: 0; }
.reason {
  display: flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; padding: 0.5rem 0.875rem;
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.reason:hover { border-color: var(--muted-foreground); }
.reason:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.reason input { flex: none; width: 1.125rem; height: 1.125rem; margin: 0; accent-color: var(--primary); }
.comment-label { display: block; margin-bottom: 0.375rem; font-weight: 600; font-size: 0.9375rem; }
.bye textarea {
  display: block; width: 100%; min-height: 5rem; margin-bottom: 1rem; padding: 0.625rem 0.75rem;
  background: var(--background); color: var(--foreground);
  border: 1px solid var(--border); border-radius: var(--radius); font: inherit; resize: vertical;
}
.btn {
  display: block; width: 100%; min-height: 2.75rem; padding: 0.625rem 1rem;
  border: 0; border-radius: var(--radius); background: var(--primary); color: #fff;
  font: inherit; font-weight: 600; cursor: pointer;
}
@media (prefers-color-scheme: dark) { .btn { color: #09090b; } }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.form-error { margin: 0.75rem 0 0; color: #dc2626; font-size: 0.9375rem; }
.thanks { text-align: center; }
.thanks h2 { margin: 0 0 0.25rem; font-size: 1.375rem; }
.thanks p { margin: 0; color: var(--muted-foreground); }
.bye-links { margin: 1.5rem 0 0; text-align: center; }
.bye-links a { display: inline-block; padding: 0.625rem 0.25rem; color: var(--primary); font-weight: 600; text-underline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
.reason:has(input:focus-visible), .btn:focus-visible, .bye textarea:focus-visible, .thanks:focus-visible {
  outline: 2px solid var(--ring); outline-offset: 2px;
}

@media (max-width: 720px) {
  .page { padding-top: 2rem; }
  .lead { font-size: 1rem; }
  .step { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.25rem; }
  .popup { max-width: 20rem; margin: 0 auto; }
  .step h2 { font-size: 1.25rem; }
  .step-wide .popup, .step-half .popup { max-width: none; }
}
