/* ============================================================
   FAIRY PINK PASTEL WATERCOLOR BIRTHDAY INVITATION
   Inspired by satumomen.com/preview/fairy-pink
   Exact tokens: #f9d8d9 blush | #903B3A dusty rose | #faecf1 menu
   Fonts: Princess Sofia | Cormorant Garamond | Varela Round
   ============================================================ */

:root {
  --inv-bg: #f9d8d9;
  --inv-base: #903B3A;
  --inv-accent: #903B3A;
  --inv-border: #903B3A;
  --menu-bg: #faecf1;
  --menu-inactive: #903B3A;
  --menu-active: #903B3A;
  --btn-color: #ffffff;
  --font-latin: 'Princess Sofia', cursive;
  --font-base: 'Cormorant Garamond', Georgia, serif;
  --font-accent: 'Varela Round', sans-serif;
  --menu-height: 76px;
}

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

[hidden] {
  display: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--inv-bg);
  color: var(--inv-base);
  font-family: var(--font-base);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.font-latin { font-family: var(--font-latin); font-weight: 400; }
.font-base { font-family: var(--font-base); }
.font-accent { font-family: var(--font-accent); }
.italic { font-style: italic; }

/* ============================================================
   WORKSPACE & 9:16 MOBILE CANVAS
   ============================================================ */
#workspace-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--inv-bg);
  overflow: hidden;
}

.canvas {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  max-height: 860px;
  background: var(--inv-bg);
  overflow: hidden;
  box-shadow: 0 18px 56px rgba(144, 59, 58, 0.16);
}

@media (min-width: 500px) {
  .canvas {
    height: min(94dvh, 800px);
    width: min(calc(min(94dvh, 800px) * 9 / 16), 440px);
    border-radius: 22px;
  }
}

#fairy-dust-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}

/* ============================================================
   DISCRETE SLIDE SYSTEM
   ============================================================ */
.slides-viewport {
  position: absolute;
  inset: 0;
  bottom: var(--menu-height);
  overflow: hidden;
  transition: bottom 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.canvas.not-open .slides-viewport {
  bottom: 0;
}

.sm-slide {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
  background: var(--inv-bg);
}

.sm-slide.is-active {
  display: block;
}

.slide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}

/* ============================================================
   WATERCOLOR ORNAMENTS (CORNERS, BUTTERFLIES, FAIRIES)
   ============================================================ */
.orn-floral-bl,
.orn-floral-br {
  position: absolute;
  bottom: -14px;
  width: 56%;
  max-width: 245px;
  height: auto;
  z-index: 2;
  pointer-events: none;
  user-select: none;
}

.orn-floral-bl {
  left: -18px;
  transform-origin: bottom left;
}

.orn-floral-br {
  right: -18px;
  transform-origin: center bottom;
}

/* Flanking Top Butterflies */
.orn-butterfly-wrap {
  position: absolute;
  top: 28px;
  width: 78px;
  height: 78px;
  z-index: 4;
  pointer-events: none;
}

.orn-butterfly-wrap.left { left: 14px; }
.orn-butterfly-wrap.right { right: 14px; }

.orn-butterfly {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(144, 59, 58, 0.12));
}

.flutter-left {
  animation: butterflyFlutterLeft 3.4s ease-in-out infinite;
}

.flutter-right {
  animation: butterflyFlutterRight 3.8s ease-in-out infinite;
}

@keyframes butterflyFlutterLeft {
  0%, 100% { transform: scaleX(-1) translate(0, 0) rotate(-6deg) scaleY(1); }
  25% { transform: scaleX(-1) translate(4px, -7px) rotate(4deg) scaleY(0.86); }
  50% { transform: scaleX(-1) translate(2px, -3px) rotate(-3deg) scaleY(1.03); }
  75% { transform: scaleX(-1) translate(-3px, -8px) rotate(5deg) scaleY(0.88); }
}

@keyframes butterflyFlutterRight {
  0%, 100% { transform: translate(0, 0) rotate(6deg) scaleY(1); }
  25% { transform: translate(-4px, -8px) rotate(-4deg) scaleY(0.86); }
  50% { transform: translate(-2px, -3px) rotate(3deg) scaleY(1.03); }
  75% { transform: translate(3px, -7px) rotate(-5deg) scaleY(0.88); }
}

