/* ── Digital Punch Card — coffee-counter kraft loyalty card ─────────
   Espresso backdrop with coffee-ring stains, kraft card with
   letterpress brand, debossed stamp slots that punch through dark,
   rubber-stamp confirmation, scalloped certificate reward. */

:root {
  --espresso: #33241b;
  --espresso-deep: #241811;
  --kraft: #cbb086;
  --kraft-deep: #b89a6d;
  --cream: #f7efe0;
  --hole: #1c120c;
  --stamp-red: #c24a35;
  --script-ink: #6e4f37;
  --ink-soft: rgba(247, 239, 224, 0.65);
  --err: #ff9c82;
  --display: 'Rozha One', serif;
  --sans: 'Karla', sans-serif;
  --script: 'Caveat', cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.hidden { display: none !important; }

body {
  font-family: var(--sans);
  color: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(180deg, var(--espresso), var(--espresso-deep));
  background-attachment: fixed;
  min-height: 100vh;
}

.counter { position: relative; min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* coffee ring stains */
.ring {
  position: fixed;
  border-radius: 50%;
  border: 10px solid rgba(203, 176, 134, 0.07);
  pointer-events: none;
}

.ring-a { width: 220px; height: 220px; top: 8vh; right: -60px; }
.ring-b { width: 150px; height: 150px; bottom: 12vh; left: -40px; border-width: 7px; }

.wrap { width: 100%; max-width: 480px; margin: 0 auto; padding: 0 24px; position: relative; }

main { flex: 1 0 auto; padding-bottom: 50px; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 50px 24px 8px; position: relative; }

.kicker {
  font-family: var(--script);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--kraft);
  margin-bottom: 8px;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.9rem, 7.5vw, 2.9rem);
  line-height: 1.12;
  color: var(--cream);
}

.sub { color: var(--ink-soft); max-width: 380px; margin: 12px auto 0; }

/* ── Punch card ───────────────────────────────────────────────────── */
.card-stage { margin-top: 26px; }

.punch-card {
  background:
    repeating-linear-gradient(3deg, transparent 0 4px, rgba(51, 36, 27, 0.03) 4px 5px),
    linear-gradient(165deg, var(--kraft), var(--kraft-deep));
  border-radius: 18px;
  padding: 26px 26px 20px;
  color: var(--espresso);
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.card-brand {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--espresso);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.card-reward {
  font-family: var(--script);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--script-ink);
  margin-top: 2px;
}

.stamps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  justify-items: center;
  margin: 20px auto 14px;
  max-width: 300px;
}

.slot {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(51, 36, 27, 0.08);
  box-shadow: inset 0 2px 4px rgba(51, 36, 27, 0.35), inset 0 -1px 0 rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  color: rgba(51, 36, 27, 0.4);
}

.slot.punched {
  background: var(--hole);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.35);
  color: transparent;
  animation: punch 0.4s ease both;
}

@keyframes punch {
  0% { transform: scale(1.25); }
  55% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.slot.today::after {
  content: 'today!';
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  font-family: var(--script);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--stamp-red);
  white-space: nowrap;
}

.stamp-count {
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(51, 36, 27, 0.55);
}

/* ── Check-in ─────────────────────────────────────────────────────── */
.checkin { margin-top: 22px; }

.field { margin-bottom: 14px; }

label {
  display: block;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--kraft);
}

input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  color: var(--cream);
  background: rgba(247, 239, 224, 0.07);
  border: 2px solid rgba(203, 176, 134, 0.35);
  border-radius: 12px;
  transition: border-color 0.15s ease;
}

input:focus { outline: none; border-color: var(--kraft); }
input.error { border-color: var(--err); }
input::placeholder { color: rgba(247, 239, 224, 0.3); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream);
  background: linear-gradient(180deg, var(--stamp-red), #a03826);
  border: none;
  border-radius: 12px;
  padding: 16px 32px;
  cursor: pointer;
  transition: transform 0.12s ease;
  box-shadow: 0 5px 0 #77291b;
}

.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--kraft); outline-offset: 3px; }

.btn-block { width: 100%; }

.form-error { color: var(--err); font-weight: 700; text-align: center; margin-top: 12px; }

.punched-msg {
  text-align: center;
  font-family: var(--script);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--kraft);
  margin-top: 16px;
}

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2.5px solid rgba(247, 239, 224, 0.4);
  border-top-color: var(--cream);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Reward certificate ───────────────────────────────────────────── */
.reward { margin-top: 24px; }

.certificate {
  text-align: center;
  background: var(--cream);
  color: var(--espresso);
  border-radius: 14px;
  padding: 34px 28px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  background-image: radial-gradient(circle at 12px -6px, transparent 10px, var(--cream) 10.5px);
  background-size: 24px 100%;
  background-repeat: repeat-x;
}

.cert-tag {
  display: inline-block;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--stamp-red);
  border: 2.5px double var(--stamp-red);
  border-radius: 6px;
  padding: 5px 14px;
  transform: rotate(-3deg);
  margin-bottom: 14px;
}

.certificate h2 { font-family: var(--display); font-weight: 400; font-size: 1.8rem; }

.cert-reward {
  font-family: var(--script);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--script-ink);
  margin-top: 10px;
}

.cert-note { color: #8d7a64; font-size: 0.9rem; margin-top: 12px; font-weight: 600; }

/* ── Fine print & footer ──────────────────────────────────────────── */
.fine-print {
  text-align: center;
  color: rgba(247, 239, 224, 0.45);
  font-size: 0.8rem;
  margin-top: 26px;
}

.foot { text-align: center; padding: 20px; }

#wbx-powered-by-slot { margin-top: 4px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 420px) {
  .stamps { gap: 10px; }
  .slot { width: 48px; height: 48px; }
}
