/* =========================================================
   McDonald's Internal Offer — playful redesign
   Palette: McD Red #DA291C · Golden #FFC72C · Cream #FFF8E9
   ========================================================= */
:root {
  --red: #da291c;
  --red-dark: #b21e13;
  --gold: #ffc72c;
  --gold-deep: #ffb300;
  --cream: #fff8e9;
  --ink: #26140c;
  --muted: #7a6a60;
  --white: #ffffff;
  --ok: #2e9e5b;
  --warn: #f08c00;
  --err: #da291c;
  --radius: 22px;
  --shadow-soft: 0 18px 40px -22px rgba(191, 30, 20, 0.45);
  --shadow-pop: 0 26px 70px -20px rgba(191, 30, 20, 0.55);
  --font: "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
  --display: "Baloo 2", var(--font);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(120% 120% at 50% 0%, #fff5d6 0%, var(--cream) 42%, #fff2e0 100%);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--red);
  font-weight: 800;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ---------- floating background ---------- */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.float-emoji {
  position: absolute;
  font-size: clamp(28px, 5vw, 54px);
  opacity: 0.55;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.12));
  animation: floaty 9s ease-in-out infinite;
}
.e1 { top: 14%; left: 7%; animation-delay: 0s; }
.e2 { top: 24%; right: 9%; animation-delay: 1.4s; }
.e3 { top: 62%; left: 5%; animation-delay: 0.8s; }
.e4 { top: 72%; right: 8%; animation-delay: 2.1s; font-size: 30px; }
.e5 { top: 44%; right: 16%; animation-delay: 3s; font-size: 26px; }

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.5;
}
.b1 {
  width: 340px; height: 340px;
  background: var(--gold);
  top: -80px; left: -70px;
  animation: floaty 12s ease-in-out infinite;
}
.b2 {
  width: 300px; height: 300px;
  background: #ffd9a8;
  bottom: -90px; right: -60px;
  animation: floaty 14s ease-in-out infinite reverse;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-22px) rotate(6deg); }
}

/* ---------- shell ---------- */
.shell {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 22px clamp(16px, 4vw, 32px) 60px;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 4px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand img {
  border-radius: 12px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand:hover img { transform: rotate(-10deg) scale(1.08); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--display); font-size: 1.12rem; }
.brand-text small { color: var(--muted); font-weight: 700; font-size: 0.72rem; }

.chip-pill {
  background: var(--white);
  border: 2px solid #ffe08a;
  color: var(--red-dark);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding: 34px 0 22px;
  animation: rise 0.7s ease both;
}
.eyebrow {
  display: inline-block;
  background: var(--ink);
  color: var(--gold);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 7px 16px;
  border-radius: 999px;
  margin: 0 0 16px;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 6vw, 3.2rem);
  line-height: 1.12;
  margin: 0 auto 16px;
  max-width: 18ch;
  letter-spacing: -0.3px;
  text-wrap: balance;
}
.hl {
  color: var(--red);
  position: relative;
  white-space: nowrap;
}
.hl::after {
  content: "";
  position: absolute;
  left: -2%;
  bottom: 4px;
  width: 104%;
  height: 32%;
  background: var(--gold);
  z-index: -1;
  border-radius: 6px;
  transform: rotate(-1.5deg);
}
.hl2 { color: var(--gold-deep); }
.hero-sub {
  max-width: 46ch;
  margin: 0 auto;
  color: #5f5048;
  font-weight: 500;
  font-size: 1.02rem;
  line-height: 1.55;
  text-wrap: balance;
}

