/* ==========================================================================
   Café Sellos · estilos
   ========================================================================== */

.cafs-app, .cafs-box {
  --cafs-espresso: #2a1a12;
  --cafs-brown: #6f4e37;
  --cafs-brown-dark: #4e3626;
  --cafs-latte: #f3e8da;
  --cafs-cream: #fbf6ef;
  --cafs-line: #eadfce;
  --cafs-caramel: #c8872e;
  --cafs-gold: #e3ab3d;
  --cafs-ink: #2b2118;
  --cafs-brown-light: #7d5a41;
  --cafs-hero-1: #3f2819;
  --cafs-hero-2: #231410;
  --cafs-gold-light: #f6d27a;
  --cafs-err: #b3261e;
  --cafs-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  max-width: 540px;
  margin: 0 auto;
  font-family: inherit;
  color: var(--cafs-ink);
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
.cafs-app *, .cafs-box * { box-sizing: border-box; }

/* ---------- contenedores ---------- */
.cafs-box, .cafs-panel-wrap {
  background: var(--cafs-cream);
  border: 1px solid var(--cafs-line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 24px 48px -28px rgba(42, 26, 18, .35), 0 2px 6px rgba(42, 26, 18, .05);
}
.cafs-app h3, .cafs-box h3 {
  font-family: var(--cafs-serif);
  font-weight: 700;
  font-size: 1.55em;
  line-height: 1.15;
  letter-spacing: -.01em;
  margin: 0 0 14px;
  color: var(--cafs-espresso);
}
.cafs-eyebrow {
  margin: 0 0 4px;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cafs-caramel);
}

/* ---------- formularios ---------- */
.cafs-app label { display: block; font-size: .82em; font-weight: 700; margin: 14px 0 5px; letter-spacing: .01em; }
.cafs-app input[type=text], .cafs-app input[type=tel], .cafs-app input[type=email],
.cafs-app input[type=password], .cafs-app input[type=search], .cafs-app input[type=number] {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.05em;
  border: 1.5px solid #dccdb6;
  border-radius: 14px;
  background: #fff;
  color: var(--cafs-ink);
  box-shadow: inset 0 1px 2px rgba(42, 26, 18, .04);
  transition: border-color .15s, box-shadow .15s;
}
.cafs-app input:focus {
  outline: none;
  border-color: var(--cafs-caramel);
  box-shadow: 0 0 0 4px rgba(200, 135, 46, .2);
}
.cafs-row { display: flex; gap: 8px; align-items: stretch; }
.cafs-row > input { flex: 1; min-width: 0; }

/* ---------- botones ---------- */
.cafs-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  padding: 13px 18px;
  font-size: 1em;
  font-weight: 700;
  line-height: 1.2;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(180deg, var(--cafs-brown-light), var(--cafs-brown-dark));
  box-shadow: 0 6px 14px -6px rgba(78, 54, 38, .65), inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.cafs-btn:hover { filter: brightness(1.07); }
.cafs-btn:active { transform: translateY(1px) scale(.99); box-shadow: 0 2px 6px -3px rgba(78, 54, 38, .6); }
.cafs-btn:focus-visible { outline: 3px solid rgba(200, 135, 46, .55); outline-offset: 2px; }
.cafs-btn:disabled { opacity: .55; cursor: wait; }
.cafs-btn.alt { background: var(--cafs-latte); color: var(--cafs-brown-dark); box-shadow: inset 0 0 0 1px var(--cafs-line); }
.cafs-btn.alt:hover { background: #ecdcc7; filter: none; }
.cafs-btn.gold { background: linear-gradient(180deg, var(--cafs-gold), var(--cafs-caramel)); color: #2a1a12; box-shadow: 0 8px 18px -8px rgba(200, 135, 46, .9), inset 0 1px 0 rgba(255, 255, 255, .45); }
.cafs-btn.danger { background: #fff; color: var(--cafs-err); box-shadow: inset 0 0 0 1px #e6bdb9; }
.cafs-btn.big { padding: 17px 18px; font-size: 1.12em; width: 100%; border-radius: 16px; }
.cafs-actions { display: grid; gap: 10px; margin-top: 16px; }
.cafs-actions.two { grid-template-columns: 1fr 1fr; }
.cafs-row .cafs-btn.alt { white-space: nowrap; }

/* ---------- solapas ---------- */
.cafs-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  background: var(--cafs-latte);
  border-radius: 16px;
}
.cafs-tabs button {
  flex: 1;
  padding: 11px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font: inherit;
  font-weight: 700;
  font-size: .92em;
  color: var(--cafs-brown);
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.cafs-tabs button.on { background: #fff; color: var(--cafs-espresso); box-shadow: 0 2px 8px rgba(42, 26, 18, .14); }

/* ---------- tarjeta de cliente ---------- */
.cafs-card {
  --s-off-border: #d8c6ae;
  --s-off-text: #bda78a;
  --s-on-bg: linear-gradient(145deg, var(--cafs-brown-light), var(--cafs-brown-dark));
  --s-on-fg: #fbf6ef;
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--cafs-line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 14px 30px -22px rgba(42, 26, 18, .5);
}
.cafs-card .name {
  margin: 0;
  font-family: var(--cafs-serif);
  font-size: 1.45em;
  font-weight: 700;
  line-height: 1.15;
}
.cafs-card .meta { font-size: .84em; opacity: .7; margin: 4px 0 16px; }

/* tarjeta "de fidelidad" para el cliente */
.cafs-card.hero {
  --s-off-border: rgba(255, 255, 255, .3);
  --s-off-text: rgba(255, 255, 255, .42);
  --s-on-bg: linear-gradient(145deg, var(--cafs-gold-light), var(--cafs-caramel));
  --s-on-fg: #2a1a12;
  color: #f7ecdc;
  border: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .14), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(255, 255, 255, .06), transparent 40%),
    linear-gradient(160deg, var(--cafs-hero-1), var(--cafs-hero-2));
  box-shadow: 0 26px 44px -24px rgba(42, 26, 18, .9), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.cafs-card.hero .name { color: #fff; font-size: 1.65em; }
.cafs-card.hero .meta { opacity: .75; }
.cafs-card.hero .cafs-btn.alt { background: rgba(255, 255, 255, .12); color: #f7ecdc; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.cafs-card.hero .cafs-hist li { border-color: rgba(255, 255, 255, .12); }
.cafs-card.hero h3 { color: #fff; font-size: 1.1em; }

/* ---------- sellos ---------- */
.cafs-stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.cafs-stamp {
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--s-off-border);
  color: var(--s-off-text);
  font-weight: 700;
  font-size: 1.05em;
}
.cafs-stamp.on {
  border: 0;
  background: var(--s-on-bg);
  color: var(--s-on-fg);
  box-shadow: 0 6px 12px -6px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .35);
  animation: cafs-pop .45s cubic-bezier(.3, 1.5, .5, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.cafs-stamp.on::before {
  content: '';
  width: 58%;
  height: 58%;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 10h13v3.5a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5V10z'/%3E%3Cpath d='M17 11h1.4a2.4 2.4 0 0 1 0 4.8H17' fill='none' stroke='%23000' stroke-width='1.8'/%3E%3Cpath d='M8 3.6c0 1.4 1 1.4 1 2.8M12 3.6c0 1.4 1 1.4 1 2.8' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 10h13v3.5a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5V10z'/%3E%3Cpath d='M17 11h1.4a2.4 2.4 0 0 1 0 4.8H17' fill='none' stroke='%23000' stroke-width='1.8'/%3E%3Cpath d='M8 3.6c0 1.4 1 1.4 1 2.8M12 3.6c0 1.4 1 1.4 1 2.8' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.cafs-stamp.free {
  border: 2px solid var(--cafs-gold);
  color: var(--cafs-gold);
  font-size: .6em;
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
  line-height: 1.1;
}
.cafs-stamp.free.on {
  background: linear-gradient(145deg, var(--cafs-gold-light), var(--cafs-gold));
  color: #2a1a12;
  border: 0;
  animation: cafs-pop .45s cubic-bezier(.3, 1.5, .5, 1) both, cafs-glow 2s ease-in-out .6s infinite;
}
.cafs-stamp.free.on::before { display: none; }

@keyframes cafs-pop {
  0%   { transform: scale(.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes cafs-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(227, 171, 61, .55); }
  50%      { box-shadow: 0 0 0 9px rgba(227, 171, 61, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .cafs-stamp.on, .cafs-stamp.free.on { animation: none; }
}

.cafs-count { text-align: center; margin: 16px 0 0; font-weight: 600; font-size: .95em; opacity: .9; }
.cafs-banner {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cafs-gold-light), var(--cafs-gold));
  color: #2a1a12;
  text-align: center;
  font-weight: 800;
  line-height: 1.3;
  box-shadow: 0 10px 20px -12px rgba(200, 135, 46, .9);
}

/* ---------- PIN ---------- */
.cafs-pin { margin-top: 16px; padding: 16px; border-radius: 16px; background: #fff6df; border: 1px dashed #d9b45a; text-align: center; color: #2a1a12; }
.cafs-pin b { display: block; font-family: var(--cafs-serif); font-size: 2.6em; letter-spacing: .3em; margin: 6px 0 2px; padding-left: .3em; }
.cafs-pin small { display: block; opacity: .75; }

/* ---------- listas ---------- */
.cafs-list { list-style: none; margin: 14px 0 0; padding: 0; }
.cafs-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 12px; margin-bottom: 6px; background: #fff; border: 1px solid var(--cafs-line); border-radius: 14px; cursor: pointer; transition: transform .1s, box-shadow .15s; }
.cafs-list li:hover { box-shadow: 0 8px 18px -12px rgba(42, 26, 18, .5); transform: translateY(-1px); }
.cafs-list li > span:first-child { font-weight: 700; }
.cafs-list li > span:last-child { font-size: .85em; opacity: .75; text-align: right; }
.cafs-list small { display: block; font-weight: 400; opacity: .65; }
.cafs-hist { margin: 12px 0 0; padding: 0; list-style: none; font-size: .88em; }
.cafs-hist li { padding: 8px 0; border-bottom: 1px solid var(--cafs-line); display: flex; justify-content: space-between; gap: 10px; }
.cafs-hist li:last-child { border-bottom: 0; }
.cafs-hist li span:last-child { opacity: .65; text-align: right; }

/* ---------- consentimiento y avisos ---------- */
.cafs-consent { font-size: .8em; background: var(--cafs-latte); padding: 12px; border-radius: 12px; margin-top: 14px; line-height: 1.45; }
.cafs-app label.cafs-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: .9em; margin-top: 12px; }
.cafs-app label.cafs-check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--cafs-brown); flex: none; }
.cafs-note { font-size: .84em; opacity: .7; margin-top: 10px; line-height: 1.4; }

.cafs-install { margin-top: 18px; padding: 14px; border-radius: 16px; background: var(--cafs-latte); text-align: center; font-size: .9em; }
.cafs-install p { margin: 0 0 10px; }
.cafs-install p:last-child { margin: 0; }

/* ---------- QR ---------- */
.cafs-qr { margin-top: 18px; text-align: center; }
.cafs-qr img { display: block; margin: 0 auto 8px; background: #fff; padding: 8px; border-radius: 16px; max-width: 100%; height: auto; box-shadow: 0 10px 20px -12px rgba(0, 0, 0, .7); }
.cafs-qr small { opacity: .75; }

/* ---------- escáner ---------- */
.cafs-scan { position: fixed; inset: 0; z-index: 2147483646; background: #000; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 16px; }
.cafs-scan video { width: 100%; max-width: 480px; max-height: 65vh; object-fit: cover; border-radius: 20px; background: #111; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.cafs-scan p { margin: 0; font-weight: 600; text-align: center; }

/* ---------- avisos flotantes ---------- */
.cafs-toast {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%); z-index: 2147483647;
  background: #000; color: #fff; border: 2px solid #fff; padding: 14px 20px; border-radius: 14px;
  font: 600 1.05rem/1.3 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .4); width: max-content; max-width: 90vw; text-align: center;
}

@media (max-width: 380px) {
  .cafs-box, .cafs-panel-wrap { padding: 16px; border-radius: 20px; }
  .cafs-stamps { gap: 7px; }
  .cafs-actions.two { grid-template-columns: 1fr; }
}

/* ---------- logo ---------- */
.cafs-logo { display: block; width: auto; height: auto; max-height: 64px; max-width: 72%; margin: 0 0 14px; object-fit: contain; }
.cafs-panel-wrap > .cafs-logo { margin-bottom: 16px; }