/* Bottom-Center Hero Fairy */
.orn-peri-wrap {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
}

.opening-peri {
  bottom: -24px;
}

.acara-peri {
  bottom: -34px;
}

.orn-peri {
  width: 270px;
  max-width: 72%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(144, 59, 58, 0.16));
}

.acara-peri .orn-peri {
  width: 235px;
  max-width: 64%;
}

.peri-float {
  animation: fairyHover 4.2s ease-in-out infinite;
}

@keyframes fairyHover {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(1.5deg); }
}

/* ============================================================
   SLIDE CONTENT LAYOUTS
   ============================================================ */
.slide-content {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  padding: 46px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Slide 0: Opening / Cover */
.opening-content {
  justify-content: flex-start;
  padding-top: 72px;
}

.opening-title {
  font-size: clamp(36px, 9.8vw, 42px);
  line-height: 1.24;
  color: var(--inv-base);
  margin-bottom: 18px;
}

.opening-pleasure {
  font-size: 16px;
  font-weight: 600;
  color: var(--inv-base);
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.opening-guest {
  font-size: 23px;
  font-weight: 700;
  color: var(--inv-base);
  margin-bottom: 20px;
  max-width: 300px;
  word-break: break-word;
}

.canvas:not(.not-open) .btn-open-inv {
  display: none;
}

/* Pill Button */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 28px;
  border-radius: 999px;
  border: none;
  background: var(--inv-accent);
  color: var(--btn-color);
  font-family: var(--font-accent);
  font-size: 14.5px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(144, 59, 58, 0.28);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-pill:active {
  transform: scale(0.96);
}

.btn-pill.full {
  width: 100%;
  padding: 12px 20px;
}

/* Slide 1: Birthday Profile */
.birthday-content {
  justify-content: center;
  padding-top: 26px;
  padding-bottom: 42px;
}

.portrait-stage {
  position: relative;
  width: 184px;
  height: 184px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portrait-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 4px solid var(--inv-border);
  overflow: hidden;
  background: #faecf1;
  box-shadow: 0 12px 28px rgba(144, 59, 58, 0.18);
  position: relative;
  z-index: 2;
}

.portrait-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-fairy-wrap {
  position: absolute;
  width: 108px;
  height: 108px;
  z-index: 4;
  pointer-events: none;
}

.mini-fairy-wrap.left {
  left: -48px;
  top: -16px;
}

.mini-fairy-wrap.right {
  right: -52px;
  bottom: -6px;
}

.mini-fairy {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(144, 59, 58, 0.15));
}

.mini-float-a {
  animation: miniFloatA 3.6s ease-in-out infinite;
}

.mini-float-b {
  animation: miniFloatB 4s ease-in-out infinite;
}

@keyframes miniFloatA {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-9px) rotate(4deg); }
}

@keyframes miniFloatB {
  0%, 100% { transform: scaleX(-1) translateY(0) rotate(-3deg); }
  50% { transform: scaleX(-1) translateY(-8px) rotate(5deg); }
}

.birthday-kicker {
  font-size: 25px;
  line-height: 1.25;
  color: var(--inv-base);
  margin-bottom: 4px;
}

.birthday-name {
  font-size: clamp(36px, 9.5vw, 42px);
  line-height: 1.38;
  color: var(--inv-base);
  margin: 4px 0 8px;
}

.birthday-age {
  font-size: 25px;
  letter-spacing: 2px;
  color: var(--inv-base);
}

/* Slide 2: Acara / Save The Date */
.acara-content {
  justify-content: flex-start;
  padding-top: 56px;
  padding-left: 30px;
  padding-right: 30px;
}

.acara-title {
  font-size: clamp(42px, 11vw, 50px);
  line-height: 1.25;
  color: var(--inv-base);
  margin-bottom: 24px;
}

.acara-list {
  width: 100%;
  max-width: 310px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.acara-row {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--inv-base);
}

.acara-icon {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 8px rgba(144, 59, 58, 0.12));
}

.acara-text {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--inv-base);
}

.acara-address {
  line-height: 1.25;
}

.map-cue {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-accent);
  font-style: normal;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(144, 59, 58, 0.12);
  color: var(--inv-base);
}

/* Slide 3: RSVP */
.rsvp-slide-content {
  justify-content: flex-start;
  padding-top: 86px;
}

