/* ============================================================
   SNACK SHACK – Stylesheet
   Fonts: Fredoka One (display) + Nunito (body)
   ============================================================ */
:root {
  --orange:       #FF6B35;
  --orange-dark:  #d94f1e;
  --orange-light: #fff1eb;
  --yellow:       #FFD166;
  --green:        #06D6A0;
  --red:          #EF476F;
  --bg:           #FFF8F5;
  --surface:      #FFFFFF;
  --border:       #FFD9C7;
  --text:         #1A1A2E;
  --muted:        #7a7a9a;
  --shadow:       0 4px 24px rgba(255,107,53,.10);
  --shadow-lg:    0 8px 40px rgba(255,107,53,.18);
  --r:            16px;
  --r-sm:         10px;
  --head:         'Fredoka One', cursive;
  --body:         'Nunito', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--body); background: var(--bg); color: var(--text); min-height: 100vh; }
.hidden { display: none !important; }

/* ── AUTH PAGES ── */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1rem;
  background: linear-gradient(135deg, #fff8f5 0%, #ffe0cc 100%);
}
.auth-card {
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem; width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 1rem;
}
.brand { text-align: center; }
.brand-icon { font-size: 3rem; line-height: 1; }
.brand-name { font-family: var(--head); font-size: 2rem; color: var(--orange); margin-top: .25rem; }
.brand-sub  { color: var(--muted); font-size: .95rem; margin-top: .25rem; }

/* ── FORM ── */
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group label { font-weight: 700; font-size: .9rem; }
input[type="text"],
input[type="email"],
input[type="password"] {
  padding: .75rem 1rem; border: 2px solid var(--border); border-radius: var(--r-sm);
  font-family: var(--body); font-size: 1rem; color: var(--text); background: #fff;
  transition: border-color .2s, box-shadow .2s; width: 100%;
}
input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,107,53,.15); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 3rem; }
.toggle-pw {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1.1rem; opacity: .6;
}
.toggle-pw:hover { opacity: 1; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .75rem 1.5rem; border: none; border-radius: var(--r-sm);
  font-family: var(--body); font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
  text-decoration: none; line-height: 1;
}
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--orange); color: #fff; box-shadow: 0 4px 14px rgba(255,107,53,.3); }
.btn-primary:hover { background: var(--orange-dark); }
.btn-ghost    { background: transparent; color: var(--muted); border: 2px solid var(--border); }
.btn-ghost:hover { background: var(--orange-light); color: var(--orange); }
.btn-ghost-sm {
  background: transparent; color: var(--muted); border: 1.5px solid var(--border);
  padding: .4rem .9rem; font-size: .85rem; border-radius: 6px;
}
.btn-ghost-sm:hover { background: var(--orange-light); color: var(--orange); }
.btn-full { width: 100%; }
.btn-danger { background: var(--red); color: #fff; }
.link-btn {
  background: none; border: none; color: var(--orange); cursor: pointer;
  font-family: var(--body); font-size: .9rem; font-weight: 700; text-decoration: underline;
}
.auth-divider {
  text-align: center; position: relative; color: var(--muted); font-size: .85rem;
}
.auth-divider::before, .auth-divider::after {
  content: ""; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--border);
}
.auth-divider::before { left: 0; } .auth-divider::after { right: 0; }

