@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  color-scheme: light;
  --ink: #4a3037;
  --rose: #df7189;
  --rose-dark: #c9506d;
  --paper: #fffdfc;
}

* { box-sizing: border-box; }
html, body { width: 100%; overflow-x: hidden; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  background: #fff4f5;
}

.page {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 32px 20px 70px;
  background:
    radial-gradient(ellipse at 12% 18%, #ffe1e8 0, transparent 32%),
    radial-gradient(ellipse at 88% 82%, #ffe5dc 0, transparent 30%),
    #fff4f5;
}

.invitation {
  position: relative;
  z-index: 1;
  width: min(100%, 510px);
  padding: 58px 48px 22px;
  text-align: center;
  background: var(--paper);
  border: 1px solid rgba(201, 80, 109, .12);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(129, 62, 79, .13);
}

/* На шагах даты и плана держим открытку компактной, в том числе при будущих изменениях. */
.page.date-mode .invitation,
.page.plan-mode .invitation {
  width: min(100%, 380px);
  padding: 24px 22px 8px;
}
.page.date-mode h1,
.page.plan-mode h1 { font-size: clamp(30px, 6vw, 40px); }

.eyebrow {
  margin: 0 0 14px;
  color: var(--rose-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  max-width: 390px;
  margin: 0 auto;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(34px, 7vw, 46px);
  line-height: 1.14;
  font-weight: 600;
}
.date-emoji { display: inline-block; font-size: .72em; vertical-align: .08em; }

.note { margin: 18px 0 30px; color: #90757c; font-size: 15px; }
.actions { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 24px; }
.actions[hidden], .date-choice[hidden], .plan-choice[hidden] { display: none; }
.step-actions[hidden] { display: none; }

.date-choice {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 26px;
  text-align: left;
}
.date-field { display: grid; flex: 1; gap: 8px; color: var(--rose-dark); font-size: 13px; font-weight: 700; }
.date-field input {
  width: 100%;
  min-width: 0;
  padding: 13px 12px;
  color: var(--ink);
  font: 500 14px 'DM Sans', sans-serif;
  background: #fff7f8;
  border: 1px solid #efd7de;
  border-radius: 13px;
}
.date-field input:focus-visible { outline: 3px solid #f2a9b9; outline-offset: 2px; }
.plan-choice { margin-top: 18px; text-align: left; }
.idea-options { display: grid; gap: 7px; margin: 0; padding: 0; border: 0; }
.idea-options legend { margin: 0 auto 12px; color: var(--ink); text-align: center; font: 600 21px/1.25 'Playfair Display', Georgia, serif; }
.idea-option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  color: #795f66;
  background: #fff7f8;
  border: 1px solid #f1dce1;
  border-radius: 13px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.idea-option:has(input:checked) { background: #ffedf1; border-color: #e6a0b0; }
.idea-option input { width: 17px; height: 17px; margin: 0; accent-color: var(--rose-dark); }
.custom-idea { display: grid; gap: 8px; margin-top: 17px; color: var(--rose-dark); font-size: 13px; font-weight: 700; }
.custom-idea textarea {
  width: 100%;
  min-height: 64px;
  padding: 12px;
  color: var(--ink);
  font: 500 14px/1.4 'DM Sans', sans-serif;
  background: #fff7f8;
  border: 1px solid #efd7de;
  border-radius: 13px;
  resize: vertical;
}
.custom-idea textarea:focus-visible { outline: 3px solid #f2a9b9; outline-offset: 2px; }
.meeting-place { display: grid; gap: 8px; margin-top: 18px; color: var(--rose-dark); text-align: left; font-size: 13px; font-weight: 700; }
.meeting-place[hidden] { display: none; }
.meeting-place input { width: 100%; min-width: 0; padding: 13px 12px; color: var(--ink); font: 500 14px 'DM Sans', sans-serif; background: #fff7f8; border: 1px solid #efd7de; border-radius: 13px; }
.meeting-place input:focus-visible { outline: 3px solid #f2a9b9; outline-offset: 2px; }
.step-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 16px; }
.step-actions[hidden] .button { display: none; }
.button-secondary { color: #795f66; background: #f7edef; box-shadow: none; }
.button-secondary:hover { background: #f0dfe3; }
.step-actions .button { min-width: 148px; }
.step-actions .button-secondary { min-width: 112px; padding: 12px 18px; font-size: 14px; }

.button {
  min-width: 148px;
  padding: 16px 24px;
  border: 0;
  border-radius: 999px;
  font: 600 15px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.button:hover { transform: translateY(-2px); }
.button:focus-visible { outline: 3px solid #f2a9b9; outline-offset: 3px; }
.button-yes { color: white; background: var(--rose); box-shadow: 0 8px 18px rgba(201, 80, 109, .22); }
.button-yes:hover { background: var(--rose-dark); }
.button-no { color: #795f66; background: #f7edef; }
.button-no:hover { background: #f0dfe3; }
.button-running {
  position: fixed;
  z-index: 5;
  min-width: 120px;
  touch-action: manipulation;
  transition: left .18s ease, top .18s ease, transform .18s ease;
}
.answer { min-height: 24px; margin: 18px 0 0; color: var(--rose-dark); font-weight: 600; }

.footer {
  position: absolute;
  bottom: 58px;
  margin: 0;
  color: #a78c93;
  font-size: 12px;
  letter-spacing: .03em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .35s ease, transform .35s ease, visibility .35s;
}
.footer span { color: var(--rose); }
.footer.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.friend-sign {
  position: absolute;
  bottom: 16px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #a78c93;
  font-size: 19px;
  opacity: .45;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .18s ease, opacity .18s ease;
}
.telegram-copy {
  position: absolute;
  bottom: 16px;
  left: 18px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 13px;
  color: #477b9b;
  font: 600 13px 'DM Sans', sans-serif;
  background: rgba(255, 253, 252, .88);
  border: 1px solid rgba(71, 123, 155, .2);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(75, 35, 48, .08);
  cursor: pointer;
  touch-action: manipulation;
}
.telegram-copy:hover { background: white; }
.telegram-copy:focus-visible { outline: 3px solid #8fc6e4; outline-offset: 3px; }
.friend-sign:hover, .friend-sign:focus-visible { opacity: 1; }
.friend-sign:hover { transform: translateY(-2px) scale(1.06); }
.friend-sign:focus-visible { outline: 2px solid #b77b4e; outline-offset: 3px; }

.hearts { position: absolute; inset: 0; pointer-events: none; }
.heart, .sparkle { position: absolute; color: #e998a9; opacity: .56; user-select: none; }
.heart { animation: float 5s ease-in-out infinite; }
.secret-heart {
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}
.secret-heart:hover { opacity: .9; scale: 1.2; }
.secret-heart:focus-visible { outline: 2px solid var(--rose-dark); outline-offset: 5px; border-radius: 50%; }
.heart-one { top: 13%; left: 14%; font-size: 38px; transform: rotate(-16deg); }
.heart-two { top: 23%; right: 13%; font-size: 23px; animation-delay: -1s; }
.heart-three { right: 18%; bottom: 16%; font-size: 42px; transform: rotate(12deg); animation-delay: -2s; }
.heart-four { left: 11%; bottom: 24%; font-size: 25px; animation-delay: -3s; }
.heart-five { top: 49%; left: 5%; font-size: 16px; animation-delay: -1.5s; }
.heart-six { top: 58%; right: 7%; font-size: 17px; animation-delay: -2.5s; }
.sparkle { color: #d8a65c; font-size: 23px; opacity: .7; }
.sparkle-one { top: 14%; right: 29%; }
.sparkle-two { bottom: 17%; left: 28%; font-size: 16px; }
.date-decoration { position: absolute; opacity: 0; visibility: hidden; font-size: 30px; animation: float 6s ease-in-out infinite; transition: opacity .5s ease, visibility .5s; }
.page.date-mode .date-decoration { opacity: .42; visibility: visible; }
.date-decoration-one { top: 36%; left: 18%; }
.date-decoration-two { right: 17%; bottom: 31%; animation-delay: -2s; }
.date-decoration-three { top: 70%; right: 28%; font-size: 23px; animation-delay: -4s; }
.date-decoration-four { top: 17%; right: 24%; font-size: 25px; animation-delay: -1s; }
.date-decoration-five { bottom: 17%; left: 29%; font-size: 20px; animation-delay: -3s; }
.plan-decoration { position: absolute; opacity: 0; visibility: hidden; font-size: 30px; animation: float 6s ease-in-out infinite; transition: opacity .5s ease, visibility .5s; }
.page.plan-mode .plan-decoration { opacity: .48; visibility: visible; }
.place-decoration { position: absolute; z-index: 0; opacity: 0; visibility: hidden; font-size: 30px; animation: float 6s ease-in-out infinite; transition: opacity .5s ease, visibility .5s; }
.page.place-mode .place-decoration { opacity: .5; visibility: visible; }
.place-decoration-one { top: 20%; left: 20%; }
.place-decoration-two { top: 34%; right: 15%; animation-delay: -2s; }
.place-decoration-three { bottom: 24%; left: 18%; animation-delay: -4s; }
.place-decoration-four { bottom: 17%; right: 25%; font-size: 24px; animation-delay: -1s; }
.done-decoration { position: absolute; z-index: 0; opacity: 0; visibility: hidden; font-size: 31px; animation: float 6s ease-in-out infinite; transition: opacity .5s ease, visibility .5s; }
.page.done-mode .done-decoration { opacity: .5; visibility: visible; }
.done-decoration-one { top: 20%; left: 19%; }
.done-decoration-two { top: 36%; right: 16%; animation-delay: -2s; }
.done-decoration-three { bottom: 22%; left: 17%; animation-delay: -4s; }
.done-decoration-four { bottom: 16%; right: 25%; font-size: 24px; animation-delay: -1s; }
.plan-decoration-one { top: 32%; left: 18%; }
.plan-decoration-two { right: 17%; bottom: 30%; animation-delay: -2s; }
.plan-decoration-three { top: 70%; right: 28%; font-size: 26px; animation-delay: -4s; }
.plan-decoration-four { top: 17%; right: 24%; font-size: 25px; animation-delay: -1s; }
.plan-decoration-five { bottom: 17%; left: 29%; font-size: 24px; animation-delay: -3s; }
.cake-easter-egg {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}
.cake-easter-egg:hover { scale: 1.2; opacity: .9; }
.cake-easter-egg:focus-visible { outline: 2px solid var(--rose-dark); outline-offset: 4px; border-radius: 50%; }

.surprise {
  position: fixed;
  width: min( calc(100% - 36px), 360px );
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 32px 28px 28px;
  color: var(--ink);
  text-align: center;
  background: var(--paper);
  border: 1px solid rgba(201, 80, 109, .18);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(75, 35, 48, .24);
}
.surprise::backdrop { background: rgba(75, 35, 48, .32); backdrop-filter: blur(3px); }
.surprise-image {
  display: block;
  width: min(100%, 230px);
  height: min(34vh, 280px);
  margin: -8px auto 14px;
  object-fit: contain;
  background: radial-gradient(ellipse at 50% 58%, #ffe5eb 0%, #fff3f5 58%, transparent 74%);
  filter: drop-shadow(0 10px 14px rgba(129, 62, 79, .18));
}
.surprise-icon { margin: 0 0 12px; font-size: 38px; }
.cake-surprise-image {
  display: block;
  width: 100%;
  height: 172px;
  margin: -8px auto 16px;
  object-fit: cover;
  object-position: center 54%;
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(129, 62, 79, .16);
}
.surprise h2 { margin: 0; font: 600 25px/1.2 'Playfair Display', Georgia, serif; }
.surprise p:last-child { margin: 12px 0 0; color: #90757c; }
.surprise-close {
  position: absolute;
  top: 9px;
  right: 12px;
  min-width: 62px;
  min-height: 40px;
  padding: 0 12px;
  color: #795f66;
  font: 600 13px 'DM Sans', sans-serif;
  background: #f7edef;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

@media (max-width: 520px) {
  body { height: 100svh; overflow: hidden; }
  .page { width: 100%; height: 100svh; min-height: 100svh; overflow: hidden; padding: 10px 12px 48px; }
  .invitation { width: min(calc(100% - 12px), 360px); max-height: calc(100svh - 68px); overflow-y: auto; padding: clamp(16px, 3.5svh, 26px) clamp(12px, 4vw, 16px) clamp(10px, 2.5svh, 18px); border-radius: 19px; }
  .page.date-mode .invitation,
  .page.plan-mode .invitation,
  .page.place-mode .invitation { width: min(calc(100% - 12px), 350px); padding: clamp(14px, 2.8svh, 22px) clamp(10px, 3vw, 14px) clamp(8px, 2svh, 14px); }
  .page.done-mode .invitation { width: min(calc(100% - 12px), 350px); padding: clamp(16px, 3.2svh, 24px) clamp(10px, 3vw, 14px) clamp(10px, 2.5svh, 16px); }
  .page.date-mode h1,
  .page.plan-mode h1,
  .page.place-mode h1,
  .page.done-mode h1 { font-size: clamp(24px, 6vw, 30px); }
  .eyebrow { margin-bottom: 9px; font-size: 11px; }
  .button { min-height: 44px; padding: 12px 18px; }
  .actions { gap: 12px; margin-top: 18px; }
  .date-choice { gap: 8px; margin-top: 16px; }
  .date-field input { padding: 10px 8px; font-size: 13px; }
  .plan-choice { margin-top: 12px; }
  .idea-options { gap: 5px; }
  .idea-options legend { margin-bottom: 8px; font-size: 17px; }
  .idea-option { gap: 8px; padding: 8px 9px; font-size: 13px; }
  .custom-idea { gap: 6px; margin-top: 11px; }
  .custom-idea textarea { min-height: 48px; padding: 9px; }
  .meeting-place { margin-top: 12px; }
  .meeting-place input { padding: 10px; }
  .step-actions { gap: 6px; margin-top: 11px; }
  .surprise { width: min(calc(100% - 24px), 360px); max-height: calc(100svh - 24px); padding: 54px 20px 22px; }
  .surprise-image { height: min(30svh, 220px); }
  .cake-surprise-image { height: min(25svh, 160px); }
  .heart-one { left: 7%; top: 8%; }
  .heart-two { right: 5%; top: 14%; }
  .heart-three { right: 7%; bottom: 10%; }
  .heart-four { left: 5%; bottom: 17%; }
  /* Пасхальное сердечко закреплено на фоне отдельно от белой карточки. */
  .secret-heart { position: fixed; z-index: 3; top: auto; right: auto; bottom: 66px; left: 42px; padding: 8px; font-size: 21px; opacity: .72; }
  .telegram-copy { position: fixed; bottom: 14px; left: 12px; min-height: 40px; }
  /* Пасхалка на торте остаётся снаружи карточки и видна на шаге выбора плана. */
  .cake-easter-egg { position: fixed; z-index: 3; top: 0; right: 46px; bottom: auto; left: auto; padding: 8px; font-size: 25px; }
  .page.plan-mode .cake-easter-egg { opacity: .9; visibility: visible; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* На екрані підтвердження показуємо дату, час і план окремими рядками. */
.answer { white-space: pre-line; }
