/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === Official Apple.com Color Palette === */
:root {
  --apple-black:       #1d1d1f;   /* Primary text — apple.com nav/headlines */
  --apple-white:       #ffffff;   /* Page/card backgrounds */
  --apple-grey-bg:     #f5f5f7;   /* Section backgrounds (alt rows on apple.com) */
  --apple-grey-light:  #fbfbfd;   /* Subtle card fill */
  --apple-grey-mid:    #e8e8ed;   /* Borders, dividers */
  --apple-grey-text:   #6e6e73;   /* Secondary text / captions */
  --apple-blue:        #0071e3;   /* CTA buttons, links — exact apple.com blue */
  --apple-blue-hover:  #0077ed;
  --apple-green:       #34c759;   /* iOS / live indicators */
  --apple-emerald:     #34c759;
  --apple-red:         #ff3b30;

  /* Aliases for existing template selectors */
  --primary:           var(--apple-black);
  --primary-light:     #3a3a3c;
  --primary-foreground: var(--apple-white);
  --background:        var(--apple-grey-bg);
  --foreground:        var(--apple-black);
  --card:              var(--apple-white);
  --card-foreground:   var(--apple-black);
  --muted-foreground:  var(--apple-grey-text);
  --border:            var(--apple-grey-mid);
  --accent:            var(--apple-grey-bg);
  --emerald:           var(--apple-green);
  --green:             var(--apple-green);
  --yellow:            var(--apple-black);
  --silver:            var(--apple-grey-bg);
  --blue-accent:       var(--apple-blue);
  --radius:            0.75rem;
}

body {
  /* Official Apple SF Pro stack */
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "Helvetica Neue", Arial, sans-serif;
  background-color: var(--apple-grey-bg);
  color: var(--apple-black);
  line-height: 1.47059;           /* apple.com body line-height */
  font-size: 17px;                /* apple.com base font size */
  letter-spacing: -0.022em;      /* apple.com letter-spacing */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Main Layout ===== */
.main {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 5rem 0.75rem 2rem;
  background: var(--apple-grey-bg);
}

@media (min-width: 640px) {
  .main { padding: 5rem 1rem; }
}

.container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 28rem;
}

/* ===== Main Card ===== */
.card {
  overflow: hidden;
  border-radius: 1.25rem;
  background-color: var(--apple-white);
  /* apple.com-style subtle card shadow */
  box-shadow:
    0 2px 6px rgba(0,0,0,0.05),
    0 8px 24px rgba(0,0,0,0.07),
    0 0 0 0.5px rgba(0,0,0,0.08);
}

@media (min-width: 640px) {
  .card { border-radius: 1.75rem; }
}

.card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.25rem 1.5rem;
}

@media (min-width: 640px) {
  .card-inner { padding: 2.5rem 2rem; }
}

/* ===== Brand Logo ===== */
.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.apple-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Logo image — the new apple.jpg has white bg, so we crop tight with object-fit */
.apple-logo-img {
  width: 250px;
  height: auto;
  display: block;
  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  .apple-logo-img {
    filter: invert(1);
    mix-blend-mode: normal;
  }
}

/* ===== Sparkle ===== */
.sparkle {
  margin-top: 0.5rem;
  color: rgba(29,29,31,0.18);
}

.sparkle svg { width: 1rem; height: 1rem; }

@media (min-width: 640px) {
  .sparkle { margin-top: 0.625rem; }
  .sparkle svg { width: 1.125rem; height: 1.125rem; }
}

/* ===== Divider ===== */
.divider {
  width: 75%;
  height: 1px;
  background: var(--apple-grey-mid);
  margin: 0.625rem 0;
}

/* ===== Promo Title ===== */
.promo-title {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  text-align: center;
  font-size: 1.0625rem;          /* ~17px — apple.com caption size */
  font-weight: 600;
  color: var(--apple-black);
  letter-spacing: -0.02em;
}

@media (min-width: 640px) {
  .promo-title { font-size: 1.125rem; }
}

