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

:root {
  --ink: #3d2529;
  --muted: #876b70;
  --rose: #c94861;
  --rose-dark: #a52e49;
  --blush: #f7dfe0;
  --cream: #fffaf6;
  --line: rgba(124, 66, 76, 0.16);
}

* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  background: #fbefed;
  overflow-x: hidden;
}

.shell {
  width: min(100% - 2rem, 700px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 8vh 0 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card {
  position: relative;
  padding: clamp(4.5rem, 10vw, 6.5rem) clamp(1.5rem, 8vw, 5.5rem) clamp(2.3rem, 7vw, 4rem);
  text-align: center;
  background: rgba(255, 250, 246, .88);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 2rem;
  box-shadow: 0 30px 80px rgba(103, 48, 59, .13), inset 0 0 0 1px var(--line);
  backdrop-filter: blur(14px);
}

.seal {
  position: absolute;
  width: 74px;
  height: 74px;
  left: 50%;
  top: -37px;
  transform: translateX(-50%) rotate(-5deg);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #dd6a78, #a72c48);
  box-shadow: 0 10px 28px rgba(165, 46, 73, .28), inset 0 2px 2px rgba(255,255,255,.35);
}

.seal::before, .seal::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  border: 1px dashed rgba(165, 46, 73, .35);
}
.seal svg { width: 42px; fill: #ffe9e7; filter: drop-shadow(0 1px 0 rgba(98,19,39,.35)); }

.eyebrow {
  margin: 0 0 1.2rem;
  color: var(--rose);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Italiana", Georgia, serif;
  font-size: clamp(2.7rem, 9vw, 5.1rem);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.035em;
}

h1 em { color: var(--rose); font-weight: 400; }

.intro {
  max-width: 420px;
  margin: 1.6rem auto 2rem;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.65;
}

.intro-question {
  display: block;
  margin-bottom: .55rem;
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: .78rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

form { max-width: 410px; margin: 0 auto; }
label {
  display: block;
  margin: 0 0 .55rem .2rem;
  text-align: left;
  color: var(--muted);
  font-size: .71rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.input-wrap, .number-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

input[type="text"], input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 1rem;
  outline: none;
  background: rgba(255,255,255,.7);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  padding: 1rem 3rem 1rem 1.1rem;
  transition: border-color .2s, box-shadow .2s;
}
input:focus { border-color: rgba(201,72,97,.55); box-shadow: 0 0 0 4px rgba(201,72,97,.08); }
.input-wrap span { position: absolute; right: 1.2rem; color: var(--rose); font-size: 1.4rem; }

.location-option {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: .7rem;
  align-items: start;
  margin: .25rem 0 1.1rem;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  color: var(--muted);
  background: rgba(255,255,255,.42);
  font-size: .76rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  cursor: pointer;
}
.location-option input { position: absolute; opacity: 0; pointer-events: none; }
.location-option .checkmark {
  position: static;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(201,72,97,.3);
  border-radius: 7px;
  color: transparent;
  background: white;
  font-size: .75rem;
  transition: .2s ease;
}
.location-option input:checked + .checkmark { color: white; border-color: var(--rose); background: var(--rose); }
.location-option input:focus-visible + .checkmark { box-shadow: 0 0 0 4px rgba(201,72,97,.12); }
.location-option strong { display: block; margin-bottom: .05rem; color: var(--ink); font-weight: 600; }
.ip-location-notice {
  display: flex;
  gap: .45rem;
  margin: -.35rem .2rem 1rem;
  color: var(--muted);
  font-size: .66rem;
  line-height: 1.45;
  text-align: left;
}
.ip-location-notice span { flex: 0 0 auto; color: var(--rose); font-size: .9rem; }

button {
  width: 100%;
  border: 0;
  border-radius: 1rem;
  padding: 1.05rem 1.2rem;
  color: white;
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  box-shadow: 0 12px 24px rgba(165, 46, 73, .2);
  font: inherit;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
button:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(165, 46, 73, .28); }
button:disabled { opacity: .65; cursor: wait; }
button span { margin-left: .45rem; }

.signature {
  color: #a1888c;
  font-size: .72rem;
}
.signature { margin: 1.4rem 0 0; text-align: center; letter-spacing: .03em; }
.signature span { color: var(--rose); }
.signature .version-separator { margin: 0 .2rem; color: #bba5a8; }
.signature .deployment-version {
  display: inline-block;
  padding: .12rem .38rem;
  border: 1px solid rgba(201,72,97,.15);
  border-radius: 99px;
  color: #9d8589;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .62rem;
  letter-spacing: 0;
}
.form-error { min-height: 1.2rem; margin: .7rem 0 0; color: #a22742; font-size: .82rem; }
.hidden { display: none !important; }

.orbit {
  width: 88px;
  height: 88px;
  margin: 2rem auto 1rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--blush);
  border-radius: 50%;
  animation: breathe 2.2s ease-in-out infinite;
}
.orbit::before, .orbit::after { content: ""; position: absolute; border: 1px solid var(--blush); border-radius: 50%; }
.orbit::before { width: 110px; height: 110px; opacity: .65; }
.orbit::after { width: 136px; height: 136px; opacity: .3; }
.orbit span { color: var(--rose); font-size: 2rem; animation: heartbeat 1.5s infinite; }
.waiting-dots { display: flex; justify-content: center; gap: .4rem; }
.waiting-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--rose); animation: dot 1.2s infinite; }
.waiting-dots i:nth-child(2) { animation-delay: .15s; }
.waiting-dots i:nth-child(3) { animation-delay: .3s; }

.love-number {
  margin: 1.7rem 0 .8rem;
  color: var(--rose);
  font-family: "Italiana", Georgia, serif;
  font-size: clamp(5rem, 19vw, 9rem);
  line-height: 1;
}
.love-number sup { font-size: .3em; vertical-align: super; }
.progress-track { height: 10px; margin: 0 auto 1.5rem; overflow: hidden; border-radius: 99px; background: #f0dedd; }
#progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #dc8790, var(--rose)); box-shadow: 0 0 14px rgba(201,72,97,.5); }
.result-message { color: var(--muted); font-family: Georgia, serif; font-style: italic; }
.love-map {
  margin: 1.8rem 0 .6rem;
  padding: 1.1rem 1.1rem .9rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgba(255,255,255,.72), rgba(247,223,224,.34));
}
.map-kicker { margin: 0; color: var(--rose); font-size: .65rem; font-weight: 600; letter-spacing: .17em; text-transform: uppercase; }
.real-map {
  height: 280px;
  margin: .8rem 0 .75rem;
  overflow: hidden;
  border: 1px solid rgba(201,72,97,.16);
  border-radius: 1rem;
  background: #eadfda;
  z-index: 0;
}
.real-map .leaflet-tile-pane { filter: sepia(.18) saturate(.75) hue-rotate(315deg) brightness(1.04); }
.real-map .leaflet-control-zoom a { color: var(--rose); border-color: var(--line); }
.real-map .leaflet-control-attribution { color: var(--muted); background: rgba(255,250,246,.84); font-size: 8px; }
.real-map .leaflet-control-attribution a { color: var(--rose-dark); }
.love-map-marker { background: transparent; border: 0; }
.marker-core {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 3px solid #fff8f6;
  border-radius: 50%;
  color: white;
  background: var(--rose);
  box-shadow: 0 4px 15px rgba(111,40,54,.35);
  font-size: .8rem;
}
.marker-pulse {
  position: absolute;
  inset: 1px;
  border: 2px solid var(--rose);
  border-radius: 50%;
  animation: map-pulse 2s ease-out infinite;
}
.real-map .leaflet-tooltip {
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255,250,246,.94);
  box-shadow: 0 5px 16px rgba(77,39,46,.14);
  font: 600 .7rem "DM Sans", sans-serif;
}
.real-map .leaflet-tooltip::before { display: none; }
.arched-love-route { animation: route-dash 1.4s linear infinite; }
.travelling-map-heart {
  display: grid !important;
  place-items: center;
  color: var(--rose);
  background: transparent;
  border: 0;
  filter: drop-shadow(0 2px 5px rgba(104,25,42,.45));
  font-size: 1.55rem;
}
.map-caption { margin: 0; color: var(--muted); font-family: Georgia, serif; font-size: .82rem; font-style: italic; }
.quiet-button { width: auto; margin-top: 1rem; padding: .7rem 1.2rem; color: var(--rose); background: transparent; box-shadow: none; border: 1px solid var(--blush); }
.quiet-button:hover { box-shadow: none; }

.response-card { max-width: 650px; margin: auto; }
.answer-location-map { margin: -0.35rem 0 1.5rem; }
.answer-location-map .real-map { height: 220px; }
.ip-verification-status {
  margin: -.35rem 0 1.35rem;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  color: var(--muted);
  background: rgba(255,255,255,.38);
  font-size: .7rem;
  line-height: 1.45;
  text-align: left;
}
.number-wrap { max-width: 210px; margin: 0 auto 1rem; }
.number-wrap input { padding: .8rem 2.8rem .8rem 1rem; text-align: center; font-family: "Italiana", Georgia, serif; font-size: 2rem; }
.number-wrap span { position: absolute; right: 1rem; color: var(--rose); font-size: 1.2rem; }
.love-range { width: 100%; accent-color: var(--rose); }
.range-labels { display: flex; justify-content: space-between; margin: .3rem 0 1.5rem; color: var(--muted); font-size: .7rem; }
.location-note {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  margin: -0.5rem 0 1.2rem;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.45;
  text-align: left;
}
.location-note span { flex: 0 0 auto; color: var(--rose); font-size: 1rem; line-height: 1; }
.photo-picker { margin: -.45rem 0 1.25rem; }
.photo-picker > label {
  display: flex;
  gap: .7rem;
  align-items: center;
  margin: 0;
  padding: .85rem;
  border: 1px dashed rgba(201,72,97,.35);
  border-radius: .9rem;
  color: var(--muted);
  background: rgba(255,255,255,.4);
  font-size: .74rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
  text-align: left;
  text-transform: none;
  cursor: pointer;
}
.photo-picker > label:hover { border-color: var(--rose); background: rgba(255,255,255,.68); }
.photo-picker strong { display: block; color: var(--ink); font-size: .8rem; }
.camera-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--rose);
  font-size: 1.25rem;
}
.photo-picker > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-picker > input:focus-visible + .photo-preview-wrap,
.photo-picker:focus-within > label { box-shadow: 0 0 0 4px rgba(201,72,97,.1); }
.photo-preview-wrap { margin-top: .7rem; }
.photo-preview-wrap img {
  width: 100%;
  max-height: 210px;
  display: block;
  object-fit: cover;
  border: 5px solid white;
  border-radius: .8rem;
  box-shadow: 0 8px 24px rgba(82,38,47,.14);
}
.remove-photo { width: auto; margin-top: .45rem; padding: .4rem .65rem; color: var(--rose); background: transparent; border: 0; box-shadow: none; font-size: .7rem; }
.remove-photo:hover { transform: none; box-shadow: none; text-decoration: underline; }
.sent-heart { color: var(--rose); font-size: 5rem; animation: heartbeat 1.5s infinite; }

