/* ==========================================================
   WillYou — Minimal Romantic
   ========================================================== */
:root {
  --blush: #f9dde0;
  --blush-2: #fdeceb;
  --crimson: #c1121f;
  --crimson-dark: #a00d19;
  --cream: #fbf5ee;
  --rose: #e9a3ae;
  --rose-soft: #f4c9cf;
  --ink: #4a1f2a;
  --ink-soft: #8a5b66;
  --line: #f0d9d9;
  --ok: #2f7d5b;
  --shadow: 0 1px 2px rgba(193, 18, 31, .05), 0 10px 30px -12px rgba(193, 18, 31, .18);
  --shadow-btn: 0 6px 18px -8px rgba(193, 18, 31, .55);
  --radius: 28px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

html, body, button, input, textarea, select {
  font-family: "WillYou";
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 85% -10%, var(--blush) 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--blush-2) 0%, transparent 60%),
    var(--cream);
  font-weight: 400;
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--crimson); }
b { font-weight: 600; }
.emoji { font-weight: 400; }

/* ---------- hearts background ---------- */
.hearts {
  position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0;
}
.heart-float {
  position: absolute; bottom: -40px; color: var(--rose);
  opacity: 0; will-change: transform, opacity;
  animation: floatUp linear infinite;
}
.heart-float svg, .burst svg { width: 100%; height: 100%; fill: currentColor; display: block; }
@keyframes floatUp {
  0%   { transform: translate3d(0, 0, 0) rotate(-8deg) scale(.8); opacity: 0; }
  12%  { opacity: var(--o, .35); }
  50%  { transform: translate3d(var(--dx, 14px), -55vh, 0) rotate(8deg) scale(1); }
  100% { transform: translate3d(calc(var(--dx, 14px) * -1), -115vh, 0) rotate(-6deg) scale(.9); opacity: 0; }
}

/* ---------- layout ---------- */
.stage {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}
.card {
  width: 100%; max-width: 440px;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 26px 30px;
}
.card.center, .center { text-align: center; }
.center-text { text-align: center; }
.step { animation: rise .7s var(--ease) both; }
.step.leaving { animation: fall .45s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fall { to { opacity: 0; transform: translateY(-10px) scale(.985); } }

.logo-heart { width: 44px; height: 44px; margin: 0 auto 6px; color: var(--crimson); animation: beat 2.6s ease-in-out infinite; }
.logo-heart svg { width: 100%; height: 100%; fill: currentColor; display: block; }
.logo-heart.big { width: 64px; height: 64px; }
.logo-heart.sm { display: inline-block; width: 20px; height: 20px; margin: 0; vertical-align: -4px; animation: none; }
.logo-heart.dim { color: var(--rose); animation: none; }
@keyframes beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.12); } 24% { transform: scale(1); } 36% { transform: scale(1.07); } 48% { transform: scale(1); } }

