/* Sistema visual de Stamp: cálido y artesanal. Papel kraft, café espresso y amarillo mostaza. */
:root {
  --bg: #f3e9d8;          /* papel kraft */
  --card: #fffaf0;        /* papel claro */
  --ink: #3b2a1e;         /* espresso */
  --muted: #7a6552;
  --brown: #5b3a24;
  --brown-deep: #43291a;
  --accent: #e3a621;      /* mostaza / ámbar */
  --accent-soft: #f6dc8f;
  --btn-bg: #5b3a24;
  --btn-ink: #fff4dc;
  --line: #e0cfb3;
  --dot: #eadcc4;
  --ok: #4d7a3a;
  --err: #a93d2a;
  --shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 8px 22px rgba(91, 58, 36, .12);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c140e; --card: #271c14; --ink: #f2e5cc; --muted: #bda78c; --brown: #d6b787; --brown-deep: #1c140e;
    --accent: #f0bd3a; --accent-soft: #5a4310; --btn-bg: #f0bd3a; --btn-ink: #2a1a0c; --line: #43332a; --dot: #3a2c22;
    --ok: #7fc08a; --err: #ff9a85; --shadow: 0 8px 22px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 16px/1.5 var(--sans); color: var(--ink); background-color: var(--bg);
  background-image: radial-gradient(rgba(91, 58, 36, .07) 1px, transparent 1px); background-size: 14px 14px;
}
a { color: var(--brown); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: .01em; }
h1 { margin: 0; font-size: 1.55rem; line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 18px 0 8px; }
.sub, .meta { color: var(--muted); }
.meta { font-size: .86rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; }
.svg { display: inline-flex; width: 1em; height: 1em; }
.svg svg { width: 100%; height: 100%; }

button, .btn {
  font: inherit; font-weight: 600; border: 0; background: var(--btn-bg); color: var(--btn-ink); border-radius: 12px;
  padding: 11px 16px; cursor: pointer; min-height: 46px; text-decoration: none; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; box-shadow: 0 2px 0 rgba(0, 0, 0, .18); transition: transform .06s;
}
button:active { transform: translateY(1px); box-shadow: none; }
button.ghost { background: transparent; color: var(--brown); border: 1.5px solid var(--brown); box-shadow: none; }
button.accent { background: var(--accent); color: #2b1a0b; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

input[type=text], input[type=email], input[type=tel], input[type=search], input[type=password] {
  font: inherit; padding: 11px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
  color: var(--ink); width: 100%; min-height: 46px;
}
input:focus { border-color: var(--accent); }

.badge { display: inline-flex; align-items: center; gap: 4px; background: var(--accent); color: #2b1a0b; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 700; margin-left: 8px; }
.badge .svg { width: 14px; height: 14px; }

/* Tarjeta de lealtad tipo "troquel": café con borde punteado y sellos amarillos */
.loyalty {
  position: relative; color: #fbeed4; border-radius: 22px; padding: 22px 20px;
  background: linear-gradient(155deg, #6b452a 0%, #4a2e1c 100%);
  box-shadow: 0 10px 26px rgba(67, 41, 26, .35);
}
.loyalty::before { content: ""; position: absolute; inset: 9px; border: 2px dashed rgba(251, 238, 212, .32); border-radius: 15px; pointer-events: none; }
.loyalty h1, .loyalty h2 { color: #fff4dc; }
.loyalty .sub, .loyalty .meta { color: rgba(251, 238, 212, .75); }
.stamps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 4px 8px; position: relative; }
.stamp {
  aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; position: relative;
  border: 2px dashed rgba(251, 238, 212, .38); color: rgba(251, 238, 212, .22);
}
.stamp .svg { width: 60%; height: 60%; }
.stamp.on { border: 2px solid var(--accent); background: rgba(227, 166, 33, .16); color: var(--accent); transform: rotate(var(--tilt, 0deg)); }
.stamp.on .svg { filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25)); }
.stamp.new { animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { 0% { transform: scale(.2) rotate(-25deg); opacity: 0; } 70% { transform: scale(1.18) rotate(var(--tilt, 0deg)); opacity: 1; } 100% { transform: scale(1) rotate(var(--tilt, 0deg)); } }
@media (prefers-reduced-motion: reduce) { .stamp.new { animation: none; } button { transition: none; } }

#toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); background: var(--brown-deep); color: #fff4dc;
  padding: 11px 18px; border-radius: 12px; opacity: 0; transition: opacity .2s; max-width: 90vw; pointer-events: none; z-index: 10;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
}
#toast.show { opacity: 1; }

select, textarea {
  font: inherit; padding: 11px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
  color: var(--ink); width: 100%; min-height: 46px;
}
textarea { resize: vertical; }
select:focus, textarea:focus { border-color: var(--accent); }
input[type=date] { font: inherit; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); width: 100%; min-height: 46px; }

[hidden] { display: none !important; }
