/* =====================
   CSS VARIABLES & RESET
   ===================== */
:root {
  --pink-light: #fff0f3;
  --pink-mid: #ffd6e0;
  --pink-warm: #ffb3c6;
  --pink-deep: #ff85a1;
  --rose: #c9184a;
  --crimson: #a4133c;
  --cream: #fff8f0;
  --cream-text: #c9184a;
  --text-dark: #7b2d3e;
  --text-soft: #c47a8a;
  --white: #ffffff;
  --shadow: rgba(201, 24, 74, 0.15);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--pink-light) 0%, var(--cream) 50%, var(--pink-mid) 100%);
}

body {
  font-family: 'Cormorant Garamond', serif;
  color: var(--text-dark);
}

/* =====================
   PAGES & TRANSITIONS
   ===================== */
.page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transform: translateX(100%);
  transition: transform 0.65s cubic-bezier(0.77, 0, 0.18, 1);
  overflow-y: auto;
  padding: 24px 16px;
}

.page.active {
  transform: translateX(0%);
}

.page.slide-out {
  transform: translateX(-100%);
}

.page-inner {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 40px 24px;
  position: relative;
  z-index: 2;
}

/* =====================
   PETAL / HEART / STAR DECORATION
   ===================== */
.petal-container,
.hearts-container,
.stars-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.petal {
  position: absolute;
  font-size: 18px;
  opacity: 0;
  animation: fall linear infinite;
  top: -40px;
  --dx: 0px;
  --rot: 360deg;
}

@keyframes fall {
  0%   { transform: translate(0, -40px) rotate(0deg); opacity: 0; }
  8%   { opacity: 0.6; }
  30%  { transform: translate(calc(var(--dx) * 0.35), 28vh) rotate(calc(var(--rot) * 0.3)); }
  60%  { transform: translate(calc(var(--dx) * -0.5), 60vh) rotate(calc(var(--rot) * 0.6)); }
  85%  { transform: translate(calc(var(--dx) * 0.8), 90vh) rotate(calc(var(--rot) * 0.85)); }
  92%  { opacity: 0.5; }
  100% { transform: translate(var(--dx), 110vh) rotate(var(--rot)); opacity: 0; }
}

.heart {
  position: absolute;
  bottom: -40px;
  opacity: 0;
  animation: rise linear infinite;
  --dx: 24px;
  --rot: 12deg;
}

@keyframes rise {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: 0.85; }
  35%  { transform: translate(calc(var(--dx) * 0.6), -35vh) rotate(calc(var(--rot) * 0.4)); }
  65%  { transform: translate(calc(var(--dx) * -0.7), -68vh) rotate(calc(var(--rot) * -0.7)); }
  92%  { opacity: 0.6; }
  100% { transform: translate(var(--dx), -110vh) rotate(var(--rot)); opacity: 0; }
}

.star {
  position: absolute;
  opacity: 0;
  animation: twinkle ease-in-out infinite;
  --dx: 0px;
  --dy: 0px;
  --rot: 20deg;
}

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: translate(0, 0) scale(0.6) rotate(0deg); }
  50%      { opacity: 1; transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(var(--rot)); }
}

/* =====================
   TYPOGRAPHY
   ===================== */
.main-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 8vw, 3.4rem);
  font-weight: 400;
  color: var(--rose);
  text-align: center;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 4.5vw, 2.6rem);
  font-weight: 400;
  color: var(--rose);
  text-align: center;
  line-height: 1.35;
}

.section-title em {
  font-style: normal;
  color: var(--rose);
}

/* =====================
   ENVELOPE DECO
   ===================== */
.envelope-deco {
  font-size: 3.5rem;
  animation: heartbeat 2.4s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15%       { transform: scale(1.15); }
  30%       { transform: scale(1); }
  45%       { transform: scale(1.08); }
}

/* =====================
   BUTTONS
   ===================== */
.btn-group {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 400;
  padding: 14px 44px;
  border: none;
  border-radius: 60px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  letter-spacing: 0.03em;
  position: relative;
  z-index: 1;
}

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

.btn-yes {
  background: linear-gradient(135deg, var(--pink-deep) 0%, var(--rose) 100%);
  color: var(--white);
  box-shadow: 0 6px 24px var(--shadow);
}

.btn-yes:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(201, 24, 74, 0.3);
}

.btn-no {
  background: var(--white);
  color: var(--text-soft);
  border: 1.5px solid var(--pink-warm);
  box-shadow: 0 4px 14px rgba(255, 133, 161, 0.15);
}

.btn-no:hover {
  background: var(--pink-light);
}

.btn-next {
  background: linear-gradient(135deg, var(--rose) 0%, var(--crimson) 100%);
  color: var(--white);
  box-shadow: 0 6px 24px var(--shadow);
  font-size: 1.15rem;
  padding: 13px 40px;
  margin-top: 8px;
}

.btn-next:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(201, 24, 74, 0.3);
}

.btn-next:disabled {
  opacity: 0.45;
  cursor: default;
}

/* =====================
   TOAST
   ===================== */
.toast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, var(--rose), var(--crimson));
  color: #fff;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-style: italic;
  padding: 12px 32px;
  border-radius: 50px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 100;
  box-shadow: 0 8px 28px rgba(201, 24, 74, 0.25);
}

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

/* =====================
   DATE CARDS
   ===================== */
.date-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
}

@media (max-width: 520px) {
  .date-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

.date-card {
  background: var(--white);
  border: 2px solid var(--pink-mid);
  border-radius: 20px;
  padding: 22px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.date-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--shadow);
  border-color: var(--pink-deep);
}

.date-card.selected {
  border-color: var(--rose);
  background: linear-gradient(135deg, #fff0f3, #ffe4ec);
  box-shadow: 0 8px 28px rgba(201, 24, 74, 0.2);
  transform: translateY(-3px);
}

.card-emoji {
  font-size: 2.4rem;
}

.card-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  color: var(--text-dark);
  font-weight: 500;
  line-height: 1.3;
}

.date-card.selected .card-label {
  color: var(--crimson);
  font-weight: 600;
}

/* =====================
   CALENDAR
   ===================== */
.calendar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.calendar {
  background: var(--white);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 8px 32px var(--shadow);
  width: 100%;
  max-width: 380px;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cal-month-label {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--rose);
  font-style: italic;
  text-transform: capitalize;
}

.cal-nav {
  background: none;
  border: 1.5px solid var(--pink-warm);
  color: var(--rose);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-nav:hover {
  background: var(--pink-mid);
  border-color: var(--pink-deep);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 8px;
}

.cal-weekdays span {
  font-size: 0.78rem;
  color: var(--text-soft);
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 4px 0;
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.92rem;
  cursor: pointer;
  color: var(--text-dark);
  transition: background 0.15s, color 0.15s, transform 0.15s;
  font-family: 'Cormorant Garamond', serif;
}

.cal-day:hover:not(.empty):not(.past) {
  background: var(--pink-mid);
  transform: scale(1.1);
}

.cal-day.empty {
  cursor: default;
}

.cal-day.past {
  color: #ddd;
  cursor: default;
}

.cal-day.today {
  border: 1.5px solid var(--pink-deep);
  color: var(--rose);
}

.cal-day.selected {
  background: linear-gradient(135deg, var(--rose), var(--crimson));
  color: #fff;
  font-weight: 600;
  transform: scale(1.12);
  box-shadow: 0 4px 14px var(--shadow);
}

/* =====================
   TIME PICKER
   ===================== */
.time-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.time-label {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--rose);
  font-style: italic;
}

.time-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  padding: 16px 28px;
  border-radius: 20px;
  box-shadow: 0 6px 24px var(--shadow);
}

.time-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.time-btn {
  background: none;
  border: none;
  color: var(--rose);
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.time-btn:hover {
  background: var(--pink-light);
}

.time-val {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  color: var(--crimson);
  font-weight: 700;
  min-width: 2.5ch;
  text-align: center;
}

.time-colon {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  color: var(--pink-deep);
  font-weight: 300;
  margin-bottom: 4px;
}

/* =====================
   CONFIRM PAGE
   ===================== */
.confirm-page {
  gap: 28px;
}

.confirm-heart {
  font-size: 4rem;
  animation: heartbeat 2s ease-in-out infinite;
}

.confirm-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--rose);
  text-align: center;
  font-style: normal;
  line-height: 1.3;
}

.confirm-details {
  background: var(--white);
  border-radius: 24px;
  padding: 28px 36px;
  box-shadow: 0 8px 32px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 420px;
}

.confirm-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 1.25rem;
  color: var(--text-dark);
}

.confirm-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.confirm-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  color: var(--text-soft);
  font-style: italic;
  text-align: center;
}

/* =====================
   DECORATIVE BG
   ===================== */
.page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255, 182, 193, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 105, 135, 0.12) 0%, transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(255, 240, 243, 0.3) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.page-inner {
  position: relative;
  z-index: 1;
}

/* =====================
   MOBILE ADJUSTMENTS
   ===================== */
@media (max-width: 480px) {
  .page {
    padding: 16px 12px;
  }

  .page-inner {
    gap: 22px;
    padding: 24px 16px;
  }

  .envelope-deco {
    font-size: 2.6rem;
  }

  .btn-group {
    gap: 12px;
  }

  .btn {
    font-size: 1.05rem;
    padding: 12px 28px;
  }

  .btn-next {
    font-size: 1rem;
    padding: 12px 28px;
  }

  .date-options {
    gap: 10px;
  }

  .date-card {
    padding: 16px 8px;
    border-radius: 16px;
    gap: 6px;
  }

  .card-emoji {
    font-size: 1.9rem;
  }

  .card-label {
    font-size: 0.85rem;
  }

  .calendar {
    padding: 16px;
  }

  .cal-day {
    font-size: 0.8rem;
  }

  .time-inputs {
    padding: 12px 18px;
    gap: 8px;
  }

  .time-val,
  .time-colon {
    font-size: 1.8rem;
  }

  .confirm-details {
    padding: 20px 22px;
    gap: 14px;
  }

  .confirm-row {
    font-size: 1.05rem;
    gap: 12px;
  }

  .confirm-heart {
    font-size: 3rem;
  }

  .toast {
    font-size: 1rem;
    padding: 10px 20px;
    max-width: calc(100vw - 32px);
    white-space: normal;
    text-align: center;
  }
}
