:root {
  --modal-overlay: rgba(0, 0, 0, 0.4);
  --modal-stroke: #5b2206;
  --modal-title-from: #ffda59;
  --modal-title-to: #e6a200;
  --modal-cta-text: #fff;
  --modal-cta-stroke: rgba(0, 85, 7, 0.46);
  --modal-timer-color: rgba(153, 73, 48, 1);
  --font-sans: Arial, sans-serif;

  --text-title: 3rem;
  --text-subtitle: 1.2rem;
  --text-timer: 1.5rem;
  --text-cta: 2rem;
}

.success-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.success-modal-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95vw;
  max-width: 900px;
  aspect-ratio: 1323 / 730;
  max-height: 90vh;
  height: auto;
}

.success-modal-content {
  width: 100%;
  border: 25px solid transparent;
  border-image: url(/assets/preregister/img/popup/bg.png) 0 fill;
  box-sizing: border-box;
  z-index: 1000;
  padding: 9% 10% 7% 31%;
  aspect-ratio: 1323 / 730;
  height: auto;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 5px;
  right: 3%;
  width: 80px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.close-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.countdown {
  position: absolute;
  height: 130px;
  width: 370px;
  max-width: 85vw;
  left: 50%;
  transform: translateX(-50%);
  top: -10px;
  aspect-ratio: 605 / 238;
  border: 25px solid transparent;
  border-image: url(/assets/preregister/img/popup/retangulo.png) 0 fill;
  box-sizing: border-box;
  z-index: -9;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding-bottom: 22px;
}

.countdown > * + * {
  margin-left: 20px;
}

.countdown img {
  width: 35px;
  object-fit: contain;
  object-position: center;
}

.countdown_timer {
  font-size: var(--text-timer);
  font-weight: 900;
  color: var(--modal-timer-color);
  text-align: center;
}

/* Sem timer regressivo: data já passou ou indisponível (vê preregister.blade) */
.countdown--live {
  z-index: 0;
}
.countdown_timer--live {
  max-width: 14rem;
  width: 100%;
  line-height: 1.2;
  font-size: 1.1rem;
  color: #1a5c1a;
  overflow-wrap: break-word;
  word-break: break-word;
}

.success-modal-content h1 {
  font-family: var(--font-sans);
  font-size: var(--text-title);
  font-weight: 900;
  text-align: center;
  background: linear-gradient(var(--modal-title-from), var(--modal-title-to));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 1px 0 var(--modal-stroke),
    0 -1px 0 var(--modal-stroke),
    1px 0 0 var(--modal-stroke),
    -1px 0 0 var(--modal-stroke),
    1px 1px 0 var(--modal-stroke),
    -1px 1px 0 var(--modal-stroke);
  margin-bottom: 20px;
}

.success-modal-content p {
  font-family: var(--font-sans);
  font-size: var(--text-subtitle);
  font-weight: 400;
  color: var(--modal-stroke);
  text-align: center;
}

.success-modal-content p strong {
  font-weight: 900;
}

.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  max-width: 312px;
  aspect-ratio: 433 / 132;

  background-image: url(/assets/preregister/img/popup/whatsapp-btn.png);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  margin: 20px auto 0;
}

.btn-whatsapp > * + * {
  margin-left: 10px;
}

.btn-whatsapp img {
  width: 70px;
  object-fit: contain;
  object-position: center;
}

.btn-whatsapp span {
  font-family: var(--font-sans);
  font-size: var(--text-cta);
  font-weight: 900;
  color: var(--modal-cta-text);
  text-shadow:
    0 1px 0 var(--modal-cta-stroke),
    0 -1px 0 var(--modal-cta-stroke),
    1px 0 0 var(--modal-cta-stroke),
    -1px 0 0 var(--modal-cta-stroke),
    1px 1px 0 var(--modal-cta-stroke),
    -1px 1px 0 var(--modal-cta-stroke);
}

@media (max-width: 800px) {
  :root {
    --text-title: 2.2rem;
    --text-subtitle: 1rem;
    --text-timer: 1.15rem;
    --text-cta: 1.4rem;
  }

  .success-modal-content {
    padding: 8% 5% 6% 22%;
  }

  .close-btn {
    width: 60px;
  }

  .countdown {
    height: 100px;
    width: 250px;
  }

  .countdown > * + * {
    margin-left: 12px;
  }

  .countdown img {
    width: 26px;
  }

  .countdown_timer--live {
    font-size: 0.95rem;
  }

  .success-modal-content h1 {
    margin-bottom: 10px;
  }

  .btn-whatsapp {
    margin-top: 12px;
    max-width: 60%;
  }

  .btn-whatsapp > * + * {
    margin-left: 7px;
  }

  .btn-whatsapp img {
    width: 42px;
  }
}

/* <= 768 */
@media (max-width: 768px) {
  .success-modal-content {
    padding: 7% 11% 5% 33%;
  }
}

/* <= 640 */
@media (max-width: 640px) {
  :root {
    --text-title: 1.6rem;
    --text-subtitle: 0.9rem;
    --text-timer: 0.95rem;
    --text-cta: 1.1rem;
  }

  .success-modal-content h1 {
    margin-bottom: 0;
  }

  .countdown {
    min-width: 200px;
    width: 220px;
    height: 100px;
    padding-bottom: 20px !important;
    /* align-items: flex-end; */
  }
}

/* <= 480 */
@media (max-width: 480px) {
  :root {
    --text-title: 1.4rem;
    --text-subtitle: 0.85rem;
    --text-timer: 0.9rem;
    --text-cta: 1rem;
  }

  .close-btn {
    top: 0;
    right: 0;
    width: 40px;
  }

  .btn-whatsapp span {
    font-size: calc(var(--text-cta) - 5px);
  }
  
  .success-modal-content {
    padding: 8% 10% 3% 32%;
  }

  .success-modal-content h1 {
    text-shadow:
      0 1px 0 var(--modal-stroke),
      0 -1px 0 var(--modal-stroke),
      1px 0 0 var(--modal-stroke),
      -1px 0 0 var(--modal-stroke);
  }
}

@supports not (aspect-ratio: 1 / 1) {
  .success-modal-container {
    height: 496px;
  }

  .success-modal-content {
    min-height: 496px;
  }

  .countdown {
    min-height: 90px;
  }

  .btn-whatsapp {
    min-height: 78px;
  }
}