/* ===== Reward Card — apple.com dark section style ===== */
.reward-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.125rem;
  /* Matches apple.com's dark section #1d1d1f gradient */
  background: linear-gradient(160deg, #1d1d1f 0%, #2c2c2e 55%, #3a3a3c 100%);
  padding: 1.25rem;
  color: var(--apple-white);
  box-shadow:
    0 4px 16px rgba(0,0,0,0.18),
    0 1px 4px rgba(0,0,0,0.12);
  margin-top: 1rem;
  width: 100%;
}

@media (min-width: 640px) {
  .reward-card { border-radius: 1.25rem; padding: 1.75rem; margin-top: 1.5rem; }
}

/* Subtle shimmer texture overlay — apple product pages do this */
.reward-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.07) 0%, transparent 65%);
  pointer-events: none;
}

.reward-card .label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
}

@media (min-width: 640px) { .reward-card .label { font-size: 0.75rem; } }

.reward-card .amount {
  font-size: 2.75rem;
  font-weight: 700;
  margin-top: 0.125rem;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

@media (min-width: 640px) { .reward-card .amount { font-size: 3.5rem; } }

.reward-card .sub-text {
  font-size: 0.8125rem;
  opacity: 0.6;
  margin-top: 0.5rem;
  letter-spacing: -0.01em;
}

@media (min-width: 640px) { .reward-card .sub-text { font-size: 0.875rem; margin-top: 0.75rem; } }

.reward-card .calendar-icon {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.18;
}

@media (min-width: 640px) { .reward-card .calendar-icon { right: 1.75rem; } }

.reward-card .calendar-icon svg { width: 2.75rem; height: 2.75rem; }
@media (min-width: 640px) { .reward-card .calendar-icon svg { width: 3.25rem; height: 3.25rem; } }

.reward-card .deco-heart { position: absolute; right: 4.5rem; top: 1rem; opacity: 0.12; }
@media (min-width: 640px) { .reward-card .deco-heart { right: 5.5rem; } }
.reward-card .deco-heart svg { width: 1.25rem; height: 1.25rem; }

/* ===== Step Divider ===== */
.heart-divider {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  margin: 1.25rem 0;
}

.heart-divider .line { flex: 1; height: 1px; background: var(--apple-grey-mid); }

/* ===== Steps — apple.com list-with-numbers style ===== */
.steps-card {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid var(--apple-grey-mid);
  background: var(--apple-grey-light);
  padding: 1rem;
}

@media (min-width: 640px) { .steps-card { padding: 1.375rem; } }

.steps-list { display: flex; flex-direction: column; gap: 0.875rem; }
@media (min-width: 640px) { .steps-list { gap: 1.125rem; } }

.step-item { display: flex; align-items: center; gap: 0.875rem; }

.step-number {
  display: flex;
  width: 1.875rem;
  height: 1.875rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--apple-black);
  color: var(--apple-white);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

@media (min-width: 640px) { .step-number { width: 2.125rem; height: 2.125rem; font-size: 0.875rem; } }

.step-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--apple-black);
  letter-spacing: -0.01em;
}

@media (min-width: 640px) { .step-text { font-size: 0.9375rem; } }
.step-text .highlight { color: var(--apple-blue); font-weight: 600; }

/* ===== Trust Badges ===== */
.trust-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.125rem;
  color: var(--apple-grey-text);
}

.trust-badge { display: flex; align-items: center; gap: 0.25rem; }
.trust-badge .bullet { margin-right: 0.25rem; color: var(--apple-grey-mid); }
.trust-badge svg { width: 0.875rem; height: 0.875rem; color: var(--apple-black); }
.trust-badge span { font-size: 0.6875rem; font-weight: 500; }
@media (min-width: 640px) { .trust-badge span { font-size: 0.75rem; } }

/* ===== Viewer Count ===== */
.viewer-count {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  background: var(--apple-grey-bg);
  border: 1px solid var(--apple-grey-mid);
  padding: 0.3125rem 0.875rem;
  margin-top: 0.875rem;
}

