/* =========================================================
   LOYALPLUS — LIGHT THEME STYLESHEET
   ========================================================= */

/* ---------- CSS Variables ---------- */
:root {
  --bg:        #F5F3EE;
  --bg-subtle: #EDE9E1;
  --surface:   #FFFFFF;
  --elevated:  #FAFAF8;
  --gold:      #C8860C;
  --gold-light:#F0B429;
  --gold-pale: #FFF8E7;
  --gold-glow: rgba(200,134,12,0.15);
  --coral:     #D94F4F;
  --coral-pale:#FFF0F0;
  --emerald:   #0D9B6A;
  --emerald-pale:#E6F9F1;
  --purple:    #7C5CFC;
  --purple-pale:#F0EDFF;
  --cyan:      #0891B2;
  --cyan-pale: #E0F7FA;
  --pink:      #DB2777;
  --pink-pale: #FDF2F8;
  --txt:       #1A1A1A;
  --txt-sub:   #444444;
  --muted:     #888888;
  --muted-light:#B0B0B0;
  --border:    #E8E4DC;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.10);
  --shadow-gold:0 4px 20px rgba(200,134,12,0.18);
  --radius:    16px;
  --radius-lg: 24px;
  --nav-h:     70px;
  --safe-b:    env(safe-area-inset-bottom, 0px);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html { height: 100%; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--txt);
  overflow: hidden;
  height: 100dvh;
  width: 100vw;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

/* ---------- Screens ---------- */
.screen {
  position: absolute;
  inset: 0;
  transition: transform .4s cubic-bezier(.4,0,.2,1), opacity .35s ease;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }

.screen.hidden-right  { transform: translateX(100%); opacity: 0; pointer-events: none; }
.screen.hidden-left   { transform: translateX(-100%); opacity: 0; pointer-events: none; }
.screen.active        { transform: translate(0);     opacity: 1; pointer-events: auto; }

/* ---------- Tab content ---------- */
.tab-content {
  padding: 20px 20px 0;
  min-height: 100%;
}

.has-bottom-nav .tab-content {
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
}

/* ---------- Splash Screen ---------- */
#splash-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #FFF8E7 0%, #FFFFFF 40%, #F5F3EE 100%);
}

.splash-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.splash-bg::before {
  content: '';
  position: absolute;
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  top: 10%; left: -15%;
  border-radius: 50%;
}
.splash-bg::after {
  content: '';
  position: absolute;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(217,79,79,0.08) 0%, transparent 70%);
  bottom: 15%; right: -10%;
  border-radius: 50%;
}

.splash-content { text-align: center; position: relative; z-index: 1; }

.splash-icon {
  width: 80px; height: 80px;
  margin: 0 auto 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, #C8860C 0%, #F0B429 50%, #FFD166 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-gold);
  color: #fff;
  font-size: 32px;
}

