/* ============================================================
   CFL SCRATCH & WIN — Full stylesheet
   Save at: /wp-content/plugins/cfl-scratch-win/assets/css/cfl-scratch.css
   Requires intlTelInput.css (v19.5.6) to be loaded BEFORE this file.
   ============================================================ */

/* ============ FORCE TITLE OVERRIDES ============ */
#termsText{
  font-size: 12px !important;
}
.iti__flag{
  background-size:auto !important;
}
body .hero-section h1.hero-title,
body .hero-section h1.hero-title span,
body h1.hero-title,
body h1.hero-title span {
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 300 !important;
  font-size: 67px !important;
  line-height: 1.2 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  color: #333 !important;
  margin: 0 !important;
  padding: 0 !important;
  text-shadow: none !important;
}

body .hero-section h1.hero-title span,
body h1.hero-title span {
  color: rgb(187, 137, 60) !important;
  font-weight: 300 !important;
}

body .hero-section .hero-subtext,
body .hero-subtext {
  font-family: 'Montserrat', sans-serif !important;
  font-size: 26px !important;
  font-weight: 600 !important;
  color: rgb(102, 102, 102) !important;
  margin-top: 15px !important;
}

@media screen and (max-width: 767px) {
  body .hero-section h1.hero-title,
  body .hero-section h1.hero-title span,
  body h1.hero-title,
  body h1.hero-title span {
    font-size: 42px !important;
  }
  body .hero-section .hero-subtext,
  body .hero-subtext {
    font-size: 16px !important;
  }
}

/* ---------- Global ---------- */
html {
  overflow-x: hidden;
}

/* ---------- Hero section ---------- */
.hero-section {
  padding: 80px 20px;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
}

.hero-title {
  position: relative;
  font-size: 67px;
  font-weight: 300;
  color: #333;
  line-height: 1.2;
  overflow: hidden;
  font-family: 'Montserrat', sans-serif;
}

.hero-title span {
  color: rgb(187, 137, 60);
  font-weight: 300;
  position: relative;
}

/* Moving shine on the title */
.hero-title::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -35%;
  width: 22%;
  height: 160%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.15) 30%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(255, 255, 255, 0.15) 70%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  filter: blur(6px);
  animation: titleShine 4s ease-in-out infinite;
}

@keyframes titleShine {
  0%   { left: -35%; opacity: 0; }
  8%   { opacity: 1; }
  45%  { opacity: 1; }
  100% { left: 130%; opacity: 0; }
}

.hero-subtext {
  margin-top: 15px;
  font-size: 26px;
  font-weight: 600;
  color: rgb(102, 102, 102);
  font-family: 'Montserrat', sans-serif;
}

/* ---------- Card wrapper ---------- */
.card-scale-wrap {
  transform: none;
  transform-origin: top center;
  margin-bottom: 0;
}

/* ---------- Card image + flip animation ---------- */
.card-image {
  margin: 40px auto 15px;
  max-width: 600px;
  width: 100%;
  position: relative;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.card-image img {
  height: auto;
  width: 100%;
  display: block;
  border-radius: 20px;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.25);
  object-fit: cover;
}

.card-image.flip-out {
  animation: flipFormCard 0.8s ease-in-out forwards;
}

.card-after.flip-in {
  animation: flipScratchCard 0.8s ease-in-out forwards;
}

@keyframes flipFormCard {
  0%   { transform: rotateY(0deg);    opacity: 1; }
  50%  { transform: rotateY(90deg);   opacity: 0.3; }
  100% { transform: rotateY(180deg);  opacity: 0; }
}

@keyframes flipScratchCard {
  0%   { transform: rotateY(-180deg); opacity: 0; }
  50%  { transform: rotateY(-90deg);  opacity: 0.4; }
  100% { transform: rotateY(0deg);    opacity: 1; }
}

/* ---------- Form overlay inside the card ---------- */
.form-overlay {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  width: 87%;
  text-align: center;
  z-index: 5;
}

.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.form-row input {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 12px;
  font-family: 'Montserrat', sans-serif;
  color: #000;
  background: #fff;
  box-sizing: border-box;
}

.form-overlay input {
  width: 100%;
}

.form-overlay input::placeholder {
  color: #999;
}

.phone-error {
  color: #ff4444;
  font-size: 11px;
  text-align: left;
  margin-top: 5px;
  display: none;
  font-family: 'Montserrat', sans-serif;
}

