/* ─────────────────────────────────────────────
   date.musanovic.dev — shared styles
   ───────────────────────────────────────────── */

:root {
  --bg-1: #2b1055;
  --bg-2: #7597de;
  --rose: #ff5e7e;
  --rose-dark: #e63960;
  --cream: #fff6f0;
  --ink: #2d1b3d;
  --glass: rgba(255, 255, 255, 0.82);
  --shadow: 0 24px 60px rgba(30, 10, 60, 0.35);
  --radius: 28px;
}

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

html, body { height: 100%; }

body {
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #1b0a3a 0%, #4a1b6d 35%, #b34a8f 70%, #ff8e6e 100%);
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-x: hidden;
}

/* ── Floating hearts background ─────────────── */
.hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.hearts span {
  position: absolute;
  bottom: -10vh;
  font-size: 22px;
  opacity: 0;
  animation: float-up linear infinite;
}

@keyframes float-up {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 0; }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-115vh) rotate(40deg) scale(1.4); opacity: 0; }
}

/* ── Card ───────────────────────────────────── */
.card {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 56px 44px 48px;
  text-align: center;
  /* fill-mode "backwards" (not "both"): a lingering transform would turn the
     card into the containing block for position:fixed children (the runaway
     No button), breaking its viewport coordinates */
  animation: card-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes card-in {
  from { transform: translateY(30px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.envelope {
  font-size: 56px;
  animation: wiggle 2.4s ease-in-out infinite;
  display: inline-block;
}

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

h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.9rem, 5.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 18px 0 10px;
  letter-spacing: -0.5px;
}

.name {
  color: var(--rose-dark);
  background: linear-gradient(90deg, var(--rose-dark), #9b2fae);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: #6d5a7e;
  font-size: 0.98rem;
  margin-bottom: 36px;
}

/* ── Buttons ────────────────────────────────── */
.buttons {
  display: flex;
  gap: 18px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  min-height: 72px;
}

.btn {
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 16px 44px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-yes {
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  color: white;
  box-shadow: 0 10px 26px rgba(230, 57, 96, 0.45);
  animation: heartbeat 1.6s ease-in-out infinite;
}

.btn-yes:hover {
  transform: scale(1.07);
  box-shadow: 0 14px 34px rgba(230, 57, 96, 0.6);
}

@keyframes heartbeat {
  0%, 100% { box-shadow: 0 10px 26px rgba(230, 57, 96, 0.45); }
  50%      { box-shadow: 0 10px 40px rgba(230, 57, 96, 0.75); }
}

.btn-no {
  background: white;
  color: #8a7a99;
  border: 2px solid #e3d9ec;
}

/* Once the No button starts running, it becomes fixed-positioned */
.btn-no.runaway {
  position: fixed;
  z-index: 10;
  transition: top 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              left 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              scale 0.35s ease;
}

.taunt {
  margin-top: 26px;
  min-height: 1.4em;
  font-size: 0.95rem;
  color: #8a4b6d;
  font-style: italic;
}

/* ─────────────────────────────────────────────
   YES page
   ───────────────────────────────────────────── */

#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.yes-card { padding: 48px 40px 40px; width: min(680px, 100%); }

.big-emoji { font-size: 64px; animation: pop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both; display: inline-block; }

@keyframes pop-in {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.funny {
  color: #5c4a6e;
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 14px auto 34px;
  max-width: 46ch;
}

.funny strong { color: var(--rose-dark); }

/* ── Calendar ───────────────────────────────── */
.picker {
  text-align: left;
  background: white;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(45, 27, 61, 0.10);
}

.picker h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.25rem;
  text-align: center;
  margin-bottom: 16px;
}

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

.cal-header .month-label { font-weight: 700; font-size: 1.05rem; }

.cal-nav {
  background: #f4eef9;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s;
}

.cal-nav:hover:not(:disabled) { background: #e8dcf3; }
.cal-nav:disabled { opacity: 0.35; cursor: default; }

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

.cal-grid .dow {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #a292b3;
  text-transform: uppercase;
  padding: 6px 0;
}

.cal-day {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.12s, transform 0.12s;
}

.cal-day:hover:not(:disabled) { background: #ffe3ea; transform: scale(1.08); }
.cal-day:disabled { color: #d5cbe0; cursor: default; }
.cal-day.today { outline: 2px dashed var(--rose); outline-offset: -2px; }
.cal-day.selected {
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  color: white;
  font-weight: 700;
}

/* ── Time slots ─────────────────────────────── */
.times {
  display: none;
  margin-top: 20px;
  border-top: 1px dashed #e8dcf3;
  padding-top: 18px;
}

.times.visible { display: block; }

.times h3 { font-size: 0.95rem; margin-bottom: 12px; color: #6d5a7e; }

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}

.slot {
  padding: 10px 0;
  border-radius: 12px;
  border: 2px solid #eee4f6;
  background: white;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}

.slot:hover { border-color: var(--rose); color: var(--rose-dark); }
.slot.selected {
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  border-color: transparent;
  color: white;
  font-weight: 700;
}

.confirm-wrap { margin-top: 24px; text-align: center; }

.btn-confirm {
  width: 100%;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  color: white;
  box-shadow: 0 10px 26px rgba(230, 57, 96, 0.4);
}

.btn-confirm:disabled {
  background: #e9dff2;
  color: #b3a4c4;
  box-shadow: none;
  cursor: default;
}

.btn-confirm:hover:not(:disabled) { transform: scale(1.02); }

/* ── Success state ──────────────────────────── */
.success { display: none; }
.success.visible { display: block; animation: card-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
.success .big-emoji { font-size: 72px; }
.success h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2rem;
  margin: 12px 0 8px;
}
.success p { color: #5c4a6e; line-height: 1.6; }
.success .when {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 24px;
  background: #fff0f4;
  border-radius: 14px;
  font-weight: 700;
  color: var(--rose-dark);
}

.error-note { color: #c0392b; font-size: 0.9rem; margin-top: 12px; display: none; }

@media (max-width: 520px) {
  .card { padding: 40px 24px 36px; }
  .btn { padding: 14px 36px; }
}