.splash-title {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.gold-text {
  background: linear-gradient(135deg, #C8860C, #F0B429);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.splash-sub {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.scroll-hint {
  position: absolute;
  bottom: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1;
}
.scroll-hint p { font-size: 11px; color: var(--muted-light); }

.scroll-mouse {
  width: 22px; height: 36px;
  border: 2px solid var(--muted-light);
  border-radius: 11px;
  display: flex; justify-content: center; padding-top: 8px;
}
.scroll-dot {
  width: 4px; height: 8px;
  background: var(--muted-light);
  border-radius: 2px;
  animation: float 1.5s ease infinite;
}

/* ---------- Auth Screen ---------- */
#auth-screen { background: linear-gradient(180deg, #FFF8E7 0%, var(--bg) 40%); }

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.auth-orb--1 {
  width: 280px; height: 280px;
  background: rgba(240,180,41,0.12);
  top: -80px; right: -60px;
}
.auth-orb--2 {
  width: 200px; height: 200px;
  background: rgba(217,79,79,0.06);
  bottom: 10%; left: -40px;
}

.auth-inner {
  position: relative; z-index: 1;
  padding: 48px 24px 32px;
  min-height: 100%;
  display: flex; flex-direction: column;
}

.auth-header { margin-bottom: 28px; }

.auth-logo {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #C8860C, #F0B429);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-gold);
  color: #fff; font-size: 20px;
  margin-bottom: 20px;
}

.auth-header h2 {
  font-size: 1.5rem; font-weight: 800; margin-bottom: 4px;
}
.text-muted-sm { color: var(--muted); font-size: 13px; }

.auth-tabs {
  display: flex; gap: 4px;
  background: var(--bg-subtle);
  border-radius: 14px; padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1; padding: 11px 0;
  border-radius: 11px; border: none;
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .25s ease;
  background: transparent; color: var(--muted);
  font-family: inherit;
}
.auth-tab.active {
  background: var(--surface);
  color: var(--gold);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: flex; flex-direction: column; gap: 16px; flex: 1;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.input-field {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--txt);
  font-size: 15px; width: 100%; outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  font-family: inherit;
}
.input-field:focus {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.input-field::placeholder { color: var(--muted-light); }

.divider {
  display: flex; align-items: center; gap: 12px; margin: 4px 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.divider span { font-size: 12px; color: var(--muted-light); }

.btn-social { display: flex; align-items: center; justify-content: center; gap: 10px; }

/* ---------- Buttons ---------- */
.btn-gold {
  background: linear-gradient(135deg, #C8860C, #F0B429);
  color: #fff; font-weight: 700; border: none;
  border-radius: var(--radius);
  padding: 14px 28px; cursor: pointer;
  transition: all .2s ease; font-size: 15px;
  font-family: inherit;
  box-shadow: var(--shadow-gold);
}
.btn-gold:active { transform: scale(.97); filter: brightness(.92); }
.btn-gold:disabled { opacity: .5; cursor: not-allowed; }

.btn-outline {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--txt);
  border-radius: var(--radius);
  padding: 13px 28px; cursor: pointer;
  transition: all .2s ease; font-size: 15px;
  font-weight: 600; font-family: inherit;
}
.btn-outline:active { transform: scale(.97); border-color: var(--gold); color: var(--gold); }

.w-full { width: 100%; }

/* ---------- Bottom Navigation ---------- */
.bottom-nav {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 8px 0 calc(8px + var(--safe-b));
  z-index: 50;
  height: var(--nav-h);
}

.nav-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  cursor: pointer; padding: 6px 14px;
  border-radius: 12px; transition: all .2s ease;
  color: var(--muted-light); font-size: 10px; font-weight: 700;
  position: relative; border: none; background: none;
  font-family: inherit;
}
.nav-item i { font-size: 19px; transition: color .2s ease; }
.nav-item.active { color: var(--gold); }
.nav-item.active::after {
  content: '';
  position: absolute; top: -8px;
  width: 20px; height: 3px;
  background: var(--gold);
  border-radius: 0 0 4px 4px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.card-hover { transition: transform .15s ease, box-shadow .15s ease; }
.card-hover:active { transform: scale(.98); box-shadow: none; }

/* ---------- Points Card ---------- */
.points-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  background: linear-gradient(145deg, #1A1507 0%, #2A1F08 50%, #1A1507 100%);
  border: 1px solid rgba(240,180,41,0.18);
  box-shadow: var(--shadow-gold);
  position: relative; overflow: hidden;
}
.points-card::before {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(240,180,41,0.12) 0%, transparent 70%);
  border-radius: 50%;
}

/* ---------- Progress Bar ---------- */
.progress-bar {
  height: 8px; background: var(--bg-subtle);
  border-radius: 100px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 100px;
  transition: width .8s cubic-bezier(.4,0,.2,1);
  background: linear-gradient(90deg, #C8860C, #F0B429);
}

/* ---------- Tier Badges ---------- */
.tier-silver  { color: #6B7280; }
.tier-gold    { color: var(--gold); }
.tier-platinum{ color: var(--purple); }
.tier-diamond { color: var(--cyan); }

.bg-tier-silver  { background: linear-gradient(135deg, #9CA3AF, #6B7280); }
.bg-tier-gold    { background: linear-gradient(135deg, #92400E, #F0B429); }
.bg-tier-platinum{ background: linear-gradient(135deg, #5B21B6, #A78BFA); }
.bg-tier-diamond { background: linear-gradient(135deg, #155E75, #22D3EE); }

/* ---------- Voucher Card ---------- */
.voucher-card {
  position: relative; overflow: hidden;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.voucher-card::before {
  content: '';
  position: absolute; left: -18px; top: -18px; bottom: -18px;
  width: 50px;
  background: repeating-linear-gradient(0deg, var(--bg) 0, var(--bg) 7px, transparent 7px, transparent 14px);
  opacity: .6;
}
.voucher-card::after {
  content: '';
  position: absolute; right: -18px; top: -18px; bottom: -18px;
  width: 50px;
  background: repeating-linear-gradient(0deg, var(--bg) 0, var(--bg) 7px, transparent 7px, transparent 14px);
  opacity: .6;
}

/* ---------- Pill ---------- */
.pill {
  padding: 8px 18px; border-radius: 100px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s ease;
  white-space: nowrap;
  border: 1.5px solid var(--border);
  color: var(--muted); background: var(--surface);
  font-family: inherit;
}
.pill.active {
  background: var(--gold); color: #fff;
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}

/* ---------- Quick Action ---------- */
.quick-action {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px; cursor: pointer;
}
.quick-action-icon {
  width: 56px; height: 56px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: all .2s ease;
  position: relative;
}
.quick-action:active .quick-action-icon {
  transform: scale(.93);
  box-shadow: none;
}
.quick-action span {
  font-size: 11px; font-weight: 700; color: var(--muted);
}

/* ---------- Scan Line ---------- */
.scan-line-anim {
  position: absolute; left: 5%; right: 5%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  animation: scan-line 2.5s ease-in-out infinite;
  box-shadow: 0 0 15px var(--gold-light);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }

.modal-content {
  max-width: 480px; width: 100%;
  max-height: 90dvh;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transform: translateY(100%);
  transition: transform .4s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; scrollbar-width: none;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.12);
}
.modal-overlay.show .modal-content { transform: translateY(0); }
.modal-content::-webkit-scrollbar { display: none; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  background: var(--surface);
}
.modal-header h3 { font-size: 16px; font-weight: 800; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--bg);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px;
  transition: background .2s ease;
}
.modal-close:hover { background: var(--bg-subtle); }

.modal-body { padding: 20px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 20px; left: 50%;
  transform: translateX(-50%) translateY(-120px);
  max-width: 420px; width: 90%;
  padding: 14px 20px;
  border-radius: 16px; font-size: 14px; font-weight: 600;
  z-index: 200;
  transition: transform .4s cubic-bezier(.4,0,.2,1);
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast-success { background: var(--emerald); color: #fff; }
.toast-error   { background: var(--coral); color: #fff; }
.toast-info    { background: var(--gold); color: #fff; }

/* ---------- Confetti ---------- */
.confetti-piece {
  position: fixed; width: 10px; height: 10px;
  z-index: 300; pointer-events: none;
  animation: confetti-fall 3s ease-in forwards;
}

/* ---------- Stagger Anim ---------- */
.stagger > * { opacity: 0; animation: fadeUp .4s ease both; }
.stagger > *:nth-child(1) { animation-delay: .04s; }
.stagger > *:nth-child(2) { animation-delay: .08s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .16s; }
.stagger > *:nth-child(5) { animation-delay: .20s; }
.stagger > *:nth-child(6) { animation-delay: .24s; }
.stagger > *:nth-child(7) { animation-delay: .28s; }
.stagger > *:nth-child(8) { animation-delay: .32s; }
.stagger > *:nth-child(9) { animation-delay: .36s; }
.stagger > *:nth-child(10){ animation-delay: .40s; }

/* ---------- Utility ---------- */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.grid   { display: grid; }
.grid-cols-2   { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3   { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4   { grid-template-columns: repeat(4, 1fr); }
.flex-1  { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.text-center { text-align: center; }
.text-sm  { font-size: 14px; }
.text-xs  { font-size: 12px; }
.font-bold   { font-weight: 700; }
.font-black  { font-weight: 900; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-1 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-x-auto { overflow-x: auto; scrollbar-width: none; }
.overflow-x-auto::-webkit-scrollbar { display: none; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.p-3  { padding: 12px; }
.p-4  { padding: 16px; }
.p-5  { padding: 20px; }
.border-b { border-bottom: 1px solid var(--border); }
.cursor-pointer { cursor: pointer; }
.opacity-40 { opacity: .4; }
.opacity-60 { opacity: .6; }
.grayscale { filter: grayscale(1); }

/* ---------- Keyframe Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes scan-line {
  0%  { top: 10%; }
  50% { top: 85%; }
  100%{ top: 10%; }
}
@keyframes confetti-fall {
  0%   { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240,180,41,0.35); }
  50%      { box-shadow: 0 0 0 10px rgba(240,180,41,0); }
}
@keyframes spin-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.anim-fade-up     { animation: fadeUp .5s ease both; }
.anim-fade-in     { animation: fadeIn .4s ease both; }
.anim-delay-1 { animation-delay: .08s; }
.anim-delay-2 { animation-delay: .16s; }
.anim-delay-3 { animation-delay: .24s; }
.anim-delay-4 { animation-delay: .32s; }

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Responsive ---------- */
@media (min-width: 481px) {
  #app {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}