/* ═══════════════════════════════════════════════
   CON AMOR — Loyalty Styles
   Mismos tokens que app.css / tokens.css
═══════════════════════════════════════════════ */

/* ── Base ─────────────────────────────────── */
body {
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar ───────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(253,252,249,.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--s4);
  gap: var(--s3);
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.navbar-logo img {
  height: 26px;
  width: auto;
}
.navbar-logo-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--forest);
  display: none;
}
.navbar-spacer { flex: 1; }
.navbar-menu-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-full);
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  color: var(--text-2);
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 100ms var(--ease);
}
.navbar-menu-link:hover {
  border-color: var(--forest);
  color: var(--forest);
  background: var(--forest-a08);
}
.navbar-menu-link i { font-size: .76rem; }

/* ── Main ─────────────────────────────────── */
.loyalty-main {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* ── Screens ──────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 220ms var(--ease),
    transform 220ms var(--ease);
}
.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
  position: relative;
}
/* Exit animation */
.screen.exiting {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.screen-inner {
  max-width: 440px;
  margin: 0 auto;
  padding: var(--s6) var(--s4) 80px;
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}

/* ── Brand mark (lookup screen) ───────────── */
.brand-mark {
  text-align: center;
  padding: var(--s4) 0 var(--s2);
}
.brand-mark-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-full);
  background: var(--forest);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto var(--s3);
  box-shadow: 0 8px 24px var(--forest-a24);
}
.brand-mark-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.brand-mark-sub {
  font-size: .82rem;
  color: var(--text-3);
  line-height: 1.6;
}

/* ── Lookup card ──────────────────────────── */
.lookup-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.field-label {
  display: block;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-3);
  margin-bottom: var(--s1);
}

.lookup-input-wrap {
  display: flex;
  gap: var(--s2);
}
.lookup-input-wrap input {
  flex: 1;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .06em;
  outline: none;
  transition: border-color 100ms var(--ease);
}
.lookup-input-wrap input:focus { border-color: var(--forest); }
.lookup-input-wrap input::placeholder { color: var(--text-4); font-weight: 400; letter-spacing: 0; font-size: .9rem; }

.lookup-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--forest);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
  transition: background 100ms var(--ease), box-shadow 100ms var(--ease);
}
.lookup-btn:hover { background: var(--forest-3); box-shadow: 0 4px 14px var(--forest-a24); }
.lookup-btn:disabled { opacity: .4; pointer-events: none; }

.field-hint {
  font-size: .74rem;
  color: var(--text-4);
  line-height: 1.5;
}

/* ── Errors ───────────────────────────────── */
.lookup-error,
.register-error {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--red-a08);
  border: 1px solid rgba(184,50,40,.18);
  color: var(--red);
  font-size: .78rem;
  font-weight: 600;
}
.lookup-error.visible,
.register-error.visible { display: flex; }
.lookup-error i,
.register-error i { flex-shrink: 0; font-size: .82rem; }

/* ── Back button ──────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 8px;
  border-radius: var(--r-full);
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  color: var(--text-3);
  font-size: .77rem;
  font-weight: 700;
  align-self: flex-start;
  transition: all 100ms var(--ease);
}
.back-btn:hover { border-color: var(--border-2); color: var(--text-2); }

/* ── Screen header ────────────────────────── */
.screen-header {
  padding-bottom: var(--s1);
}
.screen-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 3px;
}
.screen-header p {
  font-size: .81rem;
  color: var(--text-3);
}
.screen-header strong {
  color: var(--text-2);
  font-family: monospace;
  font-size: .88rem;
  letter-spacing: .04em;
}

/* ── Form card ────────────────────────────── */
.form-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.form-field { display: flex; flex-direction: column; gap: var(--s1); }

.form-field input {
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 14px;
  color: var(--text);
  font-size: .88rem;
  outline: none;
  transition: border-color 100ms var(--ease);
}
.form-field input:focus { border-color: var(--forest); }
.form-field input::placeholder { color: var(--text-4); }

.optional {
  font-size: .6rem;
  font-weight: 500;
  color: var(--text-4);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}

/* ── Buttons ──────────────────────────────── */
.primary-btn {
  width: 100%;
  padding: 13px;
  background: var(--forest);
  color: var(--cream);
  border-radius: var(--r-full);
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 100ms var(--ease), box-shadow 100ms var(--ease);
}
.primary-btn:hover { background: var(--forest-3); box-shadow: 0 4px 16px var(--forest-a24); }
.primary-btn:disabled { opacity: .45; pointer-events: none; }

/* Spinner inside buttons */
.btn-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: spin 600ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.is-loading .btn-spinner { display: block; }
.is-loading .btn-text    { display: none; }

/* ── Profile screen ───────────────────────── */
.profile-inner {
  padding-top: var(--s5);
}