/* ---------- typography ---------- */
.brand { margin: 0 0 4px; font-size: 1.9rem; font-weight: 600; letter-spacing: .01em; text-align: center; }
.brand.xl { font-size: 2.6rem; }
.title { margin: 8px 0 6px; font-size: 1.6rem; font-weight: 600; text-align: center; }
.tagline { margin: 4px 0 18px; font-weight: 300; color: var(--ink-soft); letter-spacing: .04em; line-height: 1.7; }
.intro { margin: 6px 0 2px; text-align: center; color: var(--ink-soft); font-weight: 300; font-size: 1.05rem; }
.question { margin: 10px 0 8px; text-align: center; font-size: 1.7rem; font-weight: 500; line-height: 1.7; word-break: break-word; }
.lead { margin: 6px 0; text-align: center; font-size: 1.1rem; }
.muted { color: var(--ink-soft); font-size: .92rem; font-weight: 300; margin: 6px 0 16px; }
.when { margin: 4px auto 6px; text-align: center; display: table; padding: 4px 16px; border-radius: 999px; background: var(--blush-2); color: var(--crimson-dark); font-size: .95rem; font-weight: 500; }
.summary { margin: 14px auto 0; display: table; padding: 6px 18px; border-radius: 999px; background: var(--blush-2); color: var(--crimson-dark); font-weight: 500; }
.hint { display: block; margin-top: 4px; color: var(--ink-soft); font-weight: 300; font-size: .82rem; min-height: 1.2em; }
.link { font-size: .9rem; }
.home .btn { margin-top: 6px; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; -webkit-appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 22px; border-radius: 999px;
  font-size: 1rem; font-weight: 500; line-height: 1; white-space: nowrap;
  text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: transform .2s var(--ease), box-shadow .25s ease, background-color .25s ease, opacity .25s ease;
}
.btn:active { transform: scale(.96); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(193, 18, 31, .25); outline-offset: 2px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-yes { background: var(--crimson); color: #fff; box-shadow: var(--shadow-btn); }
.btn-yes:hover { background: var(--crimson-dark); }
.btn-ghost { background: rgba(255, 255, 255, .8); color: var(--crimson-dark); box-shadow: inset 0 0 0 1.5px var(--rose-soft); }
.btn-ghost:hover { background: var(--blush-2); }
.btn-block { width: 100%; min-height: 52px; margin-top: 6px; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: .9rem; }
.btn.loading::after {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- the two choices (fixed-height stage → no layout jump) ---------- */
.choices {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  height: 150px; margin-top: 14px; transition: opacity .5s ease, transform .5s ease;
}
.choices .btn { min-width: 0; padding: 0 10px; transition: flex-grow .6s var(--ease), height .6s var(--ease), font-size .6s var(--ease), transform .2s var(--ease), box-shadow .25s, background-color .25s; }
.choices .btn-yes { flex: var(--yes-grow, 1) 1 0; height: var(--yes-h, 56px); font-size: var(--yes-fs, 1.1rem); }
.choices .btn-no  { flex: var(--no-grow, 1) 1 0; height: var(--no-h, 56px); font-size: var(--no-fs, 1.05rem); min-width: 78px; }
.choices.gone { opacity: 0; transform: scale(.96); pointer-events: none; }

/* ---------- burst hearts ---------- */
.burst { position: fixed; z-index: 50; pointer-events: none; color: var(--crimson); will-change: transform, opacity; }

/* ---------- forms ---------- */
.field { display: block; margin: 14px 0; }
.field-label { display: block; margin-bottom: 6px; font-weight: 500; font-size: .95rem; }
.field-label em { font-style: normal; font-weight: 300; color: var(--ink-soft); font-size: .82rem; }
input[type=text], input[type=password], input[type=time], input[type=date], textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .9);
  padding: 12px 16px; font-size: 1rem; color: var(--ink); min-height: 50px;
  transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.8; }
input:focus, textarea:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 4px rgba(233, 163, 174, .25); }
.ltr-input { text-align: left; }
::placeholder { color: #c3a0a7; font-weight: 300; }
.form-error { margin: 8px 0; color: var(--crimson-dark); background: #fdeaea; border-radius: 14px; padding: 8px 14px; font-size: .92rem; text-align: center; }
.check { list-style: none; padding: 0; margin: 14px 0; }
.check li::before { content: "✓"; color: var(--ok); margin-inline-end: 8px; font-weight: 600; }

/* ---------- modal & toast ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(74, 31, 42, .28); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fadeIn .25s ease; }
.modal-box { position: relative; width: 100%; max-width: 400px; max-height: 92dvh; overflow: auto; background: var(--cream); border-radius: 26px; padding: 26px 22px 20px; box-shadow: 0 30px 60px -20px rgba(74, 31, 42, .4); animation: pop .35s var(--ease); }
.modal-box.wide { max-width: 520px; }
.modal-box h3 { margin: 0 0 6px; font-size: 1.3rem; font-weight: 600; }
.modal-box p { margin: 0 0 14px; color: var(--ink-soft); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; margin-top: 12px; }
.modal-actions .btn { flex: 1 1 140px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: .92rem; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .4); animation: toastIn .35s var(--ease); }
.toast.err { background: var(--crimson-dark); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ==========================================================
   Admin
   ========================================================== */
body.admin { background: var(--cream); }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(251, 245, 238, .85); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 920px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar-brand { font-weight: 600; font-size: 1.15rem; color: var(--crimson); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions form { margin: 0; }
.panel { max-width: 920px; margin: 0 auto; padding: 18px 16px 80px; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 7px 14px; font-size: .88rem; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; transition: background-color .2s, border-color .2s, color .2s; }
.chip .n { background: var(--blush-2); color: var(--crimson-dark); border-radius: 999px; padding: 0 8px; font-weight: 500; font-size: .8rem; line-height: 1.6; }
.chip.on { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.chip.on .n { background: rgba(255, 255, 255, .25); color: #fff; }

.list { display: grid; gap: 14px; }
.inv { background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 18px 18px 14px; animation: rise .5s var(--ease) both; }
.inv.inactive { opacity: .72; }
.inv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.inv-label { font-size: .82rem; color: var(--ink-soft); margin: 0 0 2px; font-weight: 300; }
.inv-msg { margin: 0; font-size: 1.15rem; font-weight: 500; line-height: 1.7; word-break: break-word; }
.badge { flex: 0 0 auto; border-radius: 999px; padding: 3px 12px; font-size: .8rem; font-weight: 500; white-space: nowrap; }
.b-pending { background: #fff4dc; color: #8a6200; }
.b-accepted_waiting { background: #e6f0ff; color: #234f9c; }
.b-accepted_scheduled { background: #e1f5ea; color: #1f6a49; }
.b-declined { background: #f5e3e5; color: #8c2434; }
.off-tag { background: #eee; color: #666; margin-inline-start: 6px; }

.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; margin: 12px 0 4px; font-size: .9rem; }
.meta dt { color: var(--ink-soft); font-weight: 300; font-size: .78rem; }
.meta dd { margin: 0; font-weight: 500; word-break: break-word; }
.note { margin: 8px 0 0; background: var(--blush-2); border-radius: 14px; padding: 8px 12px; font-size: .92rem; white-space: pre-wrap; word-break: break-word; }
.linkrow { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.linkrow input { min-height: 40px; padding: 6px 12px; font-size: .82rem; direction: ltr; text-align: left; border-radius: 999px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.act { border: 0; background: transparent; color: var(--ink-soft); font-size: .85rem; padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: background-color .2s, color .2s; }
.act:hover { background: var(--blush-2); color: var(--crimson-dark); }
.act.danger:hover { background: #fdeaea; color: var(--crimson); }
.empty { text-align: center; color: var(--ink-soft); padding: 60px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 480px) {
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .card { padding: 30px 20px 24px; }
  .question { font-size: 1.5rem; }
  .brand.xl { font-size: 2.2rem; }
}
@media (min-width: 900px) {
  .stage { padding-block: 48px; }
  .card { max-width: 480px; padding: 44px 36px 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hearts { display: none; }
}

/* ---------- custom pickers (24h time + Jalali date) ---------- */
select {
  -webkit-appearance: none; appearance: none; font-family: "WillYou"; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 18px; min-height: 50px; padding: 8px 14px 8px 34px; font-size: 1rem;
  background: rgba(255,255,255,.9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23c1121f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat 12px center;
  transition: border-color .2s, box-shadow .2s; cursor: pointer; min-width: 0;
}
select:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 4px rgba(233,163,174,.25); }
.tp { display: flex; align-items: center; justify-content: center; gap: 10px; direction: ltr; }
.tp-sel { flex: 1 1 0; max-width: 140px; min-height: 62px; font-size: 1.6rem; font-weight: 500; text-align: center; text-align-last: center; padding-inline: 14px 14px; background-position: 10px center; }
.tp-colon { font-size: 1.8rem; font-weight: 500; color: var(--crimson); }
.dp { display: grid; grid-template-columns: .8fr 1.3fr 1fr; gap: 8px; }
.dp-sel { padding-inline: 10px 26px; background-position: 8px center; }
#editor .tp-sel { min-height: 50px; font-size: 1.1rem; }