/* ── MESSAGES ── */
.msg-box { padding: .75rem 1rem; border-radius: var(--r-sm); font-size: .9rem; font-weight: 600; text-align: center; }
.msg-box.error   { background: #ffeef2; color: var(--red);   border: 1.5px solid #f9c0ce; }
.msg-box.success { background: #e6faf5; color: #059669;       border: 1.5px solid #a7f3d0; }
.msg-box.info    { background: var(--orange-light); color: var(--orange); border: 1.5px solid var(--border); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(26,26,46,.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem;
}
.modal {
  background: var(--surface); border-radius: var(--r); padding: 2rem;
  width: 100%; max-width: 440px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 1rem;
}
.modal h2 { font-family: var(--head); color: var(--orange); }
.modal-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ── APP HEADER ── */
.app-header {
  background: var(--surface); border-bottom: 2px solid var(--border);
  padding: .85rem 1.5rem; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 12px rgba(255,107,53,.08);
}
.header-brand { display: flex; align-items: center; gap: .5rem; }
.header-icon  { font-size: 1.6rem; }
.header-title { font-family: var(--head); font-size: 1.5rem; color: var(--orange); }
.header-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.admin-badge {
  background: var(--orange); color: #fff; border-radius: 6px;
  padding: 2px 8px; font-size: .75rem; font-family: var(--body); font-weight: 800;
}

/* ── INDEX PAGE (buy pass) ── */
.index-page { background: var(--bg); }
.index-main {
  max-width: 500px; margin: 0 auto; padding: 2rem 1rem 4rem;
  display: flex; flex-direction: column; gap: 1.5rem;
}
.info-card {
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 1.75rem; border: 2px solid var(--border);
}
.info-card h2 { font-family: var(--head); font-size: 1.4rem; color: var(--orange); margin-bottom: .75rem; }
.info-card p  { color: var(--muted); font-size: .95rem; line-height: 1.6; }
.price-display {
  text-align: center; background: var(--orange-light);
  border-radius: var(--r); padding: 1.5rem; border: 2px dashed var(--orange);
}
.price-amount { font-family: var(--head); font-size: 3.5rem; color: var(--orange); line-height: 1; }
.price-label  { color: var(--muted); font-size: .9rem; margin-top: .25rem; font-weight: 700; }

/* ── PASS PAGE ── */
.pass-page { background: linear-gradient(135deg, #fff8f5 0%, #ffe0cc 100%); }
.pass-main {
  max-width: 480px; margin: 0 auto; padding: 2rem 1rem 4rem;
  display: flex; flex-direction: column; gap: 1.5rem; align-items: center;
}
.pass-card {
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem; width: 100%; text-align: center;
  border: 3px solid var(--orange); position: relative; overflow: hidden;
}
.pass-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--orange) 0 20px, var(--yellow) 20px 40px);
}
.pass-label   { font-size: .8rem; font-weight: 800; letter-spacing: .15em; color: var(--muted); text-transform: uppercase; margin-bottom: .5rem; }
.pass-icon    { font-size: 2.5rem; margin-bottom: .5rem; }
.pass-code    {
  font-family: var(--head); font-size: 3.2rem; color: var(--orange);
  letter-spacing: .15em; background: var(--orange-light); border-radius: var(--r-sm);
  padding: .75rem 1.5rem; display: inline-block; margin: .5rem 0;
  border: 2px dashed var(--orange);
}
.pass-name    { font-size: 1.1rem; font-weight: 800; color: var(--text); margin-top: .75rem; }
.pass-time    { font-size: .82rem; color: var(--muted); font-weight: 600; margin-top: .25rem; }
.pass-note    {
  background: #e6faf5; border: 1.5px solid #a7f3d0; border-radius: var(--r-sm);
  padding: 1rem; font-size: .9rem; font-weight: 700; color: #059669; text-align: center;
}
.pass-instructions {
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 1.5rem; width: 100%;
}
.pass-instructions h3 { font-family: var(--head); color: var(--orange); margin-bottom: .75rem; }
.step { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .75rem; }
.step-num {
  background: var(--orange); color: #fff; border-radius: 50%;
  width: 28px; height: 28px; min-width: 28px; display: flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: .85rem;
}
.step p { font-size: .9rem; color: var(--muted); line-height: 1.5; }

/* ── ADMIN PAGE ── */
.admin-page { background: var(--bg); }
.admin-main { max-width: 900px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.admin-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface); border-radius: var(--r-sm); box-shadow: var(--shadow);
  padding: 1rem; text-align: center; border: 1.5px solid var(--border);
}
.stat-num   { font-family: var(--head); font-size: 2rem; color: var(--orange); }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

.passes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem;
}
.pass-block {
  background: var(--surface); border-radius: var(--r-sm); box-shadow: var(--shadow);
  padding: 1.25rem; border: 2px solid var(--border); cursor: pointer;
  transition: transform .15s, box-shadow .15s; text-align: center;
  user-select: none;
}
.pass-block:hover:not(.used) { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pass-block.used {
  opacity: .5; background: #f0f0f0; border-color: #ccc; cursor: default;
}
.pass-block-code {
  font-family: var(--head); font-size: 1.6rem; color: var(--orange);
  letter-spacing: .1em; display: block; margin-bottom: .4rem;
}
.pass-block.used .pass-block-code {
  text-decoration: line-through; color: #999;
}
.pass-block-name { font-size: .9rem; font-weight: 800; color: var(--text); }
.pass-block-time { font-size: .75rem; color: var(--muted); margin-top: .2rem; }
.pass-block.used .pass-block-name,
.pass-block.used .pass-block-time { color: #aaa; }
.used-label {
  font-size: .7rem; font-weight: 800; color: #aaa; text-transform: uppercase;
  letter-spacing: .1em; margin-top: .5rem; display: block;
}

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: .5rem; }
.section-header h2 { font-family: var(--head); font-size: 1.4rem; }
.filter-tabs { display: flex; gap: .5rem; }
.filter-btn {
  background: var(--surface); border: 2px solid var(--border); border-radius: 20px;
  padding: .3rem .9rem; font-family: var(--body); font-weight: 700; font-size: .82rem;
  cursor: pointer; transition: all .15s;
}
.filter-btn.active, .filter-btn:hover { background: var(--orange); color: #fff; border-color: var(--orange); }

.loading-state { text-align: center; padding: 3rem 1rem; color: var(--muted); font-size: 1.1rem; }
.empty-state   { text-align: center; padding: 3rem 1rem; color: var(--muted); }

@media (max-width: 600px) {
  .auth-card { padding: 2rem 1.25rem; }
  .app-header { padding: .75rem 1rem; }
  .header-title { font-size: 1.2rem; }
  .pass-code { font-size: 2.4rem; }
  .passes-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
}

/* ── REDEEMED STATE ── */
.pass-card.redeemed {
  border-color: #ccc;
  background: #f7f7f7;
}
.pass-card.redeemed::before {
  background: repeating-linear-gradient(90deg, #ccc 0 20px, #e0e0e0 20px 40px);
}
.pass-card.redeemed .pass-code {
  color: #aaa;
  background: #efefef;
  border-color: #ccc;
  text-decoration: line-through;
  text-decoration-thickness: 3px;
}
.pass-card.redeemed .pass-name,
.pass-card.redeemed .pass-label,
.pass-card.redeemed .pass-time { color: #bbb; }
.pass-card.redeemed .pass-icon { filter: grayscale(1); opacity: .5; }

.redeemed-banner {
  background: #1A1A2E; color: #fff;
  border-radius: var(--r); padding: 1.75rem 1.5rem;
  text-align: center; width: 100%;
  animation: popIn .4s cubic-bezier(.175,.885,.32,1.275);
}
.redeemed-banner .r-icon  { font-size: 3rem; display: block; margin-bottom: .5rem; }
.redeemed-banner h2       { font-family: var(--head); font-size: 1.6rem; color: var(--yellow); margin-bottom: .4rem; }
.redeemed-banner p        { color: rgba(255,255,255,.7); font-size: .95rem; line-height: 1.5; }
.redeemed-time            { font-size: .8rem; color: rgba(255,255,255,.45); margin-top: .75rem; font-weight: 700; }

@keyframes popIn {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
