/* #74 gold prepaid card, its one-off cut-scene, and tap feedback.
   Motion uses transform and opacity only so low-end phones stay smooth. */
:root {
  --gold-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gold-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --gold-face: linear-gradient(135deg, #f7e7b0 0%, #e2c072 34%, #f5dfa0 52%, #c99a45 100%);
  --gold-ink: #2e1e0c;
  --gold-edge: #b0853a;
}

/* Gold card: static (no endless shimmer, which drains batteries). Text stays dark brown for contrast. */
.coffee-card.is-gold {
  background: var(--gold-face);
  border: 1px solid var(--gold-edge);
  color: var(--gold-ink);
  box-shadow: 0 10px 24px -12px rgba(120, 80, 20, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.coffee-card.is-gold > .eyebrow { color: var(--gold-ink); font-weight: 700; letter-spacing: 1.6px; }
.coffee-card.is-gold .show-card { border-top-color: rgba(46, 30, 12, 0.45); color: var(--gold-ink); }
.gold-badge {
  position: relative; z-index: 2; margin-top: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  background: rgba(46, 30, 12, 0.88); color: #fbe9b4;
  font: 600 12px/1.4 var(--cc-font-body); letter-spacing: 0.2px;
}
.gold-badge strong { font-weight: 800; }
.gold-dot { width: 7px; height: 7px; border-radius: 50%; background: #f5d77e; box-shadow: 0 0 0 2px rgba(245, 215, 126, 0.3); }
.qr-card.is-gold .gold-badge { margin: 0 auto 12px; }

/* Cut-scene: ~2.3s total, tap anywhere or Skip to end it. */
.gold-scene {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 24px; border: 0; background: rgba(28, 18, 8, 0.94); color: #fff7e2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  overflow: hidden; cursor: pointer;
  animation: gold-fade-in 180ms var(--gold-ease-out) both;
}
.gold-scene::backdrop { background: transparent; }
.gold-scene.leaving { animation: gold-fade-out 200ms var(--gold-ease-out) both; }
.gold-stage { position: relative; width: min(78vw, 320px); aspect-ratio: 1.586; }
.scene-card {
  position: absolute; inset: 0; border-radius: 20px; padding: 18px 20px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  will-change: transform, opacity;
}
.scene-plain { background: var(--cc-card); color: var(--cc-ink); border: 1px solid var(--cc-divider);
  animation: scene-plain-out 520ms var(--gold-ease-in-out) 320ms both; }
.scene-gold { background: var(--gold-face); color: var(--gold-ink); border: 1px solid var(--gold-edge);
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.6);
  animation: scene-gold-in 560ms var(--gold-ease-out) 640ms both; }
.scene-eyebrow { font: 700 11px/1.3 var(--cc-font-body); letter-spacing: 1.6px; }
.scene-name { font: 400 22px/1.1 var(--cc-font-display); text-transform: uppercase; }
.scene-count { font: 400 40px/1 var(--cc-font-display); }
.scene-count small { font: 600 14px/1 var(--cc-font-body); margin-left: 4px; }
.scene-shine {
  position: absolute; top: -20%; bottom: -20%; left: 0; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  transform: translateX(-160%) skewX(-12deg);
  animation: scene-shine 620ms var(--gold-ease-in-out) 1180ms both;
}
.gold-caption { text-align: center; animation: gold-caption-in 320ms var(--gold-ease-out) 1150ms both; }
.gold-caption h2 { margin: 0 0 6px; font: 400 26px/1.1 var(--cc-font-display); color: #fbe3a0; }
.gold-caption p { margin: 0; font: 500 16px/1.4 var(--cc-font-body); }
.gold-skip {
  position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px;
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255, 247, 226, 0.4);
  background: transparent; color: #fff7e2; font: 600 14px var(--cc-font-body); cursor: pointer;
}
.gold-skip:focus-visible { outline: 3px solid #fbe3a0; outline-offset: 2px; }

@keyframes gold-fade-in { from { opacity: 0; } }
@keyframes gold-fade-out { to { opacity: 0; } }
@keyframes scene-plain-out { to { transform: translateX(-125%) rotate(-8deg); opacity: 0; } }
@keyframes scene-gold-in { from { transform: translateX(125%) rotate(8deg) scale(0.94); opacity: 0; } }
@keyframes scene-shine { to { transform: translateX(330%) skewX(-12deg); } }
@keyframes gold-caption-in { from { transform: translateY(8px); opacity: 0; } }

/* Reduced motion: no sliding or sweeping; the gold card and message simply appear. */
.gold-scene.reduced .scene-plain { display: none; }
.gold-scene.reduced .scene-gold,
.gold-scene.reduced .gold-caption,
.gold-scene.reduced .scene-shine { animation: none; }
.gold-scene.reduced .scene-shine { display: none; }
@media (prefers-reduced-motion: reduce) {
  .gold-scene, .gold-scene.leaving { animation-duration: 1ms !important; }
}

/* Pressed state on every tappable control. Counter keeps no scale motion (fast repeated use). */
button, .btn, .round-btn, .provider-button, .show-card, .text-btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
body:not([data-role="staff"]) :is(.btn, .round-btn, .provider-button, .gold-skip, .wallet-other, .show-card) {
  transition: transform 120ms var(--gold-ease-out), opacity 120ms ease;
}
body:not([data-role="staff"]) :is(.btn, .round-btn, .provider-button, .gold-skip, .show-card):active:not(:disabled) {
  transform: scale(0.97);
}
:is(button, .btn, .text-btn):active:not(:disabled) { opacity: 0.82; }
body[data-role="staff"] :is(.btn, .counter-option):active:not(:disabled) { opacity: 0.7; }
@media (prefers-reduced-motion: reduce) {
  body:not([data-role="staff"]) :is(.btn, .round-btn, .provider-button, .gold-skip, .show-card):active:not(:disabled) { transform: none; }
}

/* Loading state: the pressed control keeps its label and gains a spinner. */
.is-loading { cursor: progress !important; }
.is-loading:disabled { opacity: 1; }
.is-loading::after, .inline-spinner {
  content: ""; display: inline-block; flex: none;
  width: 1em; height: 1em; margin-left: 0.55em; vertical-align: -0.15em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: tap-spin 650ms linear infinite;
}
.round-btn.is-loading { color: transparent !important; position: relative; }
.round-btn.is-loading::after { position: absolute; left: 50%; top: 50%; margin: -0.5em 0 0 -0.5em; border-color: var(--cc-ink); border-right-color: transparent; }
.wallet-button.is-loading { position: relative; }
.wallet-button.is-loading img { opacity: 0.55; }
.wallet-button.is-loading::after { position: absolute; right: 14px; top: 50%; margin: -0.5em 0 0; color: var(--cc-ink); }
.inline-spinner { margin: 0 10px 0 0; }
@keyframes tap-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .is-loading::after, .inline-spinner { animation: tap-pulse 1.2s ease-in-out infinite; border-right-color: currentColor; }
}
@keyframes tap-pulse { 50% { opacity: 0.35; } }

/* Wallet: the platform's wallet first, the other one tap away. */
.wallet-button[hidden] { display: none !important; }
.wallet-actions:has(.wallet-button[hidden]) { grid-template-columns: minmax(0, 1fr); }
.wallet-other { grid-column: 1 / -1; justify-self: center; min-height: 44px; font-size: 14px; }

/* Sign-in: a clear "check your email" moment. */
.email-sent {
  display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; padding: 14px 16px;
  border-radius: var(--cc-radius-panel); background: #e4efd9; color: #24401c; border: 1px solid #b9d2a5;
  animation: gold-caption-in 220ms var(--gold-ease-out) both;
}
.email-sent strong { display: block; font-size: 17px; }
.email-sent p { margin: 2px 0 0; font-size: 14px; line-height: 1.45; }
.sent-check { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #3f7a33; color: #fff; font-weight: 800; }
.signin-note.is-error { color: #a3271b; font-weight: 600; }

/* Checkout return: visible progress until the signed payment lands. */
.checkout-confirming { display: flex; align-items: center; margin-bottom: 14px; }

/* Toasts say what happened: success gets a tick, errors stay longer and read as errors. */
#toast[data-kind="success"]::before { content: "✓"; margin-right: 8px; font-weight: 800; color: #b9e3a5; }
#toast[data-kind="error"] { background: #7d2017; color: #fff; }
@media (prefers-reduced-motion: reduce) { .email-sent { animation: none; } }
