/* ── 12-Day Giveaway Calendar — Scandinavian folk winter ────────────
   Deep spruce green with cream folk line work, rust-red door panels
   with stencil numerals, frosted locked doors, candlelit open doors,
   hand-stitched underline, drifting paper-cut snowflakes. */

:root {
  --spruce: #1e3b2f;
  --spruce-deep: #14291f;
  --cream: #f4ead6;
  --cream-soft: rgba(244, 234, 214, 0.75);
  --rust: #b5502f;
  --rust-deep: #8f3320;
  --candle: #f7d98c;
  --ink-on-cream: #3a3227;
  --err: #ffb59e;
  --serif: 'Fraunces', serif;
  --sans: 'Mulish', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.hidden { display: none !important; }

body {
  font-family: var(--sans);
  color: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse at 50% -20%, rgba(244, 234, 214, 0.08), transparent 55%),
    linear-gradient(180deg, var(--spruce), var(--spruce-deep));
  background-attachment: fixed;
  min-height: 100vh;
}

.page { position: relative; display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }

.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 24px; }

main { flex: 1 0 auto; padding-bottom: 70px; }

/* ── Snowflakes ───────────────────────────────────────────────────── */
.flake {
  position: absolute;
  color: var(--cream);
  opacity: 0.28;
  font-size: 1.5rem;
  animation: drift 9s ease-in-out infinite;
  pointer-events: none;
}

.f1 { top: 6%; left: 6%; }
.f2 { top: 12%; right: 8%; font-size: 2rem; animation-delay: 2s; }
.f3 { top: 46%; left: 3%; font-size: 1.1rem; animation-delay: 4s; }
.f4 { top: 70%; right: 4%; animation-delay: 6s; }

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(16px) rotate(24deg); }
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { text-align: center; padding-top: 58px; padding-bottom: 8px; }

.folk-border { color: var(--cream); opacity: 0.8; max-width: 300px; margin: 0 auto 18px; }

.eyebrow {
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--candle);
  margin-bottom: 14px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.3rem, 8.5vw, 3.7rem);
  line-height: 1.08;
  position: relative;
  display: inline-block;
  padding-bottom: 16px;
}

/* hand-stitched underline */
.hero h1::after {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 3px;
  background-image: linear-gradient(90deg, var(--rust) 0 10px, transparent 10px 16px);
  background-size: 16px 3px;
}

.hero .sub { margin: 18px auto 0; max-width: 480px; color: var(--cream-soft); }

.day-status {
  display: inline-block;
  margin-top: 20px;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--spruce-deep);
  background: var(--candle);
  border-radius: 999px;
  padding: 8px 20px;
}

.day-status:empty { display: none; }

/* ── Calendar ─────────────────────────────────────────────────────── */
.calendar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 34px 0 30px;
}

.door {
  position: relative;
  aspect-ratio: 3 / 3.4;
  border: none;
  border-radius: 10px;
  cursor: default;
  perspective: 500px;
  background: transparent;
  padding: 0;
  font-family: inherit;
}

.door-panel {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--rust), var(--rust-deep));
  border: 2px solid rgba(244, 234, 214, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.45s cubic-bezier(0.3, 0.8, 0.3, 1);
  transform-origin: left center;
  backface-visibility: hidden;
  z-index: 2;
}

.door-num {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.9rem;
  color: var(--cream);
}

.door-flake { font-size: 0.85rem; color: rgba(244, 234, 214, 0.6); }

.door-inside {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbf3e0, var(--cream));
  border: 2px solid var(--candle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  text-align: center;
  z-index: 1;
  box-shadow: inset 0 0 18px rgba(247, 217, 140, 0.55);
}

.inside-day {
  font-weight: 800;
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rust);
}

.inside-prize {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1.25;
  color: var(--ink-on-cream);
}

/* states */
.door.is-open .door-panel { transform: rotateY(-112deg); }

.door.is-locked .door-panel {
  background:
    linear-gradient(160deg, rgba(244, 234, 214, 0.16), rgba(244, 234, 214, 0.02)),
    linear-gradient(160deg, #55403a, #40302b);
  border-color: rgba(244, 234, 214, 0.18);
}

.door.is-locked .door-num { opacity: 0.55; }

.door.is-today { cursor: pointer; }

.door.is-today .door-panel {
  border-color: var(--candle);
  box-shadow: 0 0 0 2px rgba(247, 217, 140, 0.35), 0 0 22px rgba(247, 217, 140, 0.35);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(247, 217, 140, 0.35), 0 0 14px rgba(247, 217, 140, 0.25); }
  50% { box-shadow: 0 0 0 2px rgba(247, 217, 140, 0.55), 0 0 28px rgba(247, 217, 140, 0.5); }
}

.door-badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 800;
  font-size: 0.52rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--candle);
  color: var(--spruce-deep);
  border-radius: 999px;
  padding: 3px 10px;
  z-index: 3;
  white-space: nowrap;
}

/* ── Entry card ───────────────────────────────────────────────────── */
.entry-card {
  background: var(--cream);
  color: var(--ink-on-cream);
  border-radius: 14px;
  padding: 34px 30px;
  text-align: center;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
}

.today-label {
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 6px;
}

.entry-card h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--ink-on-cream);
  margin-bottom: 20px;
}

.entry-card p { color: rgba(58, 50, 39, 0.75); }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink-on-cream);
  background: #fff;
  border: 1.5px solid #d9cbb2;
  border-radius: 8px;
  transition: border-color 0.15s ease;
}

input:focus { outline: none; border-color: var(--rust); }
input.error { border-color: #b7332b; }
input::placeholder { color: #a3957c; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream);
  background: linear-gradient(180deg, var(--rust), #8f3320);
  border: none;
  border-radius: 8px;
  padding: 16px 30px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
  box-shadow: 0 5px 0 rgba(88, 30, 15, 0.55);
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--rust); outline-offset: 3px; }

.btn-block { width: 100%; }

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2.5px solid rgba(244, 234, 214, 0.4);
  border-top-color: var(--cream);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.form-error { color: #b7332b; font-weight: 700; margin-top: 12px; }

.fine-print { font-size: 0.78rem; color: rgba(58, 50, 39, 0.6); margin-top: 16px; }

.rules-link {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: var(--rust);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* ── Entered ──────────────────────────────────────────────────────── */
.entered-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--spruce);
  color: var(--candle);
  font-size: 1.3rem;
  margin-bottom: 14px;
}

/* ── Rules modal ──────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 41, 31, 0.85);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  position: relative;
  background: var(--cream);
  color: var(--ink-on-cream);
  border-radius: 12px;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  padding: 34px 30px;
  overflow-y: auto;
}

.modal-card h3 { font-family: var(--serif); font-size: 1.4rem; margin-bottom: 14px; }

.rules-body { white-space: pre-wrap; font-size: 0.88rem; color: rgba(58, 50, 39, 0.85); }

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: var(--ink-on-cream);
  cursor: pointer;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 26px 20px;
  color: var(--cream-soft);
  font-size: 0.8rem;
}

#wbx-powered-by-slot { margin-top: 12px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .calendar { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .field-grid { grid-template-columns: 1fr; }
  .inside-prize { font-size: 0.68rem; }
}
