:root {
  --red: #8B1A1A;
  --red-deep: #6B1212;
  --green: #1F4D2B;
  --green-deep: #14331C;
  --cream: #F7F0E1;
  --cream-dark: #E8DCC3;
  --gold: #C9A227;
  --gold-light: #E8D48B;
  --ink: #1A1510;
  --error: #8B1A1A;
  --shadow: 0 18px 50px rgba(10, 16, 12, 0.35);
  font-family: "Fraunces", "Palatino Linotype", Palatino, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 700px at 50% -10%, #2a6a3c 0%, transparent 55%),
    linear-gradient(180deg, var(--green) 0%, var(--green-deep) 100%);
  color: var(--ink);
}

body {
  min-height: 100svh;
  display: flex;
  justify-content: center;
  padding: 28px 18px 40px;
  padding-top: calc(28px + env(safe-area-inset-top));
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}

.snow,
.snow-slow {
  pointer-events: none;
  position: fixed;
  inset: -20% 0 0;
  z-index: 0;
  background-image:
    radial-gradient(2px 2px at 8% 12%, rgba(255,255,255,0.9), transparent 70%),
    radial-gradient(3px 3px at 22% 38%, rgba(255,255,255,0.75), transparent 70%),
    radial-gradient(2px 2px at 36% 18%, rgba(255,255,255,0.85), transparent 70%),
    radial-gradient(1.5px 1.5px at 48% 62%, rgba(255,255,255,0.7), transparent 70%),
    radial-gradient(2.5px 2.5px at 61% 28%, rgba(255,255,255,0.8), transparent 70%),
    radial-gradient(2px 2px at 74% 72%, rgba(255,255,255,0.75), transparent 70%),
    radial-gradient(1.5px 1.5px at 86% 22%, rgba(255,255,255,0.85), transparent 70%),
    radial-gradient(3px 3px at 93% 54%, rgba(255,255,255,0.65), transparent 70%),
    radial-gradient(2px 2px at 14% 78%, rgba(255,255,255,0.8), transparent 70%),
    radial-gradient(1.5px 1.5px at 42% 88%, rgba(255,255,255,0.7), transparent 70%);
  background-size: 160% 120%;
  animation: fall 22s linear infinite;
  opacity: 0.7;
}

.snow-slow {
  background-size: 180% 140%;
  animation-duration: 34s;
  animation-delay: -8s;
  opacity: 0.45;
}

@keyframes fall {
  from { transform: translate3d(0, -8%, 0); }
  to { transform: translate3d(-4%, 28%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .snow, .snow-slow { animation: none; opacity: 0.35; }
  .sleigh, .sparkle, .bauble, .card, .thanks-title { animation: none !important; }
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(390px, 100%);
}

.mast {
  text-align: center;
  color: var(--cream);
  margin-bottom: 22px;
}

.bauble {
  width: 54px;
  height: 68px;
  display: block;
  margin: 0 auto 8px;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.25));
  animation: sway 5s ease-in-out infinite;
  transform-origin: 50% 0;
}

@keyframes sway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

h1 {
  margin: 0 8px 8px;
  font-weight: 700;
  font-size: clamp(1.7rem, 7vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 0 rgba(0,0,0,0.18);
}

.tagline {
  margin: 0;
  color: var(--gold-light);
  font-size: 1.05rem;
  font-weight: 500;
  font-style: italic;
}

.card {
  background:
    linear-gradient(180deg, #fffaf0 0%, var(--cream) 100%);
  border: 1px solid var(--gold-light);
  border-radius: 22px;
  box-shadow: var(--shadow), inset 0 1px 0 #fff;
  padding: 22px 18px 20px;
  animation: rise 0.45s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.lede {
  margin: 0 0 18px;
  font-size: 1.08rem;
  line-height: 1.4;
  color: #3a3328;
  text-align: center;
}

label {
  display: block;
  margin: 0 0 8px;
  font-weight: 600;
  font-size: 1.02rem;
}

.opt {
  font-weight: 500;
  color: #6b6254;
  font-style: italic;
}

input,
textarea {
  width: 100%;
  margin: 0 0 16px;
  border: 1.5px solid #cbbfa5;
  border-radius: 14px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  padding: 14px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  min-height: 168px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 77, 43, 0.22);
}

.btn {
  display: block;
  width: 100%;
  min-height: 54px;
  margin-top: 4px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #9d2222 0%, var(--red) 55%, var(--red-deep) 100%);
  color: var(--cream);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(107, 18, 18, 0.28), inset 0 1px 0 rgba(255,255,255,0.2);
  cursor: pointer;
}

.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.btn[disabled] {
  opacity: 0.7;
  cursor: wait;
}

.error {
  margin: -4px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8e4d8;
  color: var(--red-deep);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.35;
}

.thanks {
  text-align: center;
  padding-top: 28px;
  padding-bottom: 28px;
  overflow: hidden;
}

.scene {
  position: relative;
  height: 96px;
  margin: 0 auto 8px;
}

.sleigh {
  width: 210px;
  height: 92px;
  display: block;
  margin: 8px auto 0;
  animation: glide 1.1s ease both;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.18));
}

@keyframes glide {
  from { opacity: 0; transform: translateX(-36px); }
  to { opacity: 1; transform: none; }
}

.sparkle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--gold-light);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: twinkle 1.4s ease-in-out infinite;
}

.s1 { top: 8px; left: 18%; animation-delay: 0s; }
.s2 { top: 0; right: 22%; width: 14px; height: 14px; animation-delay: 0.3s; }
.s3 { top: 36px; right: 12%; animation-delay: 0.6s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.7) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(20deg); }
}

.thanks-title {
  margin: 4px 0 6px;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--red);
  animation: rise 0.5s ease both;
}

.thanks-sub {
  margin: 0;
  color: #3a3328;
  font-size: 1.05rem;
}
