* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Nunito', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #da291c;
  color: #292929;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(178,18,10,.25) 0px, rgba(178,18,10,.25) 30px,
      transparent 30px, transparent 60px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(178,18,10,.15) 0px, rgba(178,18,10,.15) 30px,
      transparent 30px, transparent 60px
    ),
    linear-gradient(180deg, #da291c 0%, #a51d16 50%, #da291c 100%);
  pointer-events: none;
  z-index: 0;
}

/* ======================== FOOTER ======================== */

.mcd-footer {
  background: linear-gradient(180deg, #DA291C 0%, #8B1510 100%);
  padding: 12px 16px;
  text-align: center;
}
.mcd-footer-tagline {
  color: #FFC72C;
  font-size: .75rem;
  font-weight: 800;
  font-style: italic;
}
.mcd-footer-text {
  color: rgba(255,255,255,.5);
  font-size: .5rem;
  font-weight: 600;
  margin-top: 2px;
}

/* Golden arch accents on sides */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 200px 300px at 0% 50%, rgba(255,199,34,.10) 0%, transparent 70%),
    radial-gradient(ellipse 200px 300px at 100% 50%, rgba(255,199,34,.10) 0%, transparent 70%),
    radial-gradient(ellipse 300px 100px at 50% 0%, rgba(255,199,34,.08) 0%, transparent 70%),
    radial-gradient(ellipse 300px 100px at 50% 100%, rgba(255,199,34,.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.page-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 6px;
  overflow: hidden;
  border-radius: 16px;
}

/* Hide form page / receipt page toggling */
.page-form, .page-receipt { transition: opacity .3s; }
.page-receipt { display: none; }
.page-receipt.active { display: block; }
.page-form.hidden { display: none; }

/* Banner image */
.banner-wrap {
  overflow: hidden;
}
.banner-img {
  width: 100%;
  display: block;
  animation: bannerBreath 8s ease-in-out infinite;
  will-change: transform;
  transform: translateZ(0);
}
@keyframes bannerBreath {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

/* McDonald's banner */
.mcd-banner {
  background: #ffbc0d;
  padding: 10px 12px 8px;
  text-align: center;
}
.mcd-banner h1 { font-size: 1rem; font-weight: 900; color: #da291c; margin-bottom: 0; }
.mcd-banner p { font-size: .65rem; color: #7a1a12; font-weight: 600; }

/* Main card */
.card {
  position: relative;
  background: #fff;
  border-radius: 0;
  padding: 14px 14px 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}

.card-title {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 900;
  color: #da291c;
  margin-bottom: 4px;
  line-height: 1.3;
}

.subtitle {
  text-align: center;
  font-size: .75rem;
  color: #555;
  margin-bottom: 10px;
  line-height: 1.4;
}
.subtitle b { color: #da291c; }

/* Daily rule warning */
.daily-rule {
  background: #fff3cd;
  border: 2px solid #ffbc0d;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: .68rem;
  color: #7a1a12;
  line-height: 1.4;
  font-weight: 600;
  text-align: center;
}
.daily-rule b { color: #da291c; }

/* How it works */
.how-it-works {
  background: #fff8e1;
  border: 2px dashed #ffbc0d;
  border-radius: 10px;
  padding: 8px 8px;
  margin-bottom: 10px;
}
.how-it-works h2 {
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #da291c;
  margin-bottom: 5px;
  text-align: center;
  font-weight: 800;
}
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.step {
  text-align: center;
  flex: 1;
  font-size: .58rem;
  color: #555;
  font-weight: 600;
}
.step-icon {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #da291c;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2px;
  font-size: .8rem;
  animation: iconPulse 4.5s ease-in-out infinite;
}
.step:nth-child(1) .step-icon { animation-delay: 0s; }
.step:nth-child(3) .step-icon { animation-delay: 1.5s; }
.step:nth-child(5) .step-icon { animation-delay: 3s; }
@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  5% { transform: scale(1.25); }
  10% { transform: scale(1); }
}
.step-arrow { font-size: .75rem; color: #da291c; font-weight: 800; }

/* Voucher tiers table */
.tier-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  font-size: .7rem;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #ffbc0d;
}
.tier-table thead th {
  background: #ffbc0d;
  color: #7a1a12;
  font-weight: 800;
  padding: 5px 4px;
  text-transform: uppercase;
  font-size: .58rem;
  letter-spacing: .5px;
}
.tier-table tbody td {
  padding: 5px 4px;
  text-align: center;
  font-weight: 600;
  border-bottom: 1px solid #f0e6c8;
}
.tier-table tbody tr:last-child td { border-bottom: none; }
.tier-table .tier-amount { color: #da291c; font-weight: 800; }
.tier-table .tier-voucher { color: #27ae60; font-weight: 800; }
.tier-table .tier-daily { color: #555; font-weight: 700; }

/* Platform selector with logos */
label {
  display: block;
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #da291c;
  margin-bottom: 5px;
}
.label-hint {
  color: #888;
  font-weight: 600;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.platform-card {
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  padding: 6px 3px 5px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #fafafa;
  position: relative;
}
.platform-card:hover {
  border-color: #ffbc0d;
  background: #fff8e1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255,188,13,.25);
}
.platform-card.selected {
  border-color: #da291c;
  background: #fef2f1;
  box-shadow: 0 4px 16px rgba(218,41,28,.2);
}
.platform-card.selected::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: .65rem;
  font-weight: 900;
  color: #fff;
  background: #da291c;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.platform-card img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  pointer-events: none;
}

/* Inputs */
input[type="text"], input[type="email"] {
  width: 100%;
  padding: 9px 12px;
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  background: #fafafa;
  color: #292929;
  font-family: 'Nunito', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  margin-bottom: 10px;
  -webkit-appearance: none;
  contain: layout style;
}
input[type="text"]::placeholder, input[type="email"]::placeholder { color: #bbb; font-weight: 400; }
input[type="text"]:focus, input[type="email"]:focus {
  border-color: #ffbc0d;
  box-shadow: 0 0 0 3px rgba(255,188,13,.2);
  background: #fff;
}

/* Email warning — RED */
.email-warning {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  background: #da291c;
  border: 2px solid #b71c1c;
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: -4px;
  margin-bottom: 10px;
  font-size: .7rem;
  color: #fff;
  line-height: 1.4;
  font-weight: 700;
}
.email-warning span:first-child { font-size: 1rem; flex-shrink: 0; }
.email-warning b { color: #ffbc0d; }

/* Submit button */
.btn-submit {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: #ffbc0d;
  color: #b71c1c;
  font-family: 'Nunito', sans-serif;
  font-size: .95rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, transform .15s;
  letter-spacing: .5px;
  box-shadow: 0 3px 12px rgba(218,41,28,.3);
  position: relative;
  overflow: hidden;
  will-change: transform;
  transform: translateZ(0);
}
/* Shine sweep animation */
.btn-submit::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.5) 50%, transparent 70%);
  animation: btnShine 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes btnShine {
  0%, 100% { left: -100%; }
  50% { left: 150%; }
}
.btn-submit:hover {
  background: #b71c1c;
  color: #ffbc0d;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(218,41,28,.45);
}
.btn-submit:hover::after { animation: none; opacity: 0; }
.btn-submit:active { transform: scale(.96); }
.btn-submit:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-submit:disabled::after { animation: none; }

/* ==================== RECEIPT STYLES ==================== */
.receipt-page-inner {
  background: #fff;
  padding: 0;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}

.receipt-container {
  padding: 16px 12px 14px;
  background: #fff;
  position: relative;
}

/* Zigzag top/bottom edges */
.receipt-container::before,
.receipt-container::after {
  content: '';
  display: block;
  height: 12px;
  background: radial-gradient(circle 6px at 6px 0, transparent 6px, #fff 6px);
  background-size: 12px 12px;
  background-position: -6px 0;
  position: absolute;
  left: 0; right: 0;
}
.receipt-container::before { top: -6px; transform: rotate(180deg); }
.receipt-container::after { bottom: -6px; }

.receipt-header {
  text-align: center;
  margin-bottom: 8px;
}
.receipt-logo { font-size: 36px; margin-bottom: 2px; }
.receipt-brand {
  font-size: .95rem;
  font-weight: 900;
  color: #da291c;
  letter-spacing: 1px;
}
.receipt-sub {
  font-size: .58rem;
  color: #999;
  font-weight: 600;
  margin-top: 1px;
}

.receipt-divider {
  border: none;
  border-top: 2px dashed #ddd;
  margin: 8px 0;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2px 0;
  font-size: .7rem;
  font-weight: 600;
  color: #555;
}
.receipt-row .r-label { color: #999; font-weight: 700; text-transform: uppercase; font-size: .58rem; letter-spacing: .5px; }
.receipt-row .r-value { text-align: right; color: #292929; font-weight: 700; max-width: 60%; word-break: break-all; }

.receipt-section-title {
  font-size: .55rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #da291c;
  font-weight: 900;
  margin-bottom: 4px;
  margin-top: 2px;
}

.receipt-tier-box {
  background: #fff8e1;
  border: 1.5px dashed #ffbc0d;
  border-radius: 8px;
  padding: 7px;
  margin: 6px 0;
}
.receipt-tier-row {
  display: flex;
  justify-content: space-between;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 0;
}
.receipt-tier-row .tier-left { color: #555; }
.receipt-tier-row .tier-right { color: #27ae60; font-weight: 800; }

.receipt-important {
  background: #da291c;
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 8px 0;
  font-size: .65rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}
.receipt-important b { color: #ffbc0d; }

.receipt-footer {
  text-align: center;
  margin-top: 6px;
}
.receipt-footer p {
  font-size: .55rem;
  color: #bbb;
  font-weight: 600;
}
.receipt-barcode {
  font-family: 'Courier Prime', monospace;
  font-size: .55rem;
  letter-spacing: 3px;
  color: #ccc;
  margin-top: 8px;
}
.receipt-ticket-id {
  font-family: 'Courier Prime', monospace;
  font-size: .7rem;
  color: #da291c;
  font-weight: 700;
  margin-top: 4px;
}

/* Buttons below receipt */
.receipt-actions {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: row;
  gap: 8px;
}
.btn-download {
  flex: 1;
  padding: 11px;
  border: none;
  border-radius: 12px;
  background: #da291c;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: .95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 16px rgba(218,41,28,.3);
}
.btn-download:hover { background: #b71c1c; transform: translateY(-2px); }
.btn-back {
  flex: 1;
  padding: 10px;
  font-size: .82rem;
  border-radius: 10px;
  background: #ffbc0d;
  color: #292929;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  cursor: pointer;
  transition: all .2s;
}
.btn-back:hover { background: #e8a900; transform: translateY(-2px); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #da291c;
  color: #fff;
  padding: 12px 24px;
  border-radius: 14px;
  font-size: .88rem;
  font-weight: 700;
  z-index: 100;
  opacity: 0;
  transition: transform .3s, opacity .3s;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(218,41,28,.4);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.shake { animation: shake .4s ease; }

/* Floating McD food emojis */
.bg-food {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-food span {
  position: absolute;
  font-size: 32px;
  opacity: 1;
  animation: foodFloat linear infinite;
  animation-fill-mode: backwards;
  pointer-events: auto;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  will-change: transform;
  transform: translateZ(0);
  contain: layout style;
}
@keyframes foodFloat {
  0%   { transform: translateY(-60px) rotate(0deg); }
  100% { transform: translateY(110vh) rotate(360deg); }
}

/* Burst effect */
.food-burst {
  pointer-events: none !important;
  animation: burstPop .5s ease forwards !important;
}
@keyframes burstPop {
  0%   { transform: scale(1) rotate(0deg); opacity: 1; }
  40%  { transform: scale(1.8) rotate(20deg); opacity: .8; }
  100% { transform: scale(0) rotate(-30deg); opacity: 0; }
}

/* Logo appear then fade */
.food-logo {
  position: fixed;
  pointer-events: none;
  z-index: 10;
  animation: logoPulse .7s ease forwards;
}
.food-logo img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
@keyframes logoPulse {
  0%   { transform: scale(0.3); opacity: 0; }
  30%  { transform: scale(1.4); opacity: 1; }
  60%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
