/* The whole look lives here. Light only (ADR-035). */
:root {
  /* From design-tokens/tokens.json, named as Style Dictionary will emit them
     (token path, dash-joined, theme segment dropped): --color-bg-canvas is
     light.color.bg.canvas, --space-4 is space.4. site-tests/tests/tokens.spec.js
     fails if a value drifts from tokens.json. */
  --color-bg-canvas: #eff1f5;
  --color-bg-surface: #ffffff;
  --color-bg-subtle: #e6e9ef;
  --color-border-default: #ccd0da;
  --color-border-strong: #7c7f93;
  --color-text-default: #4c4f69;
  --color-text-muted: #5c5f77;
  --color-text-link: #1d5fe0;
  --color-text-on-pastel: #1e1e2e;
  --color-action-primary: #1d5fe0;
  --color-action-on-primary: #ffffff;
  --color-action-focus: #1d5fe0;
  --color-brand-symbol: #7287fd;
  --color-brand-fill: #b4befe;
  --color-brand-on-fill: #1e1e2e;
  --color-feedback-success: #2d6b37;
  --color-feedback-on-success: #ffffff;
  --color-feedback-danger: #d20f39;
  --color-feedback-on-danger: #ffffff;
  --color-card-surface: #ffffff;
  --color-card-border: #ccd0da;
  --color-card-stamp-empty: #ccd0da;
  --color-card-stamp-glyph: #1e1e2e;
  --opacity-card-glow: 0.5;
  --card-tint-pessego: #fab387;
  --card-tint-lavanda: #b4befe;
  --card-tint-menta: #94e2d5;
  --card-tint-rosa: #f5c2e7;
  --card-tint-ceu: #89dceb;
  --card-tint-amarelo: #f9e2af;
  --card-tint-verde: #a6e3a1;
  --card-tint-flamingo: #f2cdcd;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-16: 64px;

  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-card: 20px;
  --radius-pill: 999px;

  --size-touch-target: 48px;
  --size-focus-ring: 3px;
  --size-card-aspect: 1.586;

  /* font.family.* and shadow.card, written out by hand. */
  --font-display: "Young Serif", Georgia, serif;
  --font-ui: "Instrument Sans", system-ui, sans-serif;
  --shadow-card: 0 1px 2px #1e1e2e14, 0 12px 28px -18px #1e1e2e59;

  --content-width: 36rem;
}

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

html {
  color-scheme: light;
  font-variant-numeric: lining-nums tabular-nums;
  font-synthesis: none;
}

body {
  margin: 0;
  background: var(--color-bg-canvas);
  color: var(--color-text-default);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

header,
main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding-inline: var(--space-4);
}

header {
  padding-block: var(--space-6) 0;
}

main {
  padding-block: var(--space-10) var(--space-16);
}

/* The lockup: the symbol (assets/symbol.svg) plus "volta" in Young Serif,
   the ring centred on the wordmark's lowercase body (foundations.md, Logo). */
.wordmark {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: var(--size-touch-target);
  letter-spacing: -0.3px;
  color: var(--color-text-default);
  text-decoration: none;
}

/* An empty inline-block's baseline is its bottom edge, so this puts the
   box's centre 0.5ex above the wordmark's baseline. */
.wordmark::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-inline-end: 0.3em;
  vertical-align: calc(0.5ex - 0.5em);
  background: var(--color-brand-symbol);
  -webkit-mask: url("symbol.svg") center / contain no-repeat;
  mask: url("symbol.svg") center / contain no-repeat;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  text-wrap: balance;
}

/* type.display-l: screen titles. */
h1 {
  font-size: 2.125rem;
  line-height: 1.1;
  letter-spacing: -0.3px;
  margin: 0 0 var(--space-4);
}

/* type.display-xl: the holding page's headline. */
h1.display-xl {
  font-size: 3rem;
  line-height: 1.05;
  letter-spacing: -0.5px;
}

/* type.display-m */
h2 {
  font-size: 1.625rem;
  line-height: 1.15;
  margin: var(--space-10) 0 var(--space-3);
}

/* type.display-s */
h3 {
  font-size: 1.25rem;
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0 0 var(--space-4);
}

.lead {
  font-size: 1.125rem;
  color: var(--color-text-muted);
}

.muted {
  color: var(--color-text-muted);
}

a {
  color: var(--color-text-link);
  text-underline-offset: 0.15em;
}

:focus-visible {
  outline: var(--size-focus-ring) solid var(--color-action-focus);
  outline-offset: 2px;
}

.panel {
  margin-top: var(--space-10);
  padding: var(--space-6) var(--space-5);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
}

.panel > h2:first-child {
  margin-top: 0;
}

.chip {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.chip:empty {
  display: none;
}

form {
  display: grid;
  gap: var(--space-5);
}

.field {
  display: grid;
  gap: var(--space-1);
}

label {
  font-weight: 600;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: var(--size-touch-target);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background-color: var(--color-bg-surface);
  color: var(--color-text-default);
}

select {
  appearance: none;
  padding-right: var(--space-10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234c4f69' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 20px;
}

[aria-invalid="true"] {
  border-color: var(--color-feedback-danger);
  border-width: 2px;
}

.field-error {
  color: var(--color-feedback-danger);
  font-size: 0.875rem;
  font-weight: 500;
}

.field-error:empty {
  display: none;
}

.field .muted {
  font-size: 0.875rem;
}

.checkbox {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  min-height: var(--size-touch-target);
  font-weight: 400;
}

.checkbox input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--color-action-primary);
}

/* type.button; one primary per screen, in action.primary. a.button is a
   link that does a button's job. */
button,
a.button {
  justify-self: start;
  min-height: var(--size-touch-target);
  padding: 0 var(--space-6);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-action-primary);
  color: var(--color-action-on-primary);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 150ms cubic-bezier(0.2, 0, 0, 1);
}

a.button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

button:hover:not(:disabled),
a.button:hover {
  background: color-mix(in srgb, var(--color-action-primary) 85%, var(--color-text-on-pastel));
}

button:disabled {
  opacity: 0.6;
  cursor: progress;
}

@media (max-width: 30rem) {
  form button {
    justify-self: stretch;
  }
}

.notice {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  background: var(--color-bg-surface);
  margin: 0 0 var(--space-5);
}

.notice:empty {
  display: none;
}

.notice > :last-child {
  margin-bottom: 0;
}

/* Feedback always pairs its color with an icon and text. */
.notice.success,
.notice.error {
  font-weight: 500;
}

.notice.success {
  border-color: var(--color-feedback-success);
  color: var(--color-feedback-success);
}

.notice.error {
  border-color: var(--color-feedback-danger);
  color: var(--color-feedback-danger);
}

.notice.success::before,
.notice.error::before {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-weight: 700;
  line-height: 1;
}

.notice.success::before {
  content: "✓";
  content: "✓" / "";
  background: var(--color-feedback-success);
  color: var(--color-feedback-on-success);
}

.notice.error::before {
  content: "!";
  content: "!" / "";
  background: var(--color-feedback-danger);
  color: var(--color-feedback-on-danger);
}

.notice.brand {
  display: block;
  margin-top: var(--space-10);
  padding: var(--space-5);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--color-brand-fill);
  color: var(--color-brand-on-fill);
}

/* The loyalty card (docs/brand/doce.md): a neutral surface with the
   tint as a corner glow. store.js sets each Program's card_tint; lavanda
   otherwise, and for a key this page doesn't know. */
.card {
  --card-tint: var(--card-tint-lavanda);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  aspect-ratio: var(--size-card-aspect);
  margin: 0 0 var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  background-color: var(--color-card-surface);
  background-image: radial-gradient(
    62% 98% at 100% 0%,
    color-mix(in srgb, var(--card-tint) calc(var(--opacity-card-glow) * 100%), transparent),
    transparent
  );
  box-shadow: var(--shadow-card);
}

.card p,
.card ul {
  margin: 0;
}

.card ul {
  padding-left: var(--space-5);
}

.card-head {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.card-logo {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card-tint);
  color: var(--color-text-on-pastel);
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1;
}

.card-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.2;
}

.card-place {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.card .stamps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2);
  max-width: 14rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stamp {
  position: relative;
  aspect-ratio: 1;
  border: 2px dashed var(--color-card-stamp-empty);
  border-radius: 50%;
}

.stamp.filled {
  border: 2px solid var(--card-tint);
  background: var(--card-tint);
}

.stamp.filled::after {
  content: "";
  position: absolute;
  inset: 18%;
  background: var(--color-card-stamp-glyph);
  -webkit-mask: url("symbol.svg") center / contain no-repeat;
  mask: url("symbol.svg") center / contain no-repeat;
}

.card-count {
  font-size: 1rem;
  color: var(--color-text-muted);
}

.card-count strong {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
  color: var(--color-text-default);
}

.card-example {
  --card-tint: var(--card-tint-pessego);
  max-width: 22rem;
  margin: var(--space-8) 0 0;
  rotate: -2deg;
}

/* The Card page's card carries the page title, set as type.display-s. */
.card h1 {
  font-size: 1.25rem;
  line-height: 1.2;
  margin: 0;
}

.card-action {
  display: grid;
  gap: var(--space-2);
  margin-top: auto;
}

.card-alert {
  color: var(--color-feedback-danger);
  font-size: 0.875rem;
  font-weight: 500;
}

.card-note {
  font-weight: 600;
}

.save-offer {
  margin: var(--space-5) 0 0;
  font-size: 0.875rem;
}

.panel.save {
  margin: var(--space-6) 0 0;
}

/* Criar conta / Já tenho conta: two buttons, the pressed one filled. */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-1);
  margin: 0 0 var(--space-5);
  padding: var(--space-1);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
}

.segmented button {
  justify-self: stretch;
  padding: 0 var(--space-3);
  background: transparent;
  color: var(--color-text-default);
}

.segmented button:hover:not(:disabled) {
  background: var(--color-bg-surface);
}

.segmented button[aria-pressed="true"] {
  background: var(--color-action-primary);
  color: var(--color-action-on-primary);
}


/* What staff scan or type: a white field whatever surrounds it, the QR at
   least 60% of a phone's width (ADR-043). */
.qr-panel {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  margin: var(--space-6) 0 0;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: #ffffff;
  color: var(--color-text-on-pastel);
  text-align: center;
}

.qr-panel p {
  margin: 0;
}

.qr {
  width: 80%;
  max-width: 24rem;
}

.qr svg {
  display: block;
  width: 100%;
  height: auto;
}

/* 32pt or more (ADR-043). */
.manual-code {
  display: block;
  font-size: 3rem;
  line-height: 1.1;
  letter-spacing: 0.15em;
  font-variant-numeric: tabular-nums;
}

.rewards {
  padding-left: var(--space-5);
}

dl.hours {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-1) var(--space-4);
  margin: 0;
}

dl.hours dt {
  font-weight: 600;
}

dl.hours dd {
  margin: 0;
}

[hidden] {
  display: none !important;
}
