@keyframes float-updown {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-14px); }
}
@keyframes scaleBtn {
  0%   { transform: scale(1); }
  100% { transform: scale(1.04); }
}
@keyframes ldp-popup-in {
  from { transform: translateY(28px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ─── Flatsome reset ─────────────────────────────────── */
#wrapper { width: 100vw; overflow-x: hidden; }
#wrapper #main { padding: 0 !important; margin: 0 !important; }
.wp-block-html, .entry-content, .page-content { padding: 0 !important; margin: 0 !important; }

/* ════════════════════════════════════════════════════════
   DESKTOP  (> 1024px)
   Reference frame: 1728 × 980
   Scene = absolute, covers full viewport.
   All children absolutely positioned by %.
   ════════════════════════════════════════════════════════ */
.ldp-wrap {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: url("/wp-content/uploads/2026/06/img-bg-desktop.png") center / cover no-repeat;
  overflow: hidden;
}

/* Scene covers full viewport */
.ldp-scene {
  position: absolute;
  inset: 0;
  z-index: 3;
}

/* Logo: 150/1728=8.68%, 38/980=3.88% */
.ldp-logo {
  position: absolute;
  left: 8.68%;
  top: 3.88%;
  width: clamp(100px, 8.74vw, 151px);
  height: auto;
  display: block;
  border: none;
  outline: none;
  background: transparent;
}

/* Title: centered, 116/980=11.84%, 704/1728=40.74% */
.ldp-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 11.84%;
  width: clamp(280px, 40.74vw, 704px);
  height: auto;
  display: block;
  pointer-events: none;
}

/* Prizes container: covers full scene for % positioning */
.ldp-prizes {
  position: absolute;
  inset: 0;
}

/* L (iPhone): 233/1728=13.48%, 480/980=48.98%, 400/1728=23.15%, z-index above car */
.ldp-prize-l {
  position: absolute;
  left: 19%;
  top: 48.98%;
  width: clamp(150px, 23.15vw, 400px);
  height: auto;
  cursor: pointer;
  z-index: 3;
  animation: float-updown 4s ease-in-out infinite;
}
/* MID (VinFast VF9): left:32.64%, top:41.63%, 34.72% — exact left avoids animation conflict */
.ldp-prize-m {
  position: absolute;
  left: 35%;
  top: 41.63%;
  width: clamp(240px, 34.72vw, 600px);
  height: auto;
  cursor: pointer;
  z-index: 1;
  animation: float-updown 5s ease-in-out infinite;
  animation-delay: 0.4s;
}
/* R (Gold): 1095/1728=63.37%, 480/980=48.98%, z-index above car */
.ldp-prize-r {
  position: absolute;
  left: 61%;
  top: 48.98%;
  width: clamp(150px, 23.15vw, 400px);
  height: auto;
  cursor: pointer;
  z-index: 3;
  animation: float-updown 4s ease-in-out infinite;
  animation-delay: 0.7s;
}

/* Button: left:572/1728=33.10%, top:772/980=78.78%, 33.74% */
.ldp-btn-open {
  position: absolute;
  left: 35.10%;
  top: 78.78%;
  width: clamp(240px, 33.74vw, 583px);
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  z-index: 5;
  display: block;
  animation: scaleBtn 0.7s ease-in-out infinite alternate;
}
.ldp-btn-open img { width: 100%; height: auto; display: block; }
.ldp-btn-open:focus { outline: none; }

/* ════════════════════════════════════════════════════════
   POPUP  (desktop + tablet)
   ════════════════════════════════════════════════════════ */
.ldp-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.ldp-popup.ldp-open { opacity: 1; pointer-events: all; }

.ldp-popup-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
.ldp-popup-box {
  position: relative;
  z-index: 1;
  max-height: 96vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 18px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.ldp-popup-box::-webkit-scrollbar { display: none; }
.ldp-popup.ldp-open .ldp-popup-box {
  animation: ldp-popup-in 0.3s ease forwards;
}

/* Form card: 583×620 */
.ldp-form-card {
  position: relative;
  width: clamp(285px, 33.74vw, 583px);
  background: url("/wp-content/uploads/2026/06/img-form-card-bg.png") top center / 100% 100% no-repeat;
  border-radius: 18px;
  overflow: hidden;
}
.ldp-form-card::before {
  content: "";
  display: block;
  padding-top: 106.34%; /* 620/583 */
}
/* Title in card: top:5.48%, left:1.37%, w:97.26% */
.ldp-card-title {
  position: absolute;
  top: 5.48%;
  left: 1.37%;
  width: 97.26%;
  height: auto;
  z-index: 1;
  pointer-events: none;
  display: block;
}

/* Form plugin overrides */
.ldp-form-card .form-layout {
  position: absolute !important;
  inset: 0 !important;
  background: transparent !important;
  display: flex !important;
  flex-direction: column !important;
  z-index: 2;
}
.ldp-form-card .form-layout .form-header { display: none !important; }
.ldp-form-card .form-layout .form-footer { display: none !important; }
.ldp-form-card .form-layout form.form-submit {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 49.4% 10px 12px !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  z-index: 1 !important;
  overflow: visible !important;
}
.ldp-form-card .form-layout form.form-submit label { display: none !important; }
.ldp-form-card .form-layout form.form-submit .form-input-wrapper { margin: 0 !important; flex-shrink: 0; }
.ldp-form-card .form-layout form.form-submit .form-input {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  height: 48px !important;
  padding: 0 12px !important;
  background: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  position: static !important;
}
.ldp-form-card .form-layout form.form-submit .form-input::before { display: none !important; }
.ldp-form-card .form-layout form.form-submit .form-input .input-icon {
  width: 22px !important; height: 22px !important;
  flex-shrink: 0 !important; object-fit: contain !important; position: static !important;
}
.ldp-form-card .form-layout form.form-submit .form-input input {
  flex: 1 !important; border: none !important; background: transparent !important;
  outline: none !important; box-shadow: none !important;
  margin: 0 !important; padding: 0 !important; font-size: 14px !important;
  color: #333 !important; height: auto !important;
}
.ldp-form-card .form-layout form.form-submit .form-input input::placeholder { color: #6B4747 !important; opacity: 1 !important; }
.ldp-form-card .form-layout form.form-submit .form-input input:focus {
  outline: none !important; border: none !important; box-shadow: none !important; background-color: transparent !important;
}
.ldp-form-card .form-layout form.form-submit .form-input .toggle-password {
  width: 20px !important; height: 20px !important; flex-shrink: 0 !important;
  cursor: pointer !important; opacity: 0.7 !important;
  position: static !important; right: auto !important; overflow: visible !important;
}
.ldp-form-card .form-layout form.form-submit p.validate-user,
.ldp-form-card .form-layout form.form-submit p.validate-password,
.ldp-form-card .form-layout form.form-submit p.validate-phone,
.ldp-form-card .form-layout form.form-submit p.error-message {
  display: block !important; margin: 1px 0 0 !important; font-size: 11px !important;
  color: #ff4444 !important; min-height: 0 !important; line-height: 1.2 !important;
}
.ldp-form-card .form-layout form.form-submit .btn-register {
  display: block !important; margin-top: 2px !important; cursor: pointer !important;
  flex-shrink: 0; animation: scaleBtn 0.6s ease-in-out infinite alternate;
}
.ldp-form-card .form-layout form.form-submit .btn-register img.btn-register-img {
  display: block !important; width: 100% !important; max-width: 438px !important;
  height: auto !important; margin: 0 auto !important; object-fit: contain !important;
}

/* ════════════════════════════════════════════════════════
   TABLET  (769px – 1024px)
   Reference frame: 894 × 1133
   Scene uses aspect-ratio 894/1133 → all elements
   positioned by exact % from Figma.
   ════════════════════════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
  .ldp-wrap {
    background: url("/wp-content/uploads/2026/06/img-bg-desktop.png") center top / cover no-repeat;
    height: auto;
    min-height: 100vh;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Scene: aspect-ratio container matching Figma 894×1133 frame */
  .ldp-scene {
    position: relative;
    width: min(894px, 100%);
    aspect-ratio: 894 / 1133;
    inset: auto;
    overflow: visible;
    flex-shrink: 0;
  }

  /* ── All scene children: absolute within 894×1133 frame ── */

  /* Logo: left:371.5/894=41.56%, top:30/1133=2.65%, w:151/894=16.88% */
  .ldp-logo {
    position: absolute;
    left: 41.56%;
    top: 2.65%;
    width: 16.88%;
    height: auto;
    display: block;
  }

  /* Title: left:95/894=10.63%, top:126/1133=11.12%, w:704/894=78.75% */
  .ldp-title {
    position: absolute;
    left: 10.63%;
    top: 11.12%;
    width: 78.75%;
    transform: none;
    display: block;
  }

  /* Prizes container: covers full scene */
  .ldp-prizes {
    position: absolute;
    inset: 0;
  }

  /* L (iPhone): left:24/894=2.68%, top:589/1133=51.99%, w:350/894=39.15% */
  .ldp-prize-l {
    position: absolute;
    left: 2.68%;
    top: 52.99%;
    width: 39.15%;
    z-index: 3;
    animation-delay: 0s;
  }
  /* MID (Car): left:147/894=16.44%, top:424/1133=37.42%, w:600/894=67.11% */
  .ldp-prize-m {
    position: absolute;
    left: 16.44%;
    top: 37.42%;
    width: 67.11%;
    z-index: 1;
    animation-delay: 0.4s;
  }
  /* R (Gold): left:520/894=58.17%, top:589/1133=51.99%, w:350/894=39.15% */
  .ldp-prize-r {
    position: absolute;
    right: auto;
    left: 58.17%;
    top: 52.99%;
    width: 39.15%;
    z-index: 3;
    animation-delay: 0.7s;
  }

  /* Button: left:214/894=23.91%, top:852/1133=75.2%, w:466/894=52.17% */
  .ldp-btn-open {
    position: absolute;
    left: 23.91%;
    top: 85.2%;
    width: 52.17%;
    margin: 0;
    animation: scaleBtn 0.7s ease-in-out infinite alternate;
  }

  /* Popup card: tablet 470×500 */
  .ldp-form-card {
    width: min(470px, 88vw);
  }
  .ldp-form-card::before { padding-top: 106.38%; /* 500/470 */ }
  .ldp-popup-box, .ldp-form-card { border-radius: 16px; }
}

/* ════════════════════════════════════════════════════════
   MOBILE  (≤ 768px)
   Reference: 393 × 920
   Form is INLINE below prizes (not popup)
   ════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .ldp-wrap {
    background: url("/wp-content/uploads/2026/06/img-bg-mobile.png") center top / cover no-repeat;
    height: auto;
    min-height: 100svh;
    overflow: visible;
    display: block;
  }

  /* Scene: flex column for mobile layout */
  .ldp-scene {
    position: static;
    inset: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0 16px;
    aspect-ratio: auto;
  }

  /* Logo: 85px, centered, top:20px */
  .ldp-logo {
    position: static;
    display: block;
    width: 85px;
    margin: 20px auto 0;
    left: auto; top: auto;
  }

  /* Title: 91.86% = 361/393 */
  .ldp-title {
    position: static;
    transform: none;
    width: 91.86%;
    margin: 8px 0 0;
    display: block;
    left: auto; top: auto;
  }

  /* Prizes: relative container, height=175px */
  .ldp-prizes {
    position: relative;
    inset: auto;
    width: 91.86%;
    height: 175px;
    margin-top: 6px;
    flex-shrink: 0;
  }
  /* L: z-index above car */
  .ldp-prize-l {
    position: absolute;
    left: -5%; 
    top: 60%;
    bottom: 0;
    width: 41.3%;
    z-index: 3;
    animation-delay: 0s;
  }
  /* MID: centered — (100%-70.9%)/2=14.55% */
  .ldp-prize-m {
    position: absolute;
    left: 14.55%; 
    top: 20%; 
    bottom: 0;
    width: 70.9%;
    z-index: 1;
    animation-delay: 0.4s;
  }
  /* R: z-index above car */
  .ldp-prize-r {
    position: absolute;
    right: 0; 
    left: 65%; 
    top: 60%;
    bottom: 0;
    width: 41.3%;
    z-index: 3;
    animation-delay: 0.7s;
  }

  /* Hide popup trigger on mobile */
  .ldp-btn-open { display: none !important; }

  /* ── Popup → always-visible inline form on mobile ── */
  .ldp-popup {
    position: static !important;
    inset: auto !important;
    opacity: 1 !important;
    pointer-events: all !important;
    display: block !important;
    width: 100%;
    z-index: auto !important;
    transition: none !important;
  }
  .ldp-popup-bg { display: none !important; }
  .ldp-popup-box {
    width: 100%;
    border-radius: 0;
    max-height: none;
    overflow: visible;
    animation: none !important;
    margin-top: 17%;
  }

  /* Form card: no bg image, inputs direct */
  .ldp-form-card {
    width: 82.19%; /* 323/393 */
    margin: 12px auto 30px;
    background: none !important;
    border-radius: 0;
    overflow: visible;
  }
  .ldp-form-card::before { display: none !important; }
  .ldp-card-title { display: none !important; }

  .ldp-form-card .form-layout {
    position: static !important;
    inset: auto !important;
    background: transparent !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .ldp-form-card .form-layout form.form-submit {
    padding: 0 0 10px !important;
    gap: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    overflow: visible !important;
  }
  .ldp-form-card .form-layout form.form-submit .form-input {
    height: 44px !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(4px);
  }
  .ldp-form-card .form-layout form.form-submit .form-input input { font-size: 13px !important; }
  .ldp-form-card .form-layout form.form-submit .btn-register img.btn-register-img { max-width: 323px !important; margin-top: 5px !important; }
}

/* ════════════════════════════════════════════════════════
   SMALL MOBILE  (≤ 480px)
   ════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .ldp-scene { padding: 0 12px; }
  .ldp-prizes { height: 148px; }
  .ldp-form-card .form-layout form.form-submit { gap: 5px !important; }
  .ldp-form-card .form-layout form.form-submit .form-input { height: 40px !important; }
  .ldp-form-card .form-layout form.form-submit .form-input input { font-size: 12px !important; }
  .ldp-form-card .form-layout form.form-submit .btn-register img.btn-register-img { max-width: 300px !important; }
}
