/* Yogelo promo codes: shared styles for the owner app and the customer page. Uses tokens.css only. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs-base)/var(--lh-body) var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-1); }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--font-display); font-variation-settings: "wdth" var(--wdth-display); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-xl); line-height: var(--lh-tight); font-weight: 750; }
h2 { font-size: var(--fs-lg); line-height: var(--lh-snug); font-weight: 700; }
h3 { font-size: var(--fs-md); line-height: var(--lh-snug); font-weight: 700; }
p { margin: 0; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.handle { font-weight: 700; overflow-wrap: anywhere; }

/* the money sentence: the one big moment on Results and on each source */
.sentence { font-family: var(--font-display); font-variation-settings: "wdth" 78; font-weight: 750; font-size: clamp(2rem, 9.4vw, var(--fs-3xl)); line-height: 1.04; letter-spacing: -0.02em; }
.sentence > span + span { margin-top: 0.08em; }
.sentence > span { display: block; }
.sentence .back { color: var(--accent); }
.sentence .money { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- buttons and fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap); padding: 0 var(--s-5); border-radius: var(--r-2);
  border: 1px solid var(--rule-2); background: var(--surface); color: var(--text);
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.btn:hover { border-color: var(--ink-3); background: var(--paper-2); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.big { min-height: 56px; font-size: var(--fs-md); width: 100%; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--accent); padding: 0 var(--s-3); }
.btn.quiet:hover { background: var(--accent-tint); }
.btn.danger { color: var(--error); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.field { display: grid; gap: var(--s-2); }
.field > label, .field > .label { font-weight: 700; font-size: var(--fs-sm); }
.field .hint { font-size: var(--fs-sm); color: var(--text-2); }
.field .err { font-size: var(--fs-sm); color: var(--error); font-weight: 600; }
.input {
  width: 100%; min-height: var(--tap); padding: 10px 14px;
  border: 1px solid var(--rule-2); border-radius: var(--r-1); background: var(--surface);
  font-size: var(--fs-base);
}
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-ring); }
.input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-50); }
input[type="date"].input { min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; display: block; }
textarea.input { min-height: 88px; resize: vertical; line-height: var(--lh-body); }
.affix { position: relative; }
.affix > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.affix > .input { padding-left: 32px; }
.grid-2 { display: grid; gap: var(--s-4); grid-template-columns: 1fr 1fr; }
.grid-2 > * { min-width: 0; }

/* segmented choice (radio buttons) */
.seg { display: flex; flex-wrap: wrap; gap: var(--s-2); border: 0; padding: 0; margin: 0; }
.seg legend { font-weight: 700; font-size: var(--fs-sm); margin-bottom: var(--s-2); padding: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-4);
  border: 1px solid var(--rule-2); border-radius: var(--r-full); background: var(--surface); font-weight: 600; font-size: var(--fs-sm);
}
.seg label:hover span { border-color: var(--ink-3); }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- small pieces ---------- */
.demo-badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: var(--r-1);
  border: 1px solid var(--rule-2); color: var(--text-2); font-size: var(--fs-xs); font-weight: 700; background: var(--surface);
}
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-2); font-weight: 600; font-size: var(--fs-sm);
  opacity: 0; pointer-events: none; transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); z-index: 50;
  max-width: calc(100vw - 32px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 32px; } }
.loading { color: var(--text-2); padding: var(--s-7) 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