.profile-greeting {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: var(--forest);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.profile-hello {
  font-size: .73rem;
  color: var(--text-3);
  font-weight: 600;
  margin-bottom: 1px;
}
.profile-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.change-user-btn {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  color: var(--text-4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
  transition: all 100ms var(--ease);
}
.change-user-btn:hover { color: var(--text-3); border-color: var(--border-2); }

/* ── Stars card ───────────────────────────── */
.stars-card {
  background: var(--forest);
  border-radius: var(--r-xl);
  padding: var(--s5) var(--s5) var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  box-shadow: 0 12px 32px var(--forest-a24);
  border: 2px solid transparent;
  transition: border-color 300ms var(--ease), box-shadow 300ms var(--ease);
}

.stars-card.reward-ready {
  border-color: rgba(255,210,110,.55);
  animation: rewardGlow 2.6s ease-in-out infinite;
}

@keyframes rewardGlow {
  0%, 100% { box-shadow: 0 12px 32px var(--forest-a24), 0 0 0 0 rgba(255,210,110,.35); }
  50%      { box-shadow: 0 12px 32px var(--forest-a24), 0 0 0 6px rgba(255,210,110,0); }
}

/* ── Vale de premio (ticket) ──────────────── */
.reward-voucher {
  position: relative;
  display: none;
  align-items: center;
  gap: var(--s3);
  background: linear-gradient(135deg, #fff8e6, #fdecc4);
  border: 1.5px dashed #d9b35c;
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s5);
  box-shadow: 0 10px 28px rgba(217,179,92,.22);
  overflow: hidden;
}
.reward-voucher.show {
  display: flex;
  animation: voucherPop 480ms var(--spring) both;
}
@keyframes voucherPop {
  from { opacity: 0; transform: scale(.92) translateY(8px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
/* Ticket notches */
.reward-voucher::before,
.reward-voucher::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: var(--bg);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
}
.reward-voucher::before { left: -9px; }
.reward-voucher::after  { right: -9px; }

.rv-icon {
  width: 46px; height: 46px;
  border-radius: var(--r-full);
  background: #d9b35c;
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(217,179,92,.4);
  animation: rvIconBounce 1.8s ease-in-out infinite;
}
@keyframes rvIconBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-3px) rotate(-6deg); }
}
.rv-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rv-title {
  font-size: .95rem;
  font-weight: 700;
  color: #8a6418;
  line-height: 1.3;
}
.rv-sub {
  font-size: .76rem;
  color: #a98538;
  font-weight: 500;
  line-height: 1.4;
}

/* ── Confetti ──────────────────────────────── */
.confetti-wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 600;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -10px;
  width: 8px;
  height: 14px;
  opacity: 0;
  animation: confettiFall var(--fall-dur) ease-in forwards;
  animation-delay: var(--fall-delay);
  border-radius: 1px;
}
@keyframes confettiFall {
  0%   { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--drift), 110vh) rotate(var(--spin)); }
}

.stars-card-top {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
}
.stars-count {
  font-size: 3rem;
  font-weight: 700;
  color: var(--cream);
  line-height: 1;
  transition: color 200ms var(--ease);
}
.stars-of {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(240,237,230,.45);
}
.stars-label {
  font-size: .72rem;
  color: rgba(240,237,230,.55);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: -8px;
  display: block;
}

/* Progress dots */
.stars-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.star-dot {
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  border: 2px solid rgba(240,237,230,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  color: rgba(240,237,230,.25);
  transition: all 280ms var(--spring);
}
.star-dot.filled {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--forest);
}
/* Stagger animation */
.star-dot.filled { animation: starPop 300ms var(--spring) both; }
@keyframes starPop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Status text */
.stars-status {
  font-size: .8rem;
  color: rgba(240,237,230,.65);
  font-weight: 500;
  line-height: 1.5;
  padding-top: 4px;
  border-top: 1px solid rgba(240,237,230,.1);
}
.stars-status.ready {
  color: #a8f5c8;
  font-weight: 700;
}

/* ── Claim section ────────────────────────── */
.claim-wrap {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s4) var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.claim-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .77rem;
  color: var(--text-3);
  line-height: 1.5;
}
.claim-note i { color: var(--forest-3); flex-shrink: 0; margin-top: 1px; }

.claim-btn {
  width: 100%;
  padding: 13px;
  background: var(--forest);
  color: var(--cream);
  border-radius: var(--r-full);
  font-size: .86rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 100ms var(--ease), box-shadow 100ms var(--ease);
}
.claim-btn:hover:not(:disabled) {
  background: var(--forest-3);
  box-shadow: 0 4px 16px var(--forest-a24);
}
.claim-btn:disabled { opacity: .35; pointer-events: none; }

.claim-sub {
  font-size: .69rem;
  color: var(--text-4);
  text-align: center;
}

/* ── Last visit ───────────────────────────── */
.last-visit {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .75rem;
  color: var(--text-4);
  font-weight: 500;
  padding: var(--s2) 0;
}
.last-visit i { font-size: .72rem; }

/* ── Toast ────────────────────────────────── */
#toast-wrap {
  position: fixed;
  top: calc(var(--nav-h) + 10px);
  right: var(--s4);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  max-width: 270px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1.5px solid var(--border-2);
  box-shadow: 0 12px 40px rgba(30,58,47,.13);
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  animation: toastIn 200ms var(--spring) forwards;
  transition: opacity 160ms var(--ease), transform 160ms var(--ease);
}
.toast.ok  { border-color: var(--forest-a24); }
.toast.err { border-color: rgba(184,50,40,.25); }
.toast i   { font-size: .82rem; flex-shrink: 0; }
.toast.ok  i { color: var(--forest); }
.toast.err i { color: var(--red); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(10px) scale(.95); }
  to   { opacity: 1; transform: translateX(0)    scale(1); }
}

/* ── Skeleton ─────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -700px 0; }
  100% { background-position:  700px 0; }
}
.skeleton {
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 1400px 100%;
  animation: shimmer 1.6s infinite;
}

/* ── How it works ─────────────────────────── */
.how-it-works {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s4) var(--s5);
}
.hiw-title {
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-3);
  margin-bottom: var(--s3);
}
.hiw-steps {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.hiw-step {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
}
.hiw-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--forest-a08);
  border: 1.5px solid var(--forest-a16);
  color: var(--forest);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  flex-shrink: 0;
}
.hiw-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 5px;
}
.hiw-text strong {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.hiw-text span {
  font-size: .74rem;
  color: var(--text-3);
  line-height: 1.45;
}
