*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page-bg);
  background-color: #14224a;
}

/* Calendar styles. Each one sets the page, the board frame and four gift wraps. */
body[data-theme="nieve"] {
  --page-bg:
    radial-gradient(circle, rgba(255, 255, 255, .8) 1px, transparent 1.6px) 0 0 / 150px 150px,
    radial-gradient(circle, rgba(255, 255, 255, .45) 1px, transparent 1.6px) 60px 80px / 97px 97px,
    linear-gradient(180deg, #0f1b3d 0%, #1b2f62 100%);
  --ink: #f6f3ea;
  --ink-soft: #f1c96a;
  --accent: #d63a45;
  --accent-dark: #9e1f2c;
  --frame: linear-gradient(180deg, #ffffff, #cddbee);
  --frame-shadow: #8ea5c7;
  --felt: radial-gradient(circle, rgba(255, 255, 255, .14) 1px, transparent 1.6px) 0 0 / 14px 14px, #24407a;
}
body[data-theme="nieve"] .w0 { --wrap: radial-gradient(circle, rgba(255, 255, 255, .9) 18%, transparent 24%) 0 0 / 9px 9px, #3f78c9; --ribbon: #f2f5fa; }
body[data-theme="nieve"] .w1 { --wrap: repeating-linear-gradient(45deg, #fbfaf6 0 5px, #dce8f5 5px 10px); --ribbon: #c4302b; }
body[data-theme="nieve"] .w2 { --wrap: repeating-linear-gradient(-45deg, #c3d2e6 0 5px, #e6edf6 5px 10px); --ribbon: #3f78c9; }
body[data-theme="nieve"] .w3 { --wrap: radial-gradient(circle, rgba(255, 255, 255, .85) 16%, transparent 22%) 0 0 / 9px 9px, #c4302b; --ribbon: #f2f5fa; }

body[data-theme="verano"] {
  --page-bg: linear-gradient(180deg, #ff8a5b 0%, #ffb072 30%, #ffd79a 58%, #8fd8d2 100%);
  --ink: #3b1d12;
  --ink-soft: #9a3a10;
  --accent: #e4572e;
  --accent-dark: #a8361a;
  --frame: repeating-linear-gradient(90deg, #cf9455 0 38px, #bd7f42 38px 40px);
  --frame-shadow: #8a5426;
  --felt: radial-gradient(circle, rgba(176, 120, 60, .18) 1px, transparent 1.6px) 0 0 / 12px 12px, #f6e3c0;
}
body[data-theme="verano"] .w0 { --wrap: radial-gradient(circle, rgba(255, 255, 255, .9) 18%, transparent 24%) 0 0 / 9px 9px, #19b3b0; --ribbon: #ffd166; }
body[data-theme="verano"] .w1 { --wrap: repeating-linear-gradient(90deg, #ff7b5c 0 6px, #ffa384 6px 12px); --ribbon: #fffaf0; }
body[data-theme="verano"] .w2 { --wrap: radial-gradient(circle, #ff9f1c 16%, transparent 22%) 0 0 / 9px 9px, #ffd23f; --ribbon: #19b3b0; }
body[data-theme="verano"] .w3 { --wrap: repeating-linear-gradient(-45deg, #63c483 0 6px, #8ed9a5 6px 12px); --ribbon: #ff7b5c; }

body[data-theme="pinata"] {
  --page-bg:
    radial-gradient(circle, rgba(255, 199, 39, .35) 1.5px, transparent 2px) 0 0 / 90px 90px,
    linear-gradient(180deg, #3d0d3f 0%, #5a1450 100%);
  --ink: #fff3e6;
  --ink-soft: #ffc727;
  --accent: #d81b72;
  --accent-dark: #8e0f4b;
  --frame: repeating-linear-gradient(135deg, #e5197b 0 14px, #ffc727 14px 28px, #10a5a5 28px 42px);

  --frame-shadow: #7a0f45;
  --felt: radial-gradient(circle, rgba(229, 25, 123, .14) 2px, transparent 2.6px) 0 0 / 16px 16px, #fdf0da;
}
body[data-theme="pinata"] .w0 { --wrap: repeating-linear-gradient(180deg, #e5197b 0 4px, #f2589e 4px 6px); --ribbon: #ffc727; }
body[data-theme="pinata"] .w1 { --wrap: repeating-linear-gradient(180deg, #ff8c1a 0 4px, #ffad57 4px 6px); --ribbon: #10a5a5; }
body[data-theme="pinata"] .w2 { --wrap: repeating-linear-gradient(180deg, #10a5a5 0 4px, #45c7c2 4px 6px); --ribbon: #e5197b; }
body[data-theme="pinata"] .w3 { --wrap: repeating-linear-gradient(180deg, #8e3bd1 0 4px, #a965e2 4px 6px); --ribbon: #ffc727; }

/* Papel picado garland, only for the Piñata style */
.picado {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  overflow: hidden;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
  border-top: 2px solid rgba(255, 255, 255, .55);
}
body[data-theme="pinata"] .picado { display: flex; }
body[data-theme="pinata"] .topbar { padding-top: 66px; }
.picado i {
  flex: 0 0 52px;
  height: 56px;
  color: #e5197b;
  background: radial-gradient(circle at 50% 42%, transparent 0 7px, currentColor 8px);
  clip-path: polygon(0 0, 100% 0, 100% 78%, 87% 100%, 75% 78%, 62% 100%, 50% 78%, 37% 100%, 25% 78%, 12% 100%, 0 78%);
}
.picado i:nth-child(5n + 2) { color: #ffc727; }
.picado i:nth-child(5n + 3) { color: #10a5a5; }
.picado i:nth-child(5n + 4) { color: #ff8c1a; }
.picado i:nth-child(5n + 5) { color: #a965e2; }

h1, h2, h3, .brand { font-family: "Young Serif", Georgia, serif; font-weight: 400; }
a { color: inherit; }
button, input, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--ink-soft); outline-offset: 2px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px 0;
}
.brand { font-size: 20px; text-decoration: none; }
.pill-short { display: none; }
.pill {
  border: 1.5px solid currentColor;
  border-radius: 999px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, .12);
  color: inherit;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

/* Main layout: title, board and side card */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  grid-template-areas: "head card" "board card";
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 20px 40px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}
.stage-head { grid-area: head; }
.board { grid-area: board; }
.stage > .card { grid-area: card; }
.eyebrow { margin: 0 0 6px; color: var(--ink-soft); font-weight: 700; font-size: 15px; }
h1 { margin: 0; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.1; }
.progress { margin: 10px 0 0; font-weight: 700; }
.status {
  display: inline-block;

  margin: 12px 0 0;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .16);
  font-weight: 500;
}

/* The calendar board */
.board {
  padding: clamp(8px, 1.6vw, 14px);
  border-radius: 22px;
  background: var(--frame);
  box-shadow: 0 6px 0 var(--frame-shadow), 0 22px 44px rgba(0, 0, 0, .35);
  position: relative;
}
body[data-theme="nieve"] .board::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: -10px;
  height: 22px;
  background: radial-gradient(circle at 50% 100%, #fff 0 12px, transparent 13px) 0 0 / 26px 22px repeat-x;
  pointer-events: none;
}
.board-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(6px, 1.3vw, 14px);
  padding: clamp(10px, 2vw, 20px);
  border-radius: 14px;
  background: var(--felt);
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, .35);
}

/* One gift box per door, drawn with CSS so each style can rewrap it */
.gift {
  --ribbon-shade: color-mix(in srgb, var(--ribbon) 68%, #000);
  position: relative;
  aspect-ratio: 1;
  container-type: inline-size;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform .2s, filter .3s, opacity .3s;
}
.gift:hover { transform: translateY(-3px); }
.gift > span { position: absolute; display: block; transition: transform .5s cubic-bezier(.3, 1.4, .5, 1), opacity .4s; }
.gift .box {
  top: 38%;
  left: 8%;
  right: 8%;
  bottom: 4%;
  border-radius: 6cqi;
  background:
    linear-gradient(90deg, transparent 42%, var(--ribbon) 42% 58%, transparent 58%),
    linear-gradient(180deg, transparent 44%, var(--ribbon) 44% 58%, transparent 58%),
    var(--wrap);
  box-shadow: inset 0 -5cqi 0 rgba(0, 0, 0, .18), 0 4cqi 0 rgba(0, 0, 0, .28);
}
.gift .lid {
  top: 23%;
  left: 3%;
  right: 3%;
  height: 18%;
  border-radius: 5cqi;
  background:
    linear-gradient(90deg, transparent 42%, var(--ribbon) 42% 58%, transparent 58%),
    linear-gradient(rgba(255, 255, 255, .2), rgba(255, 255, 255, 0)),
    var(--wrap);
  box-shadow: 0 2.5cqi 0 rgba(0, 0, 0, .22);
}
.gift .bow {
  top: 4%;
  left: 24%;
  width: 52%;
  height: 22%;
  background:
    radial-gradient(ellipse 9% 20% at 26% 56%, var(--ribbon-shade) 96%, transparent 100%),
    radial-gradient(ellipse 9% 20% at 74% 56%, var(--ribbon-shade) 96%, transparent 100%),
    radial-gradient(ellipse 26% 48% at 26% 52%, var(--ribbon) 96%, transparent 100%),
    radial-gradient(ellipse 26% 48% at 74% 52%, var(--ribbon) 96%, transparent 100%);
  filter: drop-shadow(0 1.5cqi 0 rgba(0, 0, 0, .25));
}
.gift .bow::after {
  content: "";
  position: absolute;
  left: 40%;
  top: 28%;
  width: 20%;
  height: 60%;
  border-radius: 4cqi;
  background: var(--ribbon);
  box-shadow: inset 0 -2cqi 0 var(--ribbon-shade);
}
.gift .tag {
  left: 50%;
  top: 66%;
  transform: translate(-50%, -50%) rotate(-5deg);
  min-width: 34cqi;
  padding: 1cqi 5cqi;

  border-radius: 4cqi;
  background: #fbf3e2;
  color: #8a1c2b;
  font-family: "Young Serif", Georgia, serif;
  font-size: 22cqi;
  line-height: 1.25;
  box-shadow: 0 1.5cqi 0 rgba(0, 0, 0, .28);
}
.gift .badge { top: 0; right: 0; font-size: 18cqi; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }
.gift .sticker {
  left: 50%;
  top: 0;
  font-size: 40cqi;
  line-height: 1;
  transform: translateX(-50%) scale(0);
  opacity: 0;
}

.gift[data-state="taken"] { filter: saturate(.35) brightness(.78); }
.gift[data-state="empty"] { filter: grayscale(.7); opacity: .4; }
.gift[data-state="ready"] { animation: wiggle 1.6s ease-in-out infinite; filter: drop-shadow(0 0 10px rgba(255, 214, 102, .95)); }
.gift[data-state="revealed"] .lid { transform: translate(22cqi, -12cqi) rotate(26deg); }
.gift[data-state="revealed"] .bow { transform: scale(.5); opacity: 0; }
.gift[data-state="revealed"] .sticker { transform: translateX(-50%) scale(1); opacity: 1; }
.board[inert] .gift { cursor: default; }
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-4deg); }
  40% { transform: rotate(4deg); }
  60% { transform: rotate(0); }
}
.gift.flash { animation: flash .9s ease-out 2; }
@keyframes flash {
  50% { transform: scale(1.12); filter: drop-shadow(0 0 14px #fff); }
}

/* Side card */
.card {
  padding: 24px;
  border-radius: 22px;
  background: #fffaf0;
  color: #2b2118;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .12), 0 22px 44px rgba(0, 0, 0, .25);
}
.card h2 { margin: 0 0 8px; font-size: 24px; line-height: 1.2; }
.card h3 { margin: 0 0 6px; font-size: 19px; }
.card p { margin: 0 0 12px; }
.card hr { border: 0; border-top: 1.5px dashed #e3d6bd; margin: 20px 0; }
.lead { font-size: 17px; }
.label { display: block; margin: 14px 0 6px; font-size: 14px; font-weight: 700; color: #5c4a3a; }
.field-hint, .fine { font-size: 13px; color: #7a6652; }
.fine { text-align: center; margin: 10px 0 0 !important; }
.text-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #dccdb2;
  border-radius: 12px;
  background: #fff;
  color: #2b2118;
}
.text-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea.text-input { min-height: 112px; resize: vertical; }
.counter { display: block; text-align: right; font-size: 12px; color: #7a6652; margin-top: 4px; }
.form-error { color: #b3261e; font-weight: 700; font-size: 14px; margin: 10px 0 0 !important; }
.form-error:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px;
  border: 1.5px solid #dccdb2;
  border-radius: 12px;
  background: #fff;
  color: #2b2118;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 0 #e7dbc4;
}

.chip[aria-checked="true"] { border: 2px solid var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.style-hint { margin: 8px 0 0 !important; font-size: 14px; color: #5c4a3a; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { display: flex; width: 100%; margin-top: 16px; }
.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff), var(--accent));
  color: #fff;
  font-size: 17px;
  box-shadow: 0 4px 0 var(--accent-dark);
}
.btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--accent-dark); }
.btn-whatsapp { background: #25d366; color: #0b3d1f; font-size: 17px; box-shadow: 0 4px 0 #179c49; }
.btn-soft { background: #f3e9d6; color: #2b2118; box-shadow: 0 2px 0 #e0d2b6; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.btn-row .btn:only-child, .btn-row .wide { grid-column: 1 / -1; }
.link-button { border: 0; background: none; padding: 0; color: var(--accent-dark); font-weight: 700; text-decoration: underline; cursor: pointer; }
.link-danger { border: 0; background: none; padding: 0; color: #9b2c2c; font-size: 14px; text-decoration: underline; cursor: pointer; }
.code-line { font-size: 14px; text-align: center; margin-top: 12px !important; }
.code-line strong { letter-spacing: .08em; font-size: 16px; }
.inline-form { display: flex; gap: 8px; margin-top: 8px; }
.inline-form .text-input { flex: 1; min-width: 0; }

.private { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: #fbefd5; }
.private summary { font-weight: 700; cursor: pointer; }
.private p { font-size: 14px; margin: 8px 0 !important; }
.private .btn-row { margin-top: 0; }
.private form { margin-top: 14px; padding-top: 12px; border-top: 1.5px dashed #e3d6bd; }

.my-list { list-style: none; padding: 0; margin: 0; }
.my-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #efe4cf; }
.my-list a { font-weight: 700; }

/* Dialog */
dialog {
  width: min(440px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  padding: 26px 24px 22px;
  border: 0;
  border-radius: 22px;
  background: #fffaf0;
  color: #2b2118;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .4);
}
dialog::backdrop { background: rgba(10, 8, 20, .6); backdrop-filter: blur(3px); }
dialog h2 { margin: 0 0 8px; font-size: 24px; line-height: 1.2; padding-right: 24px; }
dialog p { margin: 0 0 12px; }
.close-button {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: #7a6652;
  cursor: pointer;
}

.modal-eyebrow { color: var(--accent-dark); font-weight: 700; font-size: 14px; margin-bottom: 4px !important; }
.sticker-options { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.sticker-option { aspect-ratio: 1; border: 1.5px solid #e3d6bd; border-radius: 12px; background: #fff; font-size: 22px; cursor: pointer; }
.sticker-option[aria-pressed="true"] { border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, #fff); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14px; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.notice { padding: 10px 12px; border-radius: 12px; background: #fbefd5; font-size: 14px; }
.reveal-sticker { font-size: 64px; line-height: 1; text-align: center; margin: 0 0 8px; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { transform: scale(0); } }
.reveal-message { font-size: 20px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.reveal-signature { font-family: "Young Serif", Georgia, serif; font-size: 18px; color: var(--accent-dark); }
.modal-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }
.viral { margin-top: 18px; padding-top: 16px; border-top: 1.5px dashed #e3d6bd; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 18px;
  border-radius: 14px;
  background: #2b2118;
  color: #fffaf0;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  transform: translate(-50%, calc(100% + 40px));
  visibility: hidden;
  transition: transform .3s, visibility .3s;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }

/* Explanations, ideas and FAQ */
.info {
  max-width: 820px;
  margin: 20px auto 0;
  padding: 36px clamp(20px, 5vw, 52px);
  border-radius: 26px 26px 0 0;
  background: #fffaf0;
  color: #2b2118;
}
.info h2 { font-size: clamp(24px, 3vw, 30px); line-height: 1.2; margin: 36px 0 14px; }
.info h2:first-child { margin-top: 0; }
.info ol, .info ul { padding-left: 22px; }
.info li { margin-bottom: 10px; }
.info details { border-bottom: 1px solid #ecdfc6; padding: 12px 0; }
.info summary { font-weight: 700; cursor: pointer; }
.info details p { margin: 8px 0 0; }
.cta-box { margin-top: 40px; padding: 28px; border-radius: 20px; background: #f6ead3; text-align: center; }
.cta-box h2 { margin-top: 0; }
.cta-box .btn { margin-top: 8px; }
footer {
  max-width: 820px;
  margin: 0 auto;
  padding: 20px clamp(20px, 5vw, 52px) 32px;
  background: #f3e6cc;
  color: #5c4a3a;
  font-size: 14px;
}
footer p { margin: 0 0 8px; }

@media (max-width: 860px) {
  .stage { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "board" "card"; }

  .stage.home { grid-template-areas: "head" "card" "board"; }
}
@media (max-width: 560px) {
  .board-grid { grid-template-columns: repeat(4, 1fr); }
  .stage { padding-top: 18px; }
  .card { padding: 20px 18px; }
  .picado i { flex-basis: 40px; }
  .topbar { padding-left: 16px; padding-right: 16px; gap: 8px; }
  .brand { font-size: 15px; white-space: nowrap; }
  .pill-long { display: none; }
  .pill-short { display: inline; }
  .pill { padding: 5px 10px; font-size: 13px; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Door count: 3 and 9 doors sit in a 3-column box, longer calendars keep 6 columns */
.board-grid[data-count="3"], .board-grid[data-count="9"] { grid-template-columns: repeat(3, minmax(0, 150px)); justify-content: center; }
.stage-head .h1 { margin: 0; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.1; }
.message-list { display: grid; gap: 16px; }
.message-list > div + div { padding-top: 16px; border-top: 1.5px dashed #e3d6bd; }
.link-quiet { padding: 0; border: 0; background: none; color: #6b5b4b; font-size: 14px; text-decoration: underline; cursor: pointer; }

/* Plain pages: privacy policy and terms */
.doc { max-width: 820px; margin: 20px auto 0; padding: 36px clamp(20px, 5vw, 52px); border-radius: 26px 26px 0 0; background: #fffaf0; color: #2b2118; }
.doc h1 { margin-bottom: 24px; font-size: clamp(28px, 4vw, 38px); }
.doc h2 { font-size: 22px; margin: 28px 0 10px; }
.doc p, .doc li { max-width: 70ch; }
footer a { font-weight: 700; }
footer nav { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; }

@media (max-width: 560px) {
  .board-grid[data-count="3"], .board-grid[data-count="9"] { grid-template-columns: repeat(3, 1fr); }
}