/* ---------- intl-tel-input (phone field) ---------- */
/* Flags, sprite positions and input padding come from intlTelInput.css */
.iti {
  width: 100%;
  display: block;
  position: relative;
}

.iti--allow-dropdown {
  width: 100%;
}

.iti input,
.iti input[type="tel"],
.iti input[type="text"] {
  width: 100%;
  padding-right: 8px;
  font-size: 12px;
  font-family: 'Montserrat', sans-serif;
  color: #000;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  height: 42px;
  box-sizing: border-box;
}

.iti__selected-flag {
  background: transparent !important;
  border: none;
  box-shadow: none;
}

/* The +971 next to the flag */
.iti__selected-dial-code {
  color: #666;
  font-size: 12px;
  font-family: 'Montserrat', sans-serif;
  margin-left: 4px;
}

/* Dial codes inside the dropdown list */
.iti__dial-code {
  color: #666;
  font-size: 12px;
  font-family: 'Montserrat', sans-serif;
}

/* Country dropdown list */
.iti__country-list {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  max-height: 220px;
  z-index: 9999;
  font-family: 'Montserrat', sans-serif;
  text-align: left;
}

.iti__country {
  padding: 6px 10px;
  font-size: 12px;
  font-family: 'Montserrat', sans-serif;
  color: #333;
  line-height: 1.4;
}

.iti__country.iti__highlight {
  background: #f3f3f3;
}

.iti__country-name {
  color: #333;
  font-size: 12px;
  font-family: 'Montserrat', sans-serif;
}

/* Custom search box injected by JS */
.iti__search-box {
  padding: 6px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

.iti__search-box input {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  font-family: 'Montserrat', sans-serif;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

/* ---------- reCAPTCHA ---------- */
#leadForm .form-row iframe[src*="recaptcha"] {
  transform: scale(0.85);
  transform-origin: top left;
  width: 304px;
  height: 78px;
}

.g-recaptcha {
  height: 65px !important;
}

/* ---------- Buttons ---------- */
.hero-btn {
  width: 30%;
  background: linear-gradient(90deg, #c8923c, #e0a94d);
  border: none;
  color: #fff;
  font-size: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  padding: 6px;
  font-family: 'Montserrat', sans-serif;
}

.hero-btn-2 {
  padding: 12px;
  width: 60%;
  background: linear-gradient(90deg, #c8923c, #e0a94d);
  border: none;
  color: #fff;
  font-size: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 20px;
  text-decoration: none;
  display: none;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
}

.hero-btn:hover,
.hero-btn-2:hover {
  background: #000 !important;
  color: #fff !important;
}

/* ---------- Scratch card section ---------- */
.card-after {
  margin-top: 20px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: visible;
}

#js--sc--container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 20px;
  line-height: 0;
  background: transparent;
}

#js--sc--container canvas {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 20px;
}

#js--sc--container img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
}

.claim-btn {
  width: 340px;
}

/* ---------- Corner light (bonus decoration) ---------- */
.corner-light {
  position: absolute;
  top: -140px;
  width: 420px;
  height: 520px;
  pointer-events: none;
  opacity: 0;
  z-index: 999;
  background: radial-gradient(
    ellipse at top,
    rgba(255, 190, 80, 0.95) 0%,
    rgba(255, 210, 120, 0.55) 30%,
    rgba(255, 210, 120, 0.18) 58%,
    rgba(255, 210, 120, 0) 75%
  );
  filter: blur(6px);
  mix-blend-mode: multiply;
}

.corner-light-left {
  left: 26%;
  transform: rotate(35deg);
}

.corner-light-right {
  right: 26%;
  transform: rotate(-35deg);
}

.card-after.light-focus .corner-light {
  animation: showCornerLight 3s ease-out forwards;
}

@keyframes showCornerLight {
  0%   { opacity: 0; transform: translateY(-30px) scale(0.85); }
  30%  { opacity: 1; }
  100% { opacity: 0.9; }
}

/* ---------- Fireworks ---------- */
.scratch-celebration {
  pointer-events: none;
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 999999;
  display: none;
}

.scratch-celebration.active {
  display: block;
}

.firework-rocket {
  position: absolute;
  bottom: -20px;
  width: 4px;
  height: 22px;
  border-radius: 10px;
  background: #f8c238;
  box-shadow: 0 0 12px #f8c238;
  animation: rocketLaunch 0.9s ease-out forwards;
}

.firework-burst {
  position: absolute;
  width: 6px;
  height: 6px;
}

.spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--spark-color);
  box-shadow: 0 0 12px var(--spark-color);
  animation: sparkBurst 1.2s ease-out forwards;
}

@keyframes rocketLaunch {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(var(--rocket-rise)); }
}

@keyframes sparkBurst {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(0.15); }
}

/* ============ Retina: scale the @2x flag sprite correctly ============ */
@media (min-resolution: 2x), (-webkit-min-device-pixel-ratio: 2) {
  .iti .iti__flag {
    background-size: 5652px 15px !important;
  }
}

/* ============================================================
   DESKTOP (768px and up) - card sizing and spacing
   Card width: 520px. Keep in sync with maxDesktopWidth in the JS.
   ============================================================ */
@media screen and (min-width: 768px) {
  .hero-section .card-scale-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 25px;
    margin-bottom: 0 !important;
    transform: none !important;
  }

  /* Form card */
  .hero-section .card-image {
    width: 100%;
    max-width: 520px !important;
    margin: 0 auto;
    transform-style: preserve-3d;
  }

  .hero-section .card-image img {
    width: 100%;
    height: auto;
    display: block;
  }

  /* Scratch card size is set exactly by the JS (maxDesktopWidth).
     Do not set width/max-width here or the scratch position breaks. */
  .hero-section #js--sc--container canvas,
  .hero-section #js--sc--container img {
    max-width: none !important;
  }

  .hero-section #formSentence {
    margin-bottom: 20px;
  }

  /* Keep the scratch section in normal flow below the title */
  .hero-section #cardSection {
    position: relative !important;
    top: auto !important;
    transform: none !important;
    margin-top: 30px !important;
    flex-direction: column;
    align-items: center;
  }

  .hero-section #cardSection > p,
  .hero-section #cardSection > h2,
  .hero-section #cardSection > h3,
  .hero-section #cardSection > div:not(#js--sc--container):not(.corner-light) {
    position: static !important;
    transform: none !important;
    margin: 0 0 20px !important;
  }

  /* Slightly bigger form text for the larger card */
  .hero-section .form-row input,
  .hero-section .iti input {
    font-size: 13px;
  }

  .hero-section .hero-btn {
    font-size: 13px;
    padding: 10px;
  }
}

/* ============================================================
   MOBILE (767px and below)
   ============================================================ */
@media screen and (max-width: 767px) {

  .container {
    padding-right: 5px !important;
    padding-left: 5px !important;
  }

  .hero-section {
    padding: 40px 10px;
  }

  .hero-title {
    font-size: 42px;
  }

  .hero-subtext {
    font-size: 16px;
  }

  .hero-section .card-scale-wrap {
    width: 100%;
    margin-top: 20px;
    margin-bottom: 0;
    transform: none !important;
  }

  .hero-section .card-image {
    max-width: 100% !important;
    margin: 0 auto;
  }

  .form-overlay {
    width: 87%;
    top: 52%;
  }

  .form-row {
    gap: 8px;
  }

  .form-overlay input {
    font-size: 11px;
    padding: 6px;
  }

  /* Phone field on mobile */
  .iti input,
  #mobile {
    font-size: 11px;
    height: 28px;
  }

  .iti__flag{
    background-size:auto !important;
  }

  .iti__selected-dial-code,
  .iti__dial-code {
    font-size: 11px;
  }

  #js--sc--container {
    width: 100%;
    max-width: 100%;
  }

  .card-image img {
    height: auto !important;
    min-height: 240px;
  }

  .claim-btn {
    width: 190px;
  }

  .hero-btn {
    width: 40%;
    font-size: 11px;
  }

  .hero-btn-2 {
    width: 85%;
    font-size: 11px;
  }

  #leadForm .form-row iframe[src*="recaptcha"] {
    transform: scale(0.6);
  }

  .g-recaptcha {
    height: 46px !important;
  }
}

/* Desktop: keep the form fields inside the card frame */
@media screen and (min-width: 768px) {
  .hero-section .form-overlay {
    width: 84%;
    top: 50%;
  }

  .hero-section .form-row {
    margin-bottom: 7px;
  }

  .hero-section .form-row input,
  .hero-section .iti input {
    height: 38px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .hero-section #leadForm .form-row iframe[src*="recaptcha"] {
    transform: scale(0.8);
  }

  .hero-section .g-recaptcha {
    height: 62px !important;
  }

  .hero-section .hero-btn {
    padding: 8px;
  }
}