/* =============================================================================
   THEME TOKENS — بدل الألوان هنا
   ========================================================================== */
:root {
  --night:      #191243;   /* page background — deep Moroccan night */
  --night-2:    #241a5e;   /* gradient partner */
  --cream:      #f8f0dc;   /* the card */
  --ink:        #2c2350;   /* text on cream */
  --gold:       #d3a84c;   /* zellige gold — frames, accents */
  --gold-soft:  #e9d6a3;
  --rose:       #e8657f;   /* the "yes" color */
  --rose-deep:  #c94a66;
  --teal:       #2e8f84;   /* zellige teal — secondary accent */
  --radius: 22px;
  --font-display: 'Lalezar', 'Tajawal', sans-serif;
  --font-body: 'Tajawal', sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    /* faint zellige eight-point stars */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23d3a84c' stroke-opacity='0.10' stroke-width='1.5'%3E%3Crect x='24' y='24' width='48' height='48'/%3E%3Crect x='24' y='24' width='48' height='48' transform='rotate(45 48 48)'/%3E%3Ccircle cx='48' cy='48' r='6'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(1200px 800px at 50% -10%, var(--night-2), var(--night) 70%);
  background-attachment: fixed;
}

/* =============================================================================
   LAYOUT
   ========================================================================== */
.stage {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--cream);
  border-radius: var(--radius);
  border: 1px solid rgba(211, 168, 76, .55);
  box-shadow:
    0 0 0 6px rgba(211, 168, 76, .12),
    0 24px 60px rgba(0, 0, 0, .45);
  padding: 30px 24px 34px;
  overflow: visible;
}

.screen { display: none; animation: screen-in .45s ease both; }
.screen.is-active { display: block; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* =============================================================================
   TYPE
   ========================================================================== */
.eyebrow {
  margin: 0 0 4px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--teal);
}

.headline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 8vw, 2.7rem);
  line-height: 1.15;
  margin: 0 0 6px;
  color: var(--ink);
}

.headline-sm { font-size: clamp(1.5rem, 6vw, 1.9rem); }

.sub { margin: 0 0 22px; font-size: 1.05rem; color: #5a4f85; }

/* =============================================================================
   SCREEN 1 — the question
   ========================================================================== */
.arch { position: relative; text-align: center; padding: 44px 12px 8px; }

.arch-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.answers {
  position: relative;
  min-height: 130px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.1rem;
  border: none;
  border-radius: 999px;
  padding: 14px 34px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}

.btn-yes {
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  box-shadow: 0 8px 20px rgba(201, 74, 102, .35);
}
.btn-yes:hover { transform: translateY(-2px) scale(1.03); }
.btn-yes:active { transform: scale(.97); }

.btn-no {
  color: var(--ink);
  background: transparent;
  border: 2px dashed rgba(44, 35, 80, .35);
  padding: 12px 30px;
}
#btn-no { position: relative; transition: left .18s ease, top .18s ease; }
#btn-no.dodging { position: absolute; z-index: 40; margin: 0; }

.btn-wide { display: block; width: 100%; margin-top: 6px; }

.btn:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

.tease {
  min-height: 1.6em;
  margin: 16px 0 0;
  text-align: center;
  font-weight: 700;
  color: var(--rose-deep);
  animation: tease-pop .25s ease;
}
@keyframes tease-pop {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.dodge-counter {
  display: inline-block;
  margin: 10px auto 0;
  padding: 5px 14px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--rose-deep);
  background: rgba(232, 101, 127, .12);
  border: 1px solid rgba(232, 101, 127, .35);
  border-radius: 999px;
  animation: dodge-pop .25s ease;
}
@keyframes dodge-pop {
  from { transform: scale(.8); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* the peeking bogeyman */
.bogeyman {
  position: absolute;
  top: -8px;
  inset-inline-start: -26px;
  transform: rotate(-10deg) translateY(30px);
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
  z-index: 30;
}
.bogeyman.show {
  opacity: 1;
  transform: rotate(-10deg) translateY(0);
  animation: bogey-bob 1.6s ease-in-out infinite;
}
@keyframes bogey-bob {
  0%, 100% { transform: rotate(-10deg) translateY(0); }
  50%      { transform: rotate(-7deg) translateY(-8px); }
}
.bogey-hand { transform-origin: 20px 88px; animation: wave 1s ease-in-out infinite; }
@keyframes wave {
  0%, 100% { transform: rotate(0); }
  50%      { transform: rotate(-24deg); }
}

/* =============================================================================
   FX LAYER — bugs, flowers, confetti
   ========================================================================== */
#fx-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 20;
}

.bug {
  position: absolute;
  font-size: 30px;
  animation: bug-crawl 4s linear forwards;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.35));
}
@keyframes bug-crawl {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: 1; }
  50%  { transform: translate(var(--dx), var(--dy)) rotate(20deg); }
  100% { transform: translate(calc(var(--dx) * 2), calc(var(--dy) * 2)) rotate(-15deg); opacity: 1; }
}
.bug.squish { animation: bug-squish .5s ease forwards; }
@keyframes bug-squish {
  to { transform: scale(0) rotate(180deg); opacity: 0; }
}

