:root {
  --ink: #3d3450;        /* violeta del logo */
  --ink-soft: #6b6278;
  --cream: #f7f2ea;
  --paper: #fcfaf6;
  --line: #e6ded2;
  --sand: #d6b896;
  --orange: #d98c4f;
  --rose: #c7a1b2;
  --lilac: #eee8f3;
  --hl: #f6ead8;
  --ok: #5b8a5a;
  --radius: 28px;
  --font: 'Bitter', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

.terrazzo {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .4;
}
.terrazzo svg { width: 100%; height: 100%; }

.app {
  position: relative;
  max-width: 480px; margin: 0 auto;
  padding: 24px 20px 130px;
}
[hidden] { display: none !important; }

/* ---------- marca ---------- */
.brand { display: flex; justify-content: center; margin: 12px 0 36px; }
/* recorta el margen blanco del JPG y lo funde con el fondo crema */
.brand-crop { --w: 190px; width: var(--w); height: calc(var(--w) * .66); overflow: hidden; }
.brand-crop img {
  width: calc(var(--w) * 1.92);
  margin: calc(var(--w) * -.22) 0 0 calc(var(--w) * -.475);
  mix-blend-mode: multiply; display: block;
}
.brand-sm { margin-bottom: 20px; }
.brand-sm .brand-crop { --w: 140px; }

/* ---------- tipografía ---------- */
.title-xl { font-size: 56px; font-weight: 800; line-height: 1; margin: 0 0 12px; letter-spacing: -.02em; }
.title-lg { font-size: 34px; font-weight: 800; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
.title-md { font-size: 24px; font-weight: 800; margin: 2px 0 6px; }
.lead { font-size: 19px; color: var(--ink-soft); margin: 0 0 28px; line-height: 1.4; }
.muted { color: var(--ink-soft); margin: 0; line-height: 1.4; }
.label { font-weight: 700; font-size: 16px; padding-left: 18px; margin-top: 4px; }
.hint { font-size: 14px; color: var(--ink-soft); margin: -4px 0 0 18px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 0; }
.eyebrow-purple { color: #8a6fb0; }
.error { color: #b3473a; text-align: center; font-weight: 600; }
.info { color: var(--ok); text-align: center; font-weight: 600; margin: 0; }
.login-links { display: flex; justify-content: space-between; }

/* ---------- formulario ---------- */
.form, .stack { display: flex; flex-direction: column; gap: 14px; }
.field {
  width: 100%;
  font: 500 22px var(--font);
  color: var(--ink);
  text-align: center;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 18px 22px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  min-height: 66px;
}
.field::placeholder { color: #b3abb8; }
.field:focus { box-shadow: 0 0 0 4px rgba(61, 52, 80, .15); }
.field-hl { background: var(--hl); }
.field-code { letter-spacing: .6em; font-weight: 700; font-size: 28px; }

.btn {
  font: 600 21px var(--font);
  border: 0; border-radius: 999px;
  padding: 20px; cursor: pointer; width: 100%;
  margin-top: 10px;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:active { transform: scale(.99); }
.btn-primary:disabled { opacity: .6; }
.btn-link {
  background: none; border: 0; padding: 6px;
  font: 500 16px var(--font); color: var(--ink-soft);
  text-decoration: underline; cursor: pointer;
}

/* ---------- home ---------- */
.greeting { margin-bottom: 22px; }
.cup { font-size: 28px; }
.greeting-meta {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--ink-soft); font-size: 17px; margin-top: 8px; gap: 8px;
}
.greeting-meta .btn-link { padding: 0; }

.visits-card {
  background: var(--ink); color: #fff;
  border-radius: var(--radius); padding: 22px 24px;
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 18px;
}
.visits-card .eyebrow { color: #cfc6dc; white-space: nowrap; }
.visits-num { font-size: 64px; font-weight: 800; margin: 0; line-height: 1; }
.visits-copy { margin: 0; font-size: 15px; line-height: 1.4; color: #e5dfee; }

.rewards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.reward {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px 14px;
  box-shadow: 0 4px 14px rgba(61, 52, 80, .06);
  display: flex; flex-direction: column;
}
.reward-head { display: flex; justify-content: space-between; align-items: center; }
.reward-head h3 { margin: 0; font-size: 20px; font-weight: 800; }
.reward-badge {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-size: 18px;
  background: var(--lilac);
}
.reward-body { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.ring { width: 66px; height: 66px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--line); }
.ring .bar { stroke: var(--orange); transition: stroke-dashoffset .8s ease; }
.ring-icon { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; }
.reward-count { font-size: 38px; font-weight: 800; line-height: 1; }
.reward-count small { font-size: 18px; font-weight: 500; color: var(--ink-soft); }
.reward-desc { font-size: 13px; color: var(--ink-soft); margin: 2px 0 0; line-height: 1.25; }
.reward-divider { border: 0; border-top: 2px dashed var(--line); margin: 0 0 12px; }
.pill {
  border-radius: 999px; padding: 10px; text-align: center;
  font-weight: 600; font-size: 15px;
  background: var(--hl); color: #a8773d;
}
.pill.ready { background: #dcebd8; color: var(--ok); }
.reward-foot { text-align: center; font-size: 13px; color: var(--ink-soft); margin: 10px 0 0; }

.bday-card {
  background: var(--lilac);
  border-radius: var(--radius);
  padding: 20px; display: flex; gap: 16px; align-items: center;
}
.bday-emoji {
  font-size: 40px; width: 72px; height: 72px; flex: none;
  border-radius: 50%; background: #fff; display: grid; place-items: center;
}

/* ---------- tabbar ---------- */
.tabbar {
  position: fixed; z-index: 10;
  left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: min(440px, calc(100% - 28px));
  background: rgba(252, 250, 246, .96);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--line);
  border-radius: 34px;
  display: flex; justify-content: space-around;
  padding: 10px 8px 8px;
  box-shadow: 0 8px 24px rgba(61, 52, 80, .1);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500;
  min-width: 80px; cursor: pointer;
}
.tab-icon { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; }
.tab-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--ink); }
.tab.active .tab-icon { background: var(--ink); color: #fff; }

@media (max-width: 360px) {
  .rewards { grid-template-columns: 1fr; }
  .title-lg { font-size: 30px; }
  .visits-card { flex-direction: column; align-items: flex-start; }
}
