/* Club de Recompensas · solo blanco y verde (manual de identidad City Salads, uso a una tinta) */
@font-face { font-family: 'Jost'; font-weight: 400; font-display: swap; src: url('/fonts/jost-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 500; font-display: swap; src: url('/fonts/jost-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 600; font-display: swap; src: url('/fonts/jost-latin-600-normal.woff2') format('woff2'); }

:root {
  --green: #9AC336;      /* Pantone 376 C */
  --ink: #23360D;        /* texto */
  --muted: #4F6B2E;      /* texto secundario */
  --pale: #F3F8E8;       /* fondos suaves */
  --line: #DCE9C2;       /* bordes */
  --field: #739A27;      /* bordes de campos */
  --white: #FFFFFF;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 16px; line-height: 1.45; }
a { color: var(--ink); }
a:hover { color: var(--muted); }
h1 { font-size: 30px; font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 20px; font-weight: 600; margin: 28px 0 8px; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.form-col { display: flex; flex-direction: column; gap: 14px; }
.center-self { align-self: center; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.label { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; color: var(--muted); }
.kicker { font-size: 11px; font-weight: 600; letter-spacing: 0.2em; color: var(--muted); }
.ico { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- página pública ---------- */
.page { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.brand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 24px 20px; border-bottom: 1px solid var(--line); }
.brand-logo { height: 72px; width: auto; display: block; }
.brand-small { padding: 16px 24px 14px; }
.brand-small .brand-logo { height: 52px; }
.intro { padding: 28px 24px 8px; display: flex; flex-direction: column; gap: 10px; }
.block { padding: 18px 24px; display: flex; flex-direction: column; gap: 10px; }
.notice { margin: 16px 24px 0; padding: 12px 16px; border-radius: 12px; background: var(--pale); border: 1px solid var(--field); font-size: 15px; }

.prize-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.prize-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 2px 10px; border-radius: 12px; background: var(--pale); text-align: center; }
.prize-tile strong { font-size: 20px; line-height: 1; }
.prize-visit { font-size: 12px; color: var(--muted); line-height: 1; }
.prize-name { font-size: 11px; color: var(--muted); line-height: 1.2; overflow-wrap: anywhere; }

.form { display: flex; flex-direction: column; gap: 16px; padding: 18px 24px 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.hint { font-size: 13px; color: var(--muted); }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], input:not([type]), select, textarea {
  height: 50px; padding: 0 14px; border: 1px solid var(--field); border-radius: 12px; background: var(--white); font-size: 16px; width: 100%; min-width: 0;
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--green); outline-offset: 1px; }
.phone-row { display: flex; gap: 8px; }
.phone-row select { width: 112px; flex-shrink: 0; }
.checks { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--muted); flex-shrink: 0; }
.form-error { margin: 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--ink); background: var(--white); font-size: 15px; }

.btn { display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 18px; border-radius: 14px; border: 0; font-size: 17px; font-weight: 500; text-decoration: none; cursor: pointer; text-align: center; }
.btn-primary { background: var(--green); color: var(--ink); font-weight: 600; min-height: 54px; }
.btn-primary:hover { color: var(--ink); filter: brightness(0.96); }
.btn-primary:disabled { opacity: 0.55; cursor: default; }
.btn-outline { background: var(--white); color: var(--ink); border: 1.5px solid var(--ink); }
.btn-soft { background: var(--line); color: var(--ink); }
.btn-wallet { background: #000; color: #fff; min-height: 54px; }
.btn-wallet:hover { color: #fff; }
.btn-wallet-outline { background: var(--white); color: var(--ink); border: 1.5px solid var(--ink); min-height: 54px; }
.btn-small { min-height: 40px; font-size: 15px; padding: 0 14px; border-radius: 10px; }

.site-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.site-foot nav { display: flex; gap: 16px; font-size: 13px; flex-wrap: wrap; justify-content: center; }

/* ---------- tarjeta ---------- */
.welcome { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 24px 20px; text-align: center; }
.welcome-badge { width: 72px; height: 72px; border-radius: 36px; background: var(--green); display: flex; align-items: center; justify-content: center; }
.welcome-badge img { width: 56px; height: auto; }
.hello { padding: 22px 24px 12px; }
.card { margin: 4px 16px 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--white); }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 12px; }
.card-logo { height: 46px; width: auto; }
.card-count { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.card-count strong { font-size: 24px; font-weight: 600; line-height: 1.1; }
.card-stamps { background: var(--pale); padding: 16px 18px; }
.stamps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 10px; justify-items: center; }
.stamp { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--line); background: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 500; color: var(--muted); }
.stamp-prize { border-color: var(--green); }
.stamp-on { background: var(--green); border-color: var(--green); }
.stamp-on img { width: 40px; height: auto; }
.card-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 14px 18px 4px; }
.card-fields dt { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; color: var(--muted); }
.card-fields dd { margin: 2px 0 0; font-size: 16px; font-weight: 500; }
.card-fields .right { text-align: right; }
.card-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 18px 20px; }
.qr { width: 172px; height: 172px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.qr svg { width: 100%; height: 100%; display: block; }
.code { font-size: 14px; letter-spacing: 0.12em; color: var(--muted); }
.status-line { margin: 12px 24px 0; text-align: center; font-size: 14px; color: var(--muted); }
.ready { margin: 16px 16px 0; padding: 14px 16px; border-radius: 14px; background: var(--green); color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
.ready ul { margin: 0; padding-left: 18px; }
.ready .muted { color: var(--ink); opacity: 0.8; }
.wallet-buttons { display: flex; flex-direction: column; gap: 12px; padding: 20px 24px 4px; }

/* ---------- textos legales ---------- */
.doc .legal { padding: 24px; }
.legal h1 { font-size: 26px; margin-bottom: 8px; }
.legal p, .legal li { font-size: 15px; }
.legal ul { padding-left: 20px; }
.legal .notice { margin: 0 0 12px; }

/* ---------- caja y panel ---------- */
.app { min-height: 100vh; background: var(--pale); display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 24px; background: var(--white); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topbar-brand { display: flex; align-items: center; gap: 14px; }
.topbar-brand img { height: 44px; width: auto; }
.topbar-title { font-size: 17px; font-weight: 500; color: var(--muted); }
.topbar-sep { width: 1px; height: 28px; background: var(--line); }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel h2 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; color: var(--muted); }
.caja-grid { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 20px; padding: 20px 24px 28px; flex: 1; }
.scanner { position: relative; height: 260px; border-radius: 16px; background: var(--ink); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner-msg { position: relative; color: #E4F0CC; text-align: center; font-size: 15px; padding: 0 20px; }
.scanner-frame { position: absolute; inset: 40px 70px; border: 3px solid var(--green); border-radius: 14px; pointer-events: none; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.row { display: flex; gap: 8px; align-items: stretch; }
.row > input { flex: 1; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.member-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.member-name { font-size: 28px; font-weight: 500; line-height: 1.1; }
.member-count { font-size: 28px; font-weight: 600; line-height: 1.1; text-align: right; }
.stamps-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; }
.stamps-row .stamp { width: 100%; max-width: 48px; height: auto; aspect-ratio: 1; justify-self: center; }
.stamps-row .stamp-on img { width: 75%; }
.rewards-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.reward-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--pale); border: 1px solid var(--line); }
.banner { padding: 14px 16px; border-radius: 12px; font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.banner-ok { background: var(--green); color: var(--ink); }
.banner-warn { background: var(--white); border: 1.5px solid var(--ink); color: var(--ink); }
.big-action { min-height: 60px; font-size: 18px; width: 100%; }
#client { display: flex; flex-direction: column; gap: 14px; }
#client h2 { margin-top: 4px; }
.page > p.center { padding: 0 24px; }
.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); text-align: center; padding: 40px 20px; }
.empty-state img { width: 120px; opacity: 0.9; }
.recent { font-size: 13px; color: var(--muted); margin: 0; padding-left: 18px; }

.login { max-width: 420px; margin: 40px auto; width: calc(100% - 32px); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { min-height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--white); font-size: 22px; cursor: pointer; }
.keypad button:active { background: var(--pale); }

dialog { border: 0; border-radius: 18px; padding: 0; max-width: 460px; width: calc(100% - 32px); color: var(--ink); }
dialog::backdrop { background: rgba(35, 54, 13, 0.45); }
.dialog-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.dialog-body h3 { margin: 0; font-size: 20px; font-weight: 600; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.qr-big { width: 240px; height: 240px; margin: 0 auto; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.qr-big svg { width: 100%; height: 100%; display: block; }

/* panel de administración */
.tabs { display: flex; gap: 4px; padding: 0 24px; background: var(--white); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 14px 14px 12px; font-size: 15px; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--green); font-weight: 500; }
.admin-main { padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 20px; max-width: 1200px; width: 100%; margin: 0 auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi strong { font-size: 28px; font-weight: 600; line-height: 1.1; }
.kpi span { font-size: 13px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 12px; letter-spacing: 0.06em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 3px; height: 140px; }
.bar { background: var(--green); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: var(--pale); border: 1px solid var(--line); }
.chip-on { background: var(--green); border-color: var(--green); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.prize-form { display: grid; grid-template-columns: 90px minmax(0, 1fr) 160px; gap: 10px; align-items: center; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--white); padding: 12px 18px; border-radius: 12px; font-size: 15px; z-index: 50; max-width: calc(100% - 32px); }

@media (max-width: 860px) {
  .caja-grid { grid-template-columns: 1fr; padding: 14px; }
  .stamps-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .topbar { padding: 10px 14px; }
  .admin-main { padding: 14px; }
  .prize-form { grid-template-columns: 70px minmax(0, 1fr); }
  .prize-form .min { grid-column: 2; }
}
@media (max-width: 380px) {
  .stamp { width: 46px; height: 46px; }
  .stamp-on img { width: 34px; }
  .prize-grid { gap: 6px; }
}