/* ---------- lookup card ---------- */
.lookup-wrap {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  animation: rise 0.8s 0.05s ease both;
}
.lookup-card {
  position: relative;
  width: min(520px, 100%);
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 26px clamp(20px, 4vw, 30px);
  box-shadow: 12px 12px 0 var(--gold), var(--shadow-pop);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.lookup-card:focus-within {
  transform: translateY(-3px);
  box-shadow: 12px 16px 0 var(--gold), var(--shadow-pop);
}
.card-shine {
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  transform: skewX(-18deg);
  animation: shine 5.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shine {
  0%, 62% { left: -60%; }
  85%, 100% { left: 130%; }
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-weight: 800;
  font-size: 0.86rem;
  margin-bottom: 7px;
  color: var(--ink);
}
.field input {
  width: 100%;
  font-family: var(--font);
  font-size: 1.02rem;
  font-weight: 700;
  padding: 14px 16px;
  border: 2.5px solid #eadfce;
  border-radius: 14px;
  background: #fffdf7;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.field input::placeholder { color: #b7ab9f; font-weight: 600; }
.field input:focus {
  outline: none;
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 4px rgba(255, 199, 44, 0.35);
}
.field input.shake {
  border-color: var(--err);
  animation: shake 0.4s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
}

.cta {
  position: relative;
  width: 100%;
  border: none;
  cursor: pointer;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  padding: 16px;
  border-radius: 16px;
  margin-top: 6px;
  background: linear-gradient(180deg, #ff3a2c, var(--red));
  box-shadow: 0 8px 0 var(--red-dark), 0 14px 22px -8px rgba(191, 30, 20, 0.7);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  overflow: hidden;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 10px 0 var(--red-dark), 0 18px 26px -8px rgba(191, 30, 20, 0.7); }
.cta:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--red-dark); }
.cta.loading { pointer-events: none; }
.cta.loading .cta-label { opacity: 0; }
.cta-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 24px; height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--white);
  border-radius: 50%;
  opacity: 0;
}
.cta.loading .cta-spinner { opacity: 1; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-hint {
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  margin: 12px 0 0;
}

/* ---------- rules ---------- */
.rules { margin-top: 54px; text-align: center; }
.rules h2 {
  font-family: var(--display);
  font-size: clamp(1.3rem, 3.6vw, 1.8rem);
  margin: 0 0 22px;
}
.rule-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.rule-card {
  background: var(--white);
  border: 2.5px solid #f0e4cf;
  border-radius: 20px;
  padding: 24px 18px;
  text-align: left;
  box-shadow: var(--shadow-soft);
  animation: rise 0.6s ease both;
  animation-delay: calc(0.12s * var(--i));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rule-card:hover { transform: translateY(-6px) rotate(-1deg); }
.rule-card.highlight {
  border-color: var(--gold-deep);
  background: linear-gradient(180deg, #fffdf3, #fff4cf);
}
.rule-emoji {
  font-size: 2.2rem;
  margin-bottom: 8px;
  display: inline-block;
  animation: pop 0.5s ease both;
  animation-delay: calc(0.12s * var(--i) + 0.2s);
}
.rule-card h3 { font-family: var(--display); margin: 0 0 6px; font-size: 1.12rem; }
.rule-card p { margin: 0; color: #6a5a50; font-weight: 600; font-size: 0.92rem; line-height: 1.5; }

/* ---------- tags ---------- */
.tags { margin-top: 34px; }
.tag-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.tag {
  font-weight: 800;
  font-size: 0.82rem;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--white);
  box-shadow: var(--shadow-soft);
}
.t-rst { background: #6b3fa0; }
.t-crew { background: var(--red); }
.t-mgr { background: #1b7a43; }

/* ---------- footer ---------- */
.foot {
  margin-top: 48px;
  text-align: center;
  color: #6a5a50;
  font-weight: 700;
}
.foot p { margin: 6px 0; }
.foot-sub { color: var(--muted); font-size: 0.82rem; }

/* ---------- result modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(38, 20, 12, 0.55);
  backdrop-filter: blur(6px);
  animation: fade 0.25s ease;
}
.modal-backdrop.hidden { display: none; }

.result-modal {
  position: relative;
  width: min(440px, 100%);
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 26px;
  padding: 34px 28px 28px;
  text-align: center;
  box-shadow: var(--shadow-pop);
  animation: bounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.result-modal[data-status="ok"] { border-color: var(--ok); }
.result-modal[data-status="not_registered"] { border-color: var(--warn); }
.result-modal[data-status="wrong_email"],
.result-modal[data-status="not_found"] { border-color: var(--err); }

.modal-x {
  position: absolute;
  top: 14px; right: 16px;
  width: 34px; height: 34px;
  border: none;
  background: #f4ece0;
  color: var(--ink);
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}
.modal-x:hover { background: var(--gold); transform: rotate(90deg); }

.rm-emoji {
  font-size: 3.4rem;
  line-height: 1;
  margin-bottom: 8px;
  display: inline-block;
  transform-origin: center bottom;
}
.rm-emoji.fx-pop {
  animation: pop 0.6s 0.1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.rm-emoji.fx-stamp {
  animation: stampIn 0.55s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
.rm-emoji.fx-sad {
  animation: sadWobble 1.3s ease both;
}
.rm-kicker {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 800;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 4px;
}
.result-modal[data-status="ok"] .rm-kicker { color: var(--ok); }
.result-modal[data-status="not_registered"] .rm-kicker { color: var(--warn); }
.result-modal[data-status="wrong_email"] .rm-kicker,
.result-modal[data-status="not_found"] .rm-kicker { color: var(--err); }

#rm-title {
  font-family: var(--display);
  font-size: 1.5rem;
  margin: 0 0 12px;
  text-wrap: balance;
}
.rm-body {
  color: #5a4a40;
  font-weight: 500;
  font-size: 0.98rem;
  line-height: 1.55;
}
.rm-body p { margin: 0 0 8px; }
.rm-body p:last-of-type { margin-bottom: 0; }
.rm-body strong { color: var(--ink); font-weight: 700; }
.mask-hint {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  margin: 4px 0 0 !important;
}
.rm-body .masked {
  display: inline-block;
  background: var(--cream);
  border: 2px dashed var(--gold-deep);
  border-radius: 10px;
  padding: 4px 12px;
  font-family: "Be Vietnam Pro", monospace;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--red-dark);
  margin: 6px 0;
}
.rm-body .pill-list {
  display: inline-block;
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
  margin: 0 2px;
}
.rm-note {
  margin-top: 14px;
  background: #fbf5ea;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.88rem;
  color: #6a5a50;
  line-height: 1.55;
}

.rm-actions { margin-top: 22px; }
.rm-primary {
  border: none;
  cursor: pointer;
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--white);
  padding: 13px 30px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ff3a2c, var(--red));
  box-shadow: 0 6px 0 var(--red-dark);
  transition: transform 0.12s, box-shadow 0.12s;
}
.rm-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--red-dark); }
.rm-primary:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--red-dark); }

/* confetti */
.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: 26px;
}
.confetti i {
  position: absolute;
  top: -12px;
  width: 9px; height: 14px;
  border-radius: 2px;
  animation: drop 1.4s ease-in forwards;
}

/* ---------- keyframes ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bounceIn {
  0% { transform: scale(0.7) translateY(30px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes drop {
  to { transform: translateY(360px) rotate(540deg); opacity: 0; }
}
/* "khắc" / stamp slam for not-registered */
@keyframes stampIn {
  0% { transform: scale(2.6) rotate(-16deg); opacity: 0; filter: blur(3px); }
  55% { transform: scale(0.84) rotate(5deg); opacity: 1; filter: blur(0); }
  72% { transform: scale(1.12) rotate(-3deg); }
  100% { transform: scale(1) rotate(0); }
}
/* sad droop + gentle head-shake for wrong / not-found */
@keyframes sadWobble {
  0% { transform: translateY(-10px) scale(0.6); opacity: 0; }
  35% { transform: translateY(3px) scale(1) rotate(0); opacity: 1; }
  50% { transform: translateY(3px) rotate(-9deg); }
  65% { transform: translateY(3px) rotate(7deg); }
  80% { transform: translateY(2px) rotate(-4deg); }
  100% { transform: translateY(0) rotate(0); }
}

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .rule-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .rule-card.highlight { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .shell { padding: 16px 16px 48px; }
  .chip-pill { display: none; }
  .hero { padding: 24px 0 18px; }
  .rule-grid { grid-template-columns: 1fr; }
  .rule-card.highlight { grid-column: auto; }
  .lookup-card {
    border-width: 2.5px;
    box-shadow: 7px 7px 0 var(--gold), var(--shadow-pop);
  }
  .rules { margin-top: 40px; }
  .rules h2 { margin-bottom: 16px; }
  .float-emoji { opacity: 0.4; }
  .e5 { display: none; }
}

@media (max-width: 480px) {
  .brand-text small { display: none; }
  .hero .eyebrow { font-size: 0.74rem; padding: 6px 12px; }
  .hero-sub { font-size: 0.95rem; }
  .lookup-card { padding: 22px 18px; }
  .field input { font-size: 1rem; padding: 13px 14px; }
  .cta { font-size: 1.05rem; padding: 15px; }
  .tag { font-size: 0.76rem; padding: 8px 13px; }
  .foot { margin-top: 36px; }

  /* modal fits small screens + stays scrollable */
  .modal-backdrop { padding: 14px; align-items: start; }
  .result-modal {
    padding: 28px 20px 24px;
    border-radius: 22px;
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
  }
  .rm-emoji { font-size: 3rem; }
  #rm-title { font-size: 1.3rem; }
  .rm-body { font-size: 0.94rem; }
  .rm-primary { width: 100%; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .card-shine, .float-emoji, .blob { display: none; }
}
