/* ---------- 1. Colour palette (change these to restyle everything) ---------- */
:root {
  --bg-1: #ffe3ec;      /* soft pink */
  --bg-2: #ffc9da;      /* deeper pink */
  --card: #fffafb;      /* near-white card */
  --rose: #e0446f;      /* main accent, used on Yes button + headings */
  --rose-dark: #b72d54;
  --ink: #5a2a3a;       /* text colour */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;          /* centres the card on screen */
  padding: 1rem;
  font-family: "Figtree", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
  overflow-x: hidden;
}

/* ---------- 2. The card (the "invitation area") ---------- */
.card {
  position: relative;           /* the No button is kept inside this box */
  width: min(560px, 100%);
  padding: clamp(2rem, 6vw, 3.5rem) clamp(1.25rem, 5vw, 3rem);
  background: var(--card);
  border-radius: 28px;
  box-shadow: 0 20px 50px rgba(224, 68, 111, .25);
  text-align: center;
  z-index: 1;                   /* sits above the floating hearts */
}

h1, h2 {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 600;
  color: var(--rose);
  line-height: 1.15;
  margin: 0 0 1rem;
}
h1 { font-size: clamp(2.2rem, 8vw, 3.4rem); }
h2 { font-size: clamp(1.8rem, 6vw, 2.6rem); }

.message { font-size: 1.1rem; line-height: 1.6; margin: 0 0 2rem; }

/* ---------- 3. Buttons ---------- */
.buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  min-height: 3.5rem;
}

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 1.1rem;
  padding: .85rem 1.8rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.yes {
  background: var(--rose);
  color: #fff;
  box-shadow: 0 6px 16px rgba(224, 68, 111, .4);
}
.yes:hover { transform: scale(1.08); background: var(--rose-dark); }
.yes:focus-visible, .no:focus-visible { outline: 3px solid var(--rose-dark); outline-offset: 3px; }

.no {
  background: #f3dfe5;
  color: var(--ink);
  /* This transition makes the dodge smooth instead of a jump */
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- 4. Celebration section ---------- */
#celebration:not([hidden]) { animation: pop .7s cubic-bezier(.34, 1.56, .64, 1); }

.big-heart {
  font-size: 4.5rem;
  display: inline-block;
  animation: beat 1s ease-in-out infinite;
}

.details {
  display: grid;
  gap: .75rem;
  margin: 0;
  text-align: left;
}
.details div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1.1rem;
  background: #ffeef3;
  border-radius: 16px;
}
.details dt { font-weight: 600; }
.details dd { margin: 0; text-align: right; }

/* ---------- 5. Floating hearts ---------- */
.hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;         /* hearts never block clicks */
  overflow: hidden;
  z-index: 0;
}
.heart {
  position: absolute;
  bottom: -3rem;
  opacity: 0;
  animation: float linear forwards;
}

/* ---------- 6. Animations ---------- */
@keyframes float {
  0%   { transform: translateY(0) translateX(0) rotate(0); opacity: 0; }
  10%  { opacity: .8; }
  100% { transform: translateY(-115vh) translateX(var(--drift)) rotate(40deg); opacity: 0; }
}
@keyframes pop {
  from { transform: scale(.6); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}
@keyframes beat {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

/* Respect people who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  .heart, .big-heart { animation: none; }
  .no { transition: none; }
}

/* ---------- 7. Layout for the multi-view version ---------- */
.wrap { width: min(560px, 100%); display: grid; gap: 1rem; position: relative; z-index: 1; }
.card { width: 100%; }
[hidden] { display: none !important; }

/* Soft fade whenever a view appears */
.view { animation: fade .5s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 8. Form ---------- */
form { display: grid; gap: 1rem; text-align: left; }
label { display: grid; gap: .35rem; font-weight: 600; font-size: .95rem; }
input, textarea {
  font: inherit; color: var(--ink); width: 100%;
  padding: .75rem 1rem; background: #fff;
  border: 2px solid #f3cfdb; border-radius: 14px;
}
input:focus-visible, textarea:focus-visible { outline: 3px solid var(--rose); outline-offset: 1px; border-color: var(--rose); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 420px) { .row { grid-template-columns: 1fr; } }
.error { color: var(--rose-dark); font-size: .85rem; font-weight: 400; min-height: 0; }
.status { margin: 0; font-size: .95rem; text-align: center; min-height: 1.2em; }

/* ---------- 9. Invitation extras ---------- */
.from { font-family: "Fraunces", serif; font-style: italic; font-size: 1.6rem; color: var(--rose); margin: 0 0 .5rem; }
.card .details { margin-bottom: 2rem; }
#celebration + .details { margin-top: 0; }

/* ---------- 10. Share panel ---------- */
.panel {
  background: rgba(255, 250, 251, .85); border-radius: 22px; padding: 1.25rem;
  display: grid; gap: .9rem; text-align: center;
  box-shadow: 0 10px 30px rgba(224, 68, 111, .15);
}
.panel h2 { font-size: 1.5rem; margin: 0; }
.share-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.btn.small { font-size: .95rem; padding: .6rem 1.2rem; background: var(--rose); color: #fff; }
.btn.small.ghost { background: #f3dfe5; color: var(--ink); }
.btn:disabled { opacity: .6; cursor: wait; }