.viewer-count svg { width: 0.875rem; height: 0.875rem; color: var(--apple-black); }
.viewer-count .count-text { font-size: 0.75rem; font-weight: 600; color: var(--apple-black); }
.viewer-count .label-text { font-size: 0.75rem; color: var(--apple-grey-text); }
@media (min-width: 640px) {
  .viewer-count .count-text { font-size: 0.8125rem; }
  .viewer-count .label-text { font-size: 0.8125rem; }
}
.green-dot { width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: var(--apple-green); }

/* ===== CTA Button — exact apple.com blue pill button ===== */
.cta-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 980px;                    /* apple.com's pill radius */
  background: var(--apple-blue);           /* #0071e3 */
  color: var(--apple-white);
  padding: 0.875rem 1.75rem;
  font-size: 1.0625rem;                    /* apple.com button size */
  font-weight: 400;                        /* apple.com uses regular weight on buttons */
  letter-spacing: -0.01em;
  cursor: pointer;
  margin-top: 1.25rem;
  box-shadow: none;                        /* apple.com buttons have NO box-shadow */
  transition: background 0.2s ease, transform 0.15s ease;
  font-family: inherit;
  text-transform: none;                    /* apple.com never uppercase on buttons */
}

@media (min-width: 640px) {
  .cta-button { padding: 1rem 2rem; font-size: 1.0625rem; margin-top: 1.5rem; }
}

.cta-button:hover { background: var(--apple-blue-hover); }
.cta-button:active { transform: scale(0.98); }
.cta-button svg { width: 1rem; height: 1rem; }

/* ===== Footer Text ===== */
.footer-text {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--apple-grey-text);
  margin-top: 0.875rem;
  letter-spacing: -0.01em;
}

.footer-text svg { width: 0.75rem; height: 0.75rem; }

.disclaimer {
  font-size: 0.6875rem;
  color: rgba(110,110,115,0.55);
  text-align: center;
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* ===== Trustpilot Badge ===== */
.trustpilot-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 1rem;
  border: 1px solid var(--apple-grey-mid);
  background: var(--apple-white);
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

@media (min-width: 640px) {
  .trustpilot-badge { gap: 0.75rem; padding: 0.875rem 1.5rem; margin-top: 1.25rem; }
}

.trustpilot-label { display: flex; align-items: center; gap: 0.25rem; }
.trustpilot-label svg { width: 1rem; height: 1rem; }
@media (min-width: 640px) { .trustpilot-label svg { width: 1.125rem; height: 1.125rem; } }
.trustpilot-label span { font-size: 0.875rem; font-weight: 600; color: var(--apple-black); letter-spacing: -0.01em; }

.trustpilot-divider { display: none; width: 1px; height: 1.25rem; background: var(--apple-grey-mid); }
@media (min-width: 640px) { .trustpilot-divider { display: block; } }

.trustpilot-stars { display: flex; align-items: center; gap: 0.125rem; }
.trustpilot-stars svg { width: 0.875rem; height: 0.875rem; }
@media (min-width: 640px) { .trustpilot-stars svg { width: 1rem; height: 1rem; } }

.half-star { position: relative; width: 0.875rem; height: 0.875rem; }
@media (min-width: 640px) { .half-star { width: 1rem; height: 1rem; } }
.half-star svg { position: absolute; inset: 0; }
.half-star .clip { position: absolute; inset: 0; overflow: hidden; width: 50%; }

.trustpilot-rating { display: flex; align-items: center; gap: 0.25rem; }
.trustpilot-rating .number { font-size: 1rem; font-weight: 700; color: var(--apple-black); letter-spacing: -0.02em; }
.trustpilot-rating .excellent { font-size: 0.75rem; color: var(--apple-grey-text); }

/* ===== FAQ Section ===== */
.faq-section { margin-top: 1.5rem; width: 100%; }
@media (min-width: 640px) { .faq-section { margin-top: 2rem; } }

.faq-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--apple-black);
  letter-spacing: -0.02em;
}

@media (min-width: 640px) { .faq-title { font-size: 1.25rem; } }
.faq-title svg { width: 1rem; height: 1rem; flex-shrink: 0; }