.rsvp-title {
  font-size: clamp(38px, 10vw, 44px);
  line-height: 1.28;
  color: var(--inv-base);
  margin-bottom: 24px;
}

.rsvp-count-hint {
  margin-top: 14px;
  font-size: 15px;
  color: var(--inv-base);
  opacity: 0.78;
}

/* Slide 4: Thanks */
.thanks-content {
  justify-content: flex-start;
  padding-top: 96px;
}

.thanks-title {
  font-size: clamp(42px, 11vw, 48px);
  line-height: 1.25;
  color: var(--inv-base);
  margin-bottom: 14px;
}

.thanks-sub {
  font-size: 18px;
  line-height: 1.45;
  color: var(--inv-base);
  margin-bottom: 22px;
}

.thanks-music {
  font-size: 12.5px;
  color: var(--inv-base);
  opacity: 0.52;
  letter-spacing: 0.4px;
}

/* ============================================================
   ANIMATE.CSS-FAITHFUL ENTRANCE KEYFRAMES
   (Play automatically when .sm-slide becomes .is-active)
   ============================================================ */
.sm-slide.is-active .anim-fade-down {
  animation: fadeInDown 2.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sm-slide.is-active .anim-fade-up {
  animation: fadeInUp 2.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sm-slide.is-active .anim-fade-left {
  animation: fadeInLeft 2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sm-slide.is-active .anim-fade-right {
  animation: fadeInRight 2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sm-slide.is-active .anim-zoom-in {
  animation: zoomInSoft 2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sm-slide.is-active .anim-floral-bl {
  animation:
    fadeInBottomLeft 1.9s cubic-bezier(0.22, 1, 0.36, 1) both,
    floralSwayLeft 6s ease-in-out 1.9s infinite;
}

.sm-slide.is-active .anim-floral-br {
  animation:
    fadeInBottomRight 1.9s cubic-bezier(0.22, 1, 0.36, 1) both,
    floralSwayRight 6.4s ease-in-out 1.9s infinite;
}

.d-100 { animation-delay: 0.1s !important; }
.d-200 { animation-delay: 0.2s !important; }
.d-500 { animation-delay: 0.45s !important; }
.d-600 { animation-delay: 0.6s !important; }
.d-800 { animation-delay: 0.8s !important; }
.d-900 { animation-delay: 0.9s !important; }
.d-1000 { animation-delay: 1s !important; }
.d-1100 { animation-delay: 1.1s !important; }
.d-1200 { animation-delay: 1.2s !important; }
.d-1300 { animation-delay: 1.3s !important; }
.d-1700 { animation-delay: 1.65s !important; }

@keyframes fadeInDown {
  from { opacity: 0; transform: translate3d(0, -34px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translate3d(0, 34px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translate3d(-38px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translate3d(38px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes zoomInSoft {
  from { opacity: 0; transform: scale3d(0.65, 0.65, 0.65); }
  to { opacity: 1; transform: scale3d(1, 1, 1); }
}

@keyframes fadeInBottomLeft {
  from { opacity: 0; transform: translate3d(-44px, 44px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes fadeInBottomRight {
  from { opacity: 0; transform: scaleX(-1) translate3d(-44px, 44px, 0); }
  to { opacity: 1; transform: scaleX(-1) translate3d(0, 0, 0); }
}

@keyframes floralSwayLeft {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(2.2deg); }
}

@keyframes floralSwayRight {
  0%, 100% { transform: scaleX(-1) rotate(0deg); }
  50% { transform: scaleX(-1) rotate(2.2deg); }
}

/* ============================================================
   FLOATING ACTION STACK (BOTTOM-RIGHT ABOVE #smMenu)
   ============================================================ */
.floating-action {
  position: absolute;
  right: 12px;
  bottom: calc(var(--menu-height) + 16px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.canvas.not-open .floating-action {
  opacity: 0;
  transform: translateX(24px);
  pointer-events: none;
}

.fab-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: var(--inv-accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 5px 14px rgba(144, 59, 58, 0.28);
  transition: transform 0.18s ease;
}

.fab-circle:active {
  transform: scale(0.92);
}

.fab-wa {
  background: #28a745;
  border-color: rgba(255, 255, 255, 0.75);
}

/* ============================================================
   DOCKED 5-TAB BOTTOM MENU (#smMenu)
   ============================================================ */
.sm-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--menu-height);
  z-index: 25;
  background: var(--menu-bg);
  border-top: 1px solid rgba(144, 59, 58, 0.12);
  padding: 6px 8px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.canvas.not-open .sm-menu {
  transform: translateY(105%);
}

.sm-tab {
  border: none;
  background: transparent;
  color: var(--menu-inactive);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  font-family: var(--font-accent);
  font-size: 11px;
  transition: background 0.25s ease, color 0.25s ease;
}

.sm-tab.is-active {
  background: var(--menu-active);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(144, 59, 58, 0.26);
}

/* ============================================================
   MODALS (RSVP & QR) — SATUMOMEN STYLE
   ============================================================ */
.sm-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(58, 20, 22, 0.55);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sm-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sm-modal-shell {
  width: 100%;
  max-width: 375px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.sm-modal-card {
  width: 100%;
  max-height: 76dvh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 20px;
  padding: 22px 20px;
  box-shadow: 0 20px 50px rgba(60, 18, 20, 0.32);
  color: #3d2424;
}

.modal-title {
  text-align: center;
  font-size: 20px;
  color: var(--inv-base);
  margin-bottom: 16px;
}

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.field label {
  font-family: var(--font-accent);
  font-size: 12px;
  color: var(--inv-base);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #dcc4c5;
  background: #ffffff;
  color: #3d2424;
  font-family: var(--font-accent);
  font-size: 13px;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--inv-base);
}

.wa-input-row {
  display: flex;
  align-items: stretch;
}

.wa-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid #dcc4c5;
  border-right: none;
  border-radius: 10px 0 0 10px;
  background: #faecf1;
  color: var(--inv-base);
  font-family: var(--font-accent);
  font-size: 13px;
}

.wa-input-row input {
  border-radius: 0 10px 10px 0;
}

.modal-wishes-wrap {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f0dedf;
}

.wishes-heading {
  font-family: var(--font-accent);
  font-size: 13px;
  color: var(--inv-base);
  margin-bottom: 10px;
}

.wishes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wish-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fdf6f7;
  border: 1px solid #f2dfe0;
  text-align: left;
}

.wish-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--inv-bg);
  color: var(--inv-base);
  font-family: var(--font-accent);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wish-body { flex: 1; min-width: 0; }

.wish-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 3px;
}

.wish-name {
  font-family: var(--font-accent);
  font-size: 13px;
  color: #3d2424;
}

.wish-pill {
  font-family: var(--font-accent);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
}

.wish-pill.Hadir {
  background: #d9f0fa;
  color: #0c5460;
}

.wish-pill.Tidak\ Hadir {
  background: #fbe3e4;
  color: #903B3A;
}

.wish-msg {
  font-family: var(--font-accent);
  font-size: 12px;
  line-height: 1.45;
  color: #5c4040;
}

.wish-time {
  margin-top: 4px;
  font-family: var(--font-accent);
  font-size: 10px;
  color: #9b7a7a;
}

/* QR Card */
.qr-card {
  text-align: center;
}

.qr-guest-label {
  font-size: 14px;
  color: #8c6666;
}

.qr-guest-name {
  font-size: 19px;
  color: var(--inv-base);
  margin: 2px 0 12px;
}

.qr-box {
  display: inline-flex;
  padding: 10px;
  border-radius: 14px;
  border: 2px solid var(--inv-bg);
  background: #ffffff;
  margin-bottom: 16px;
}

.qr-share-builder {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid #f0dedf;
}

.qr-share-builder label {
  font-family: var(--font-accent);
  font-size: 12px;
  color: var(--inv-base);
}

.qr-share-builder input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #dcc4c5;
  font-family: var(--font-accent);
  font-size: 13px;
}

.share-url-preview {
  padding: 8px 10px;
  border-radius: 8px;
  background: #faecf1;
  color: var(--inv-base);
  font-family: var(--font-accent);
  font-size: 11px;
  word-break: break-all;
}

/* Circular Soft-Pink Close Button at Bottom Center (Satumomen Signature) */
.modal-close-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: #faecf1;
  color: var(--inv-base);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* Toast */
.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translate(-50%, -22px);
  z-index: 200;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--inv-base);
  color: #ffffff;
  font-family: var(--font-accent);
  font-size: 12.5px;
  box-shadow: 0 8px 20px rgba(144, 59, 58, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
