:root {
  --brown: #765e3a;
  --cream: #f4f2f3;
  --bg: #f4f0ec;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-family: 'figtree', sans-serif;
  overflow-x: hidden;
}

.slides {
  scroll-snap-type: y mandatory;
  overflow-y: auto;
  height: 100vh;
}

.w-slide {
  scroll-snap-align: start;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.w-canvas-wrap {
  position: relative;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  background: #fff;
  /* width/height are set explicitly in JS (see app.js applySizing) */
}

/* Fixed at native per-section canvas resolution (width/height set inline in JS);
   scaled down as a whole via JS transform so Fabric's own canvas sizing never
   has to deal with responsive math. */
.w-inner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
}

.w-inner canvas {
  position: absolute;
  top: 0;
  left: 0;
}

.w-bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #f4f2f3;
}

.w-lottie-bg, .w-lottie-fg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.w-bg-image { z-index: 0; }
.w-lottie-bg { z-index: 1; }
.w-inner canvas { z-index: 2; }
.w-lottie-fg { z-index: 3; }
.w-overlay { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.w-overlay > * { pointer-events: auto; }

/* Simple text pages (content that has no original Fabric design: intro,
   los mas peques, dress code, musica) styled to match the passport theme:
   same fixed card width as the canvas-based pages, same paper texture,
   same border/shadow treatment, oversized script/serif titles to match. */
.w-simple-card {
  position: relative;
  width: min(100vw, 540px);
  min-height: min(85vh, 750px);
  max-height: 88vh;
  overflow-y: auto;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: var(--cream);
  background-image: url('https://modelladigital.com/soporte/fondos/modelo73/1.jpg');
  background-size: cover;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  border: 10px solid transparent;
  outline: 1px solid var(--brown);
  outline-offset: -10px;
  padding: 40px 34px;
  color: var(--brown);
  text-align: center;
}
.w-simple-card::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(118, 94, 58, 0.5);
  pointer-events: none;
}
.w-simple-title {
  font-family: 'AbrilFatface-Regular', serif;
  font-size: clamp(34px, 9vw, 46px);
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.w-simple-subtitle {
  font-family: 'ChopinScript', cursive;
  font-size: clamp(34px, 9vw, 46px);
  margin-bottom: 22px;
}
.w-simple-subtitle-small {
  font-family: 'AbrilFatface-Regular', serif;
  font-size: 20px;
  margin: 26px 0 12px;
}
.w-simple-hint {
  font-family: 'TypewriterCondensed', monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 13px;
  margin-top: 26px;
  opacity: .75;
}
.w-simple-body {
  font-family: 'AparajitaRegular', serif;
  font-size: 17px;
  line-height: 1.65;
  text-align: left;
}
.w-simple-block {
  font-family: 'AparajitaRegular', serif;
  font-size: 16px;
  line-height: 1.65;
  text-align: left;
  margin-top: 18px;
}
.w-dresscode-cols {
  display: flex;
  gap: 24px;
  margin-top: 18px;
  text-align: left;
  font-family: 'AparajitaRegular', serif;
  font-size: 16px;
}
.w-dresscode-cols > div { flex: 1; }
.w-dresscode-cols ul { margin: 6px 0 0; padding-left: 18px; }
.w-simple-btn {
  margin-top: 26px;
  padding: 13px 26px;
  border: 1px solid var(--brown);
  background: transparent;
  border-radius: 20px;
  color: var(--brown);
  font-family: 'TypewriterCondensed', monospace;
  letter-spacing: 1px;
  font-size: 15px;
  cursor: pointer;
}

/* Countdown */
.w-countdown {
  position: absolute;
  left: 50%;
  top: 74%;
  width: 84%;
  transform: translate(-50%, 0);
  display: flex;
  gap: 3.5%;
}
.w-countdown .box {
  width: 20%;
  aspect-ratio: 1;
  background: var(--cream);
  border: 1px solid var(--brown);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--brown);
}
.w-countdown .box .num {
  font-family: 'AbrilFatface-Regular', serif;
  font-size: clamp(14px, 5vw, 26px);
  line-height: 1;
}
.w-countdown .box .lbl {
  font-size: clamp(7px, 2.2vw, 10px);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Toast */
.w-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: var(--brown);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.w-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* RSVP Modal */
.w-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}
.w-modal-backdrop.open { display: flex; }
.w-modal {
  background: var(--cream);
  border-radius: 12px;
  padding: 28px 24px;
  max-width: 380px;
  width: 100%;
  color: var(--brown);
  position: relative;
}
.w-modal h2 {
  font-family: 'AbrilFatface-Regular', serif;
  font-weight: normal;
  margin: 0 0 4px;
  font-size: 24px;
}
.w-modal p.sub { margin: 0 0 18px; font-size: 13px; opacity: .8; }
.w-modal label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 14px 0 4px;
}
.w-modal input[type=text],
.w-modal input[type=number],
.w-modal textarea,
.w-modal select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--brown);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: var(--brown);
}
.w-modal .row-yesno { display: flex; gap: 10px; margin-top: 6px; }
.w-modal .row-yesno button {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--brown);
  background: #fff;
  border-radius: 6px;
  color: var(--brown);
  cursor: pointer;
  font-family: inherit;
}
.w-modal .row-yesno button.active {
  background: var(--brown);
  color: #fff;
}
.w-modal .companions-field { display: none; }
.w-modal .companions-field.show { display: block; }
.w-modal .submit-btn {
  margin-top: 22px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 6px;
  background: var(--brown);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}
.w-modal .submit-btn:disabled { opacity: .6; cursor: default; }
.w-modal .close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--brown);
  cursor: pointer;
}
.w-modal .success {
  text-align: center;
  padding: 10px 0;
}

.w-loading {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  font-family: 'AbrilFatface-Regular', serif;
  color: var(--brown);
  font-size: 18px;
  transition: opacity .4s;
}
.w-loading.hide { opacity: 0; pointer-events: none; }