.faq-card {
  margin-top: 1rem;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--apple-white);
  border: 1px solid var(--apple-grey-mid);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.faq-item { border-bottom: 1px solid rgba(29,29,31,0.08); }
.faq-item:last-child { border-bottom: none; }

.faq-question {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--apple-black);
  transition: background-color 0.15s;
  font-family: inherit;
  letter-spacing: -0.01em;
}

@media (min-width: 640px) { .faq-question { padding: 1rem 1.25rem; font-size: 0.9375rem; } }
.faq-question:hover { background: var(--apple-grey-bg); }
.faq-question .chevron { flex-shrink: 0; width: 1rem; height: 1rem; color: var(--apple-grey-text); transition: transform 0.3s ease; }
.faq-item.open .faq-question .chevron { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-item.open .faq-answer { max-height: 10rem; }
.faq-answer-inner {
  padding: 0 1rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--apple-grey-text);
  line-height: 1.55;
  letter-spacing: -0.01em;
}

@media (min-width: 640px) { .faq-answer-inner { padding: 0 1.25rem 1rem; font-size: 0.9375rem; } }

/* ===== Promo Footer ===== */
.promo-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1rem;
  margin-top: 2rem;
}

.promo-footer .happy {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--apple-black);
  letter-spacing: -0.01em;
}

.promo-footer .happy svg { width: 1rem; height: 1rem; }
.promo-footer .copyright { font-size: 0.75rem; color: var(--apple-grey-text); letter-spacing: -0.01em; }

/* ===== Toast Notification ===== */
.toast {
  position: fixed;
  left: 50%;
  top: 0.75rem;
  z-index: 50;
  width: calc(100% - 1.5rem);
  max-width: 24rem;
  transform: translateX(-50%) translateY(-1.5rem);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}

@media (min-width: 640px) { .toast { top: 1rem; width: auto; } }

.toast.visible { transform: translateX(-50%) translateY(0); opacity: 1; }

.toast-inner {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  border-radius: 9999px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.5rem 1rem 0.5rem 0.5rem;
  box-shadow:
    0 4px 24px rgba(0,0,0,0.10),
    0 0 0 0.5px rgba(0,0,0,0.08);
}

.toast-avatar {
  position: relative;
  display: flex;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--apple-grey-bg);
}

@media (min-width: 640px) { .toast-avatar { width: 2.25rem; height: 2.25rem; } }

.toast-avatar .gift-icon { width: 1rem; height: 1rem; color: var(--apple-black); }
.toast-avatar .check-badge {
  position: absolute;
  top: -0.125rem;
  right: -0.125rem;
  display: flex;
  width: 0.875rem;
  height: 0.875rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--apple-green);
}

.toast-avatar .check-badge svg { width: 0.5rem; height: 0.5rem; color: white; }

.toast-content { display: flex; flex-direction: column; min-width: 0; }
.toast-name { display: flex; align-items: center; gap: 0.25rem; }
.toast-name span { font-size: 0.75rem; font-weight: 600; color: var(--apple-black); white-space: nowrap; letter-spacing: -0.01em; }
.toast-claim { font-size: 0.6875rem; color: var(--apple-blue); white-space: nowrap; letter-spacing: -0.01em; }
.toast-claim strong { font-weight: 600; }
.toast-location { font-size: 0.6875rem; color: var(--apple-grey-text); white-space: nowrap; }

.toast-dot {
  width: 0.4375rem;
  height: 0.4375rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--apple-green);
  margin-left: 0.25rem;
}

/* ===== Floating sparkle particles ===== */
.floating-hearts { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.floating-heart { position: absolute; animation: floatHeart 6s ease-in-out infinite; }

@keyframes floatHeart {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%       { transform: translateY(-10px) rotate(4deg); }
  66%       { transform: translateY(7px) rotate(-3deg); }
}

/* ===== Utility fills ===== */
.fill-primary { fill: var(--apple-black); color: var(--apple-black); }
.fill-emerald  { fill: var(--apple-green); color: var(--apple-green); }
.fill-white    { fill: white; color: white; }