.love-photo {
  width: min(100%, 420px);
  margin: 2rem auto .8rem;
  opacity: 0;
  transform: translateY(22px) rotate(-2deg) scale(.94);
}
.photo-frame {
  position: relative;
  padding: .65rem .65rem 2.1rem;
  background: #fffdfa;
  box-shadow: 0 18px 44px rgba(82,38,47,.2);
}
.photo-frame img { width: 100%; max-height: 480px; display: block; object-fit: cover; }
.photo-heart { position: absolute; right: 1rem; bottom: .42rem; color: var(--rose); font-size: 1.15rem; }
.love-photo figcaption { margin-top: 1.1rem; color: var(--muted); font-family: Georgia, serif; font-size: .85rem; font-style: italic; }
.love-photo.photo-reveal { animation: photo-unfold 1s cubic-bezier(.2,.8,.2,1) forwards; }
.retry-photo {
  width: auto;
  margin-top: .7rem;
  padding: .55rem .85rem;
  color: var(--rose);
  background: transparent;
  border: 1px solid var(--blush);
  box-shadow: none;
  font-size: .72rem;
}
.retry-photo:hover { box-shadow: none; }

.celebrate::after {
  content: "♡  ♥  ♡  ♥  ♡  ♥  ♡";
  position: fixed;
  left: 0;
  bottom: -4rem;
  width: 100%;
  color: rgba(201,72,97,.35);
  font-size: clamp(1.3rem, 6vw, 3rem);
  word-spacing: 7vw;
  pointer-events: none;
  animation: float-hearts 4s ease-out forwards;
}

@keyframes breathe { 50% { transform: scale(1.06); } }
@keyframes heartbeat { 10%, 30% { transform: scale(1.18); } 20%, 40% { transform: scale(1); } }
@keyframes dot { 50% { transform: translateY(-5px); opacity: .4; } }
@keyframes float-hearts { to { transform: translateY(-110vh) rotate(12deg); opacity: 0; } }
@keyframes route-dash { to { stroke-dashoffset: -34; } }
@keyframes map-pulse { 0% { transform: scale(1); opacity: .65; } 100% { transform: scale(2.8); opacity: 0; } }
@keyframes photo-unfold { to { transform: translateY(0) rotate(-1deg) scale(1); opacity: 1; } }

@media (max-width: 560px) {
  .shell {
    width: min(100% - 1rem, 700px);
    padding: 2.75rem 0 1rem;
    justify-content: flex-start;
  }
  .card {
    padding-top: 3.75rem;
    border-radius: 1.5rem;
  }
  .signature { padding: 0 1rem; }
}

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