.bloom {
  position: absolute;
  font-size: 26px;
  animation: bloom-float 2.8s ease-out forwards;
}
@keyframes bloom-float {
  0%   { transform: translateY(0) scale(.4) rotate(0); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translateY(-46vh) scale(1.15) rotate(var(--spin)); opacity: 0; }
}

.confetti {
  position: absolute;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  animation: confetti-fall 2.6s ease-in forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-10vh) rotate(0); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: .8; }
}

/* =============================================================================
   SCREEN 2 — places
   ========================================================================== */
.places { display: grid; gap: 12px; margin-bottom: 14px; }

.place { display: block; cursor: pointer; }
.place input[type="radio"] { position: absolute; opacity: 0; }

.place-body {
  display: block;
  background: #fffaf0;
  border: 2px solid rgba(211, 168, 76, .4);
  border-radius: 16px;
  padding: 14px 16px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.place:hover .place-body { transform: translateY(-2px); }
.place input:checked + .place-body {
  border-color: var(--rose);
  box-shadow: 0 6px 18px rgba(201, 74, 102, .22);
  background: #fff4f0;
}
.place input:focus-visible + .place-body {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.place-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.place-emoji { font-size: 1.5rem; }
.place-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ink);
}
.place-vibe { display: block; font-size: .95rem; color: #5a4f85; line-height: 1.5; }
.place-map {
  display: inline-block;
  margin-top: 8px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px dashed var(--teal);
}

.other-input {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1.5px solid rgba(44, 35, 80, .25);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.other-input:focus { outline: 2px solid var(--teal); }

/* =============================================================================
   SCREEN 3 — day & time
   ========================================================================== */
.when { display: grid; gap: 14px; margin-bottom: 16px; }

.field { display: block; }
.field-label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}
.field input {
  width: 100%;
  padding: 13px 14px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--ink);
  background: #fffaf0;
  border: 2px solid rgba(211, 168, 76, .4);
  border-radius: 12px;
}
.field input:focus { outline: 3px solid var(--teal); outline-offset: 1px; }

/* =============================================================================
   SCREEN 4 — confirm + done
   ========================================================================== */
.summary {
  margin: 0 0 18px;
  border: 2px solid rgba(211, 168, 76, .4);
  border-radius: 16px;
  overflow: hidden;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #fffaf0;
}
.summary-row + .summary-row { border-top: 1px dashed rgba(211, 168, 76, .5); }
.summary dt { font-weight: 700; color: #5a4f85; }
.summary dd { margin: 0; font-weight: 700; color: var(--ink); text-align: left; }

.form-error {
  min-height: 1.4em;
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--rose-deep);
  text-align: center;
}

#done-view { text-align: center; padding: 20px 0 8px; }
.done-mark { font-size: 3.4rem; animation: done-pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes done-pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.wa-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}
.btn-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #25D366, #128C7E);
  box-shadow: 0 8px 20px rgba(18, 140, 126, .35);
}
.btn-wa:hover { transform: translateY(-2px); }
.btn-wa:active { transform: scale(.97); }

/* =============================================================================
   RESPONSIVE + MOTION PREFERENCES
   ========================================================================== */
@media (min-width: 700px) {
  .card { max-width: 520px; padding: 38px 36px 42px; }
}

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