/* ReceiptRow website. The colours are the app's asset colours:
   AccentColor (ledger green), Canvas (the page) and Paper (cards),
   each with its light and dark value. */

:root {
  color-scheme: light dark;
  --canvas: #f4f2ec;
  --paper: #fffefb;
  --ink: #1b1f1d;
  --ink-soft: #565d59;
  --rule: #dcd8cd;
  --accent: #17755a;
  --accent-ink: #ffffff;
  --accent-wash: #e2eee8;
  --meals: #c9561b;
  --meals-wash: #fbe7da;
  --shadow: rgba(60, 50, 25, 0.16);
  --radius: 18px;
  --measure: 40rem;
  --wide: 68rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0f1211;
    --paper: #1c211f;
    --ink: #eceeeb;
    --ink-soft: #a6ada9;
    --rule: #303734;
    --accent: #2da07a;
    --accent-ink: #06120d;
    --accent-wash: #173129;
    --meals: #f08a4b;
    --meals-wash: #3a2418;
    --shadow: rgba(0, 0, 0, 0.5);
  }
}

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

img {
  max-width: 100%;
  height: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.9rem;
  background: var(--paper);
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
}

/* Header and footer */

.site-header,
.site-footer {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
  padding-top: 1.75rem;
  padding-bottom: 2.5rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.site-footer p {
  margin: 0;
}

/* Paper: the card cut like a receipt, with a torn bottom edge. The mask
   cuts the edge, so the shadow sits on a wrapper. */

.paper-shadow {
  filter: drop-shadow(0 1px 1px var(--shadow)) drop-shadow(0 10px 18px var(--shadow));
}

.paper {
  --tooth: 9px;
  background: var(--paper);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem 1.5rem calc(1.5rem + var(--tooth));
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--tooth)) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--tooth)) 100%;
}

.card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 2px var(--shadow);
}

/* Landing page */

main {
  display: block;
}

.hero {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.hero h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.4rem, 5.5vw, 3.75rem);
  font-weight: 800;
}

.lede {
  margin: 0 0 2rem;
  max-width: 34rem;
  color: var(--ink-soft);
  font-size: 1.25rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  text-decoration: none;
}

.badge[aria-disabled="true"] {
  cursor: default;
}

.text-link {
  font-weight: 600;
}

/* The hero picture: a receipt in a scanner's corners, and the row it
   becomes. Text in it is the app's made-up sample receipt. */

.scan {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1.5rem;
}

.frame {
  position: relative;
  padding: 1.25rem;
  width: min(100%, 20rem);
}

.frame::before,
.frame::after,
.frame > .corner-b::before,
.frame > .corner-b::after {
  content: "";
  position: absolute;
  width: 2.25rem;
  height: 2.25rem;
  border: 4px solid var(--accent);
}

.frame::before {
  top: 0;
  left: 0;
  border-right: 0;
  border-bottom: 0;
  border-top-left-radius: 14px;
}

.frame::after {
  top: 0;
  right: 0;
  border-left: 0;
  border-bottom: 0;
  border-top-right-radius: 14px;
}

.frame > .corner-b::before {
  bottom: 0;
  left: 0;
  border-right: 0;
  border-top: 0;
  border-bottom-left-radius: 14px;
}

.frame > .corner-b::after {
  bottom: 0;
  right: 0;
  border-left: 0;
  border-top: 0;
  border-bottom-right-radius: 14px;
}

.receipt {
  font: 0.875rem/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  rotate: -2deg;
}

.receipt .paper {
  border-radius: 6px 6px 0 0;
}

.receipt-head {
  margin: 0 0 0.85rem;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.receipt dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 1rem;
}

.receipt dt,
.receipt dd {
  margin: 0;
}

.receipt dd {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.receipt hr {
  border: 0;
  border-top: 1px dashed var(--rule);
  margin: 0.45rem 0;
}

.receipt .total {
  font-weight: 700;
}

.row-card {
  width: min(100%, 22rem);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1.1rem;
}

.chip {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 12px;
  background: var(--meals-wash);
  color: var(--meals);
}

.chip svg {
  width: 1.3rem;
  height: 1.3rem;
}

.row-card strong {
  display: block;
  line-height: 1.3;
}

.row-card .meta {
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.money {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.arrow {
  color: var(--accent);
  width: 1.75rem;
  height: 1.75rem;
}

/* Sections */

.section {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.section > h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 750;
}

.section > .intro {
  margin: 0 0 2rem;
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: 1.125rem;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.75rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.steps h3,
.features h3,
.plans h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1875rem;
}

.steps p,
.features p {
  margin: 0;
  color: var(--ink-soft);
}

.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 1.25rem;
}

.icon {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  background: var(--accent-wash);
  color: var(--accent);
}

.icon svg {
  width: 1.3rem;
  height: 1.3rem;
}

.privacy-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.privacy-band h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
}

.checks {
  list-style: none;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.checks li {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: 0.6rem;
}

.checks svg {
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 0.2rem;
  color: var(--accent);
}

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.plan .price {
  margin: 0.25rem 0 1rem;
  font: 800 2.25rem/1.1 ui-rounded, system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
}

.plan .price small {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.plan ul {
  margin: 0;
  padding-left: 1.2rem;
}

.plan li + li {
  margin-top: 0.35rem;
}

.plan-pro {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.fine {
  margin: 1.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  max-width: var(--measure);
}

/* Policy and support pages */

.doc {
  max-width: calc(var(--measure) + 3rem);
  margin: 0 auto;
  padding: 2rem 1.5rem 1rem;
}

.doc h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
}

.doc .updated {
  margin: 0 0 2rem;
  color: var(--ink-soft);
}

.doc h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.375rem;
}

.doc p,
.doc li {
  text-wrap: pretty;
}

.doc ul {
  padding-left: 1.25rem;
}

.doc li + li {
  margin-top: 0.4rem;
}

.summary {
  margin: 0 0 1rem;
}

.summary h2 {
  margin-top: 0;
}

.summary ul {
  margin-bottom: 0;
}

.faq {
  display: grid;
  gap: 0.75rem;
}

.faq details {
  background: var(--paper);
  border-radius: 14px;
  box-shadow: 0 1px 2px var(--shadow);
}

.faq summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 650;
  list-style-position: outside;
  margin-left: 1.25rem;
}

.faq details > div {
  padding: 0 1.25rem 1.1rem;
}

.faq details > div > :first-child {
  margin-top: 0;
}

.faq details > div > :last-child {
  margin-bottom: 0;
}

.contact {
  margin-top: 2.5rem;
}

kbd,
.ui {
  font-weight: 600;
}

/* The support form. No script: the browser's own checks (required,
   type="email", maxlength) and the server's errors are all it has. */

.support-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
}

.field textarea {
  resize: vertical;
  min-height: 9rem;
}

.field input:focus-visible,
.field textarea:focus-visible {
  border-color: var(--accent);
}

.field [aria-invalid="true"] {
  border-color: var(--meals);
}

.field-error,
.form-error {
  margin: 0;
  color: var(--meals);
  font-weight: 600;
}

.form-error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: var(--meals-wash);
}

.form-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.support-form .badge {
  justify-self: start;
  border: 0;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

/* The honeypot (frontend\models\SupportForm): off the screen rather than
   display: none, which some bots know to skip. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Narrow screens */

@media (max-width: 52rem) {
  .hero,
  .privacy-band {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 2.5rem;
    padding-top: 1rem;
  }

  .steps,
  .plans {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .receipt {
    transition: rotate 0.3s ease;
  }

  .scan:hover .receipt {
    rotate: 0deg;
  }
}

@media print {
  .site-header nav,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
