/* ============================================================================
   Gloria Jean's Rewards -- app shell styles
   ----------------------------------------------------------------------------
   Loaded alongside site.css, which already provides .btn, .form, .field,
   .note, .eyebrow and .lede -- this file only adds what's specific to the
   card/staff/admin app screens: the shell chrome, tabs, stamp dots and the
   install panel.
   ========================================================================= */

.rewards-body {
  background: var(--gj-surface);
  min-height: 100vh;
}

.rewards-shell {
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
  padding: clamp(1.5rem, 6vw, 3rem) var(--gj-gut) 4rem;
}

.rewards-loading {
  text-align: center;
  color: var(--gj-ink-muted);
  padding-block: 3rem;
}

/* --- Auth (login / signup / staff PIN / admin key) ----------------------- */
.rewards-auth h1 { margin-bottom: .35rem; }

.rewards-tabs {
  display: flex;
  gap: .5rem;
  margin: 1.25rem 0 1.5rem;
  border-bottom: 1px solid var(--gj-rule);
}
.rewards-tab {
  padding: .7rem 0;
  margin-right: 1.5rem;
  font-family: var(--gj-font-sub);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .82rem;
  color: var(--gj-ink-muted);
  border-bottom: 2px solid transparent;
}
.rewards-tab.is-active { color: var(--gj-black); border-bottom-color: var(--gj-orange); }

.rewards-error {
  color: #b3261e;
  font-size: .88rem;
  margin: .25rem 0 0;
}
.rewards-status { font-size: .88rem; color: var(--gj-ink-muted); margin: 0; }

/* --- Card view (customer + staff result panel share this) ---------------- */
.rewards-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.rewards-topbar h1 { margin: 0; }

.rewards-store-card {
  background: var(--gj-white);
  border: 1px solid var(--gj-rule);
  border-radius: var(--gj-radius);
  padding: 1.25rem 1.5rem 1.5rem;
  margin-bottom: 1rem;
}
.rewards-store-card h3 { margin-bottom: .75rem; }
.rewards-store-card.is-ready {
  border-color: var(--gj-orange);
  box-shadow: 0 0 0 1px var(--gj-orange);
}

/* .btn has no disabled style of its own -- without this, a disabled Redeem
   button on the staff console looks exactly as clickable as an enabled one,
   which is the kind of thing a barista only discovers by tapping it mid-queue. */
.rewards-store-card .btn[disabled] {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}

.rewards-dots {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}
.rewards-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--gj-rule);
  background: transparent;
}
.rewards-dot.is-filled {
  background: var(--gj-orange);
  border-color: var(--gj-orange);
}

.rewards-staff-result { margin-top: 1.5rem; }

/* --- Add to home screen panel ----------------------------------------------- */
/* An orange panel, not a dismissable strip: this is the most useful thing a new
   member can do, so it should be impossible to miss. Orange field + black ink
   follows the brand's flood-colour pattern; the button is the dark pill. */
.rewards-install {
  background: var(--gj-orange);
  color: var(--gj-black);
  border-radius: var(--gj-radius);
  padding: 1.25rem 1.5rem 1.4rem;
  margin: 1.5rem 0 1.25rem;
  scroll-margin-top: calc(var(--gj-header-h, 0px) + 1rem);
}
.rewards-install h2 {
  font-size: 1.25rem;
  margin: 0 0 .35rem;
}
.rewards-install p { margin: 0 0 .9rem; font-size: .95rem; }

.rewards-install-steps {
  margin: 0 0 .9rem;
  padding-left: 1.4rem;
  display: grid;
  gap: .6rem;
  font-size: .95rem;
}
.rewards-install-steps li::marker { font-family: var(--gj-font-head); font-weight: 900; }
.rewards-install-steps[hidden] { display: none; }
.rewards-install-steps { margin-top: .9rem; }

.rewards-share-icon {
  display: inline-flex;
  vertical-align: -4px;
  padding: 0 .1rem;
}

.rewards-install-note { font-size: .85rem; margin-bottom: .75rem; }
.rewards-install-warn {
  background: rgba(255, 255, 255, .55);
  border-radius: 10px;
  padding: .75rem .9rem;
}

.rewards-install-later {
  display: block;
  margin-top: .6rem;
  font-size: .82rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  color: var(--gj-black);
  min-height: 44px;
}

/* Arriving from the rewards page with ?add=1 */
.rewards-install.is-highlighted { animation: rewards-install-pulse 1.4s ease-out 1; }
@keyframes rewards-install-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(26, 21, 22, .45); }
  100% { box-shadow: 0 0 0 18px rgba(26, 21, 22, 0); }
}

/* --- Admin ------------------------------------------------------------------ */
.rewards-admin-list { display: grid; gap: 1.25rem; margin-top: 1.5rem; }
.rewards-admin-row {
  background: var(--gj-white);
  border: 1px solid var(--gj-rule);
  border-radius: var(--gj-radius);
  padding: 1.25rem 1.5rem;
  max-width: none;
}
.rewards-admin-row h3 { margin-bottom: .75rem; }

@media (prefers-reduced-motion: reduce) {
  .rewards-install.is-highlighted { animation: none; }
}

/* --- Embedded card (rewards.html) ------------------------------------------ */
/* Same card app as /rewards/card/, mounted in a normal page. The page already
   supplies the background and gutters, so this only constrains the width. */
.rewards-embed {
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
}

.rewards-hint {
  font-size: .85rem;
  color: var(--gj-ink-muted);
  margin: .75rem 0 0;
}
.rewards-hint a { color: var(--gj-coffee-brown); text-underline-offset: 2px; }

/* A store that has closed: kept visible so the stamps aren't "lost", but
   visibly not a live card. */
.rewards-store-card.is-paused {
  background: var(--gj-surface);
  border-style: dashed;
}
.rewards-store-card.is-paused .rewards-dot.is-filled {
  background: var(--gj-bone);
  border-color: var(--gj-bone);
}

/* --- Admin sections ---------------------------------------------------------- */
.rewards-admin-section { margin-top: 2.5rem; }
.rewards-admin-section > h2 { font-size: 1.1rem; margin-bottom: .25rem; }
.rewards-ok { color: #1b6e3c; font-size: .88rem; margin: .25rem 0 0; }
