/* =========================================================
   BODY STATE
========================================================= */

body.funnel-modal-open {
  overflow: hidden;
  touch-action: none;
}

/* =========================================================
   MODAL
========================================================= */

.funnel-form-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;

  display: none;
  align-items: flex-start;
  justify-content: center;

  box-sizing: border-box;
  padding: clamp(28px, 6vh, 64px) 24px;

  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;

  scrollbar-gutter: stable;
}

.funnel-form-modal.active {
  display: flex;
}

.funnel-form-modal::-webkit-scrollbar {
  width: 10px;
}

.funnel-form-modal::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

.funnel-form-modal::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(77, 184, 255, 0.35);
  background-clip: padding-box;
}

.funnel-form-modal::-webkit-scrollbar-thumb:hover {
  background: rgba(77, 184, 255, 0.55);
  background-clip: padding-box;
}

/* =========================================================
   OVERLAY
========================================================= */

.funnel-form-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;

  background: rgba(0, 0, 0, 0.76);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* =========================================================
   POPUP BOX
========================================================= */

.funnel-form-box {
  position: relative;
  z-index: 2;

  width: 100%;
  max-width: 620px;

  box-sizing: border-box;

  margin: 0 auto;

  padding: 54px 42px 42px;

  border: 1px solid rgba(77, 184, 255, 0.3);
  border-radius: 28px;

  background:
    radial-gradient(circle at top, rgba(77, 184, 255, 0.08), transparent 40%),
    linear-gradient(145deg, rgba(18, 28, 43, 0.98), rgba(5, 10, 18, 0.98));

  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02),
    0 0 45px rgba(77, 184, 255, 0.18),
    0 25px 90px rgba(0, 0, 0, 0.6);

  animation: funnelFormPop 0.35s ease;
}

/* =========================================================
   CLOSE BUTTON
========================================================= */

.funnel-form-close {
  position: absolute;
  z-index: 10;

  top: 16px;
  right: 16px;

  width: 42px;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.07);

  color: rgba(255, 255, 255, 0.8);

  font-family: Arial, sans-serif;
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;

  cursor: pointer;

  transition:
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease;
}

.funnel-form-close:hover {
  background: rgba(77, 184, 255, 0.16);

  border-color: rgba(77, 184, 255, 0.25);

  color: #ffffff;

  transform: rotate(90deg);
}

.funnel-form-close:focus-visible {
  outline: 2px solid #4db8ff;
  outline-offset: 3px;
}

/* =========================================================
   HEADLINE
========================================================= */

.funnel-form-box h2 {
  max-width: 520px;

  margin: 0 auto 14px;

  padding: 0 35px;

  color: #ffffff;

  font-family: "Acme", sans-serif;

  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 400;

  line-height: 1.08;

  text-align: center;
}

/* =========================================================
   DESCRIPTION
========================================================= */

.funnel-form-box p {
  max-width: 500px;

  margin: 0 auto 30px;

  color: rgba(255, 255, 255, 0.72);

  font-size: 1rem;
  line-height: 1.65;

  text-align: center;
}

/* =========================================================
   FORM
========================================================= */

.funnel-form {
  display: grid;

  width: 100%;

  gap: 16px;
}

.funnel-form-row {
  display: grid;

  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);

  gap: 16px;
}

/* =========================================================
   INPUTS
========================================================= */

.funnel-form input {
  width: 100%;
  min-width: 0;

  box-sizing: border-box;

  padding: 17px 18px;

  border: 1px solid rgba(77, 184, 255, 0.22);
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.065);

  color: #ffffff;

  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;

  outline: none;

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);

  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.funnel-form input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.funnel-form input:hover {
  border-color: rgba(77, 184, 255, 0.38);

  background: rgba(255, 255, 255, 0.08);
}

.funnel-form input:focus {
  border-color: rgba(77, 184, 255, 0.8);

  background: rgba(255, 255, 255, 0.1);

  box-shadow:
    0 0 0 4px rgba(77, 184, 255, 0.11),
    0 0 22px rgba(77, 184, 255, 0.08);
}

/* Prevent browser autofill from destroying dark styling */

.funnel-form input:-webkit-autofill,
.funnel-form input:-webkit-autofill:hover,
.funnel-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff;

  -webkit-box-shadow: 0 0 0 1000px #121b29 inset;

  transition: background-color 9999s ease-in-out 0s;
}

/* =========================================================
   SUBMIT BUTTON
========================================================= */

.funnel-form-submit {
  width: 100%;

  box-sizing: border-box;

  margin-top: 6px;

  padding: 18px 26px;

  border: 1px solid rgba(140, 230, 255, 0.35);
  border-radius: 999px;

  background: linear-gradient(135deg, #4db8ff, #8ce6ff);

  color: #03101c;

  font-family: "Acme", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;

  letter-spacing: 0.3px;

  cursor: pointer;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 0 28px rgba(77, 184, 255, 0.3),
    0 12px 35px rgba(0, 0, 0, 0.35);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    filter 0.25s ease;
}

.funnel-form-submit:hover {
  transform: translateY(-3px);

  filter: brightness(1.05);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 42px rgba(77, 184, 255, 0.5),
    0 18px 45px rgba(0, 0, 0, 0.45);
}

.funnel-form-submit:active {
  transform: translateY(-1px);
}

.funnel-form-submit:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

/* =========================================================
   BUTTON THAT OPENS POPUP
========================================================= */

.funnel-form-button {
  position: relative;

  display: flex;

  width: fit-content;

  box-sizing: border-box;

  align-items: center;
  justify-content: center;

  /*
   * DESKTOP:
   * Left aligned.
   */
  margin: 25px auto 20px 0;

  padding: 18px 36px;

  border: 1px solid rgba(77, 184, 255, 0.55);
  border-radius: 999px;

  background: linear-gradient(
    145deg,
    rgba(13, 19, 28, 0.96),
    rgba(0, 0, 0, 0.92)
  );

  color: #ffffff;

  font-family: "Acme", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;

  line-height: 1.2;
  letter-spacing: 0.5px;

  text-align: center;
  text-decoration: none;

  cursor: pointer;

  overflow: hidden;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 16px rgba(77, 184, 255, 0.28),
    0 0 38px rgba(77, 184, 255, 0.14),
    0 12px 35px rgba(0, 0, 0, 0.35);

  transition:
    transform 0.3s ease,
    border-color 0.3s ease,
    background 0.3s ease,
    box-shadow 0.3s ease;
}

/* Glowing line */

.funnel-form-button::after {
  content: "";

  position: absolute;

  left: 50%;
  bottom: 7px;

  width: 45%;
  height: 2px;

  transform: translateX(-50%);

  border-radius: 999px;

  background: linear-gradient(90deg, transparent, #4db8ff, transparent);

  box-shadow:
    0 0 12px rgba(77, 184, 255, 0.9),
    0 0 26px rgba(77, 184, 255, 0.45);

  transition: width 0.3s ease;
}

.funnel-form-button:hover {
  color: #ffffff;

  text-decoration: none;

  transform: translateY(-3px);

  background: linear-gradient(
    145deg,
    rgba(18, 28, 43, 0.98),
    rgba(0, 0, 0, 0.96)
  );

  border-color: rgba(77, 184, 255, 0.9);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 26px rgba(77, 184, 255, 0.4),
    0 0 58px rgba(77, 184, 255, 0.2),
    0 18px 45px rgba(0, 0, 0, 0.45);
}

.funnel-form-button:hover::after {
  width: 72%;
}

.funnel-form-button:active {
  transform: translateY(-1px);
}

.funnel-form-button:focus-visible {
  outline: 2px solid #4db8ff;
  outline-offset: 4px;
}

/* =========================================================
   POPUP ANIMATION
========================================================= */

@keyframes funnelFormPop {
  from {
    opacity: 0;

    transform: translateY(25px) scale(0.96);
  }

  to {
    opacity: 1;

    transform: translateY(0) scale(1);
  }
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 768px) {
  .funnel-form-modal {
    padding: 28px 18px;
  }

  .funnel-form-box {
    max-width: 580px;

    padding: 40px 30px 34px;

    border-radius: 24px;
  }

  .funnel-form-box h2 {
    font-size: clamp(2rem, 7vw, 2.7rem);
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 650px) {
  .funnel-form-modal {
    align-items: flex-start;

    padding: 20px 14px 28px;

    overflow-x: hidden;
    overflow-y: auto;
  }

  .funnel-form-box {
    max-width: 100%;

    margin: 0 auto;

    padding: 52px 20px 24px;

    border-radius: 22px;
  }

  .funnel-form-close {
    top: 12px;
    right: 12px;

    width: 38px;
    height: 38px;

    font-size: 1.8rem;
  }

  .funnel-form-box h2 {
    padding: 0 28px;

    font-size: clamp(1.9rem, 9vw, 2.5rem);
  }

  .funnel-form-box p {
    margin-bottom: 24px;

    font-size: 0.96rem;

    line-height: 1.6;
  }

  .funnel-form-row {
    grid-template-columns: 1fr;

    gap: 14px;
  }

  .funnel-form {
    gap: 14px;
  }

  .funnel-form input {
    padding: 16px;

    font-size: 16px;
  }

  .funnel-form-submit {
    padding: 17px 22px;

    font-size: 1.05rem;
  }

  /* =====================================================
     CENTER OPEN BUTTON ON MOBILE
  ====================================================== */

  .funnel-form-button {
    width: fit-content;
    max-width: 100%;

    margin: 25px auto 20px;

    padding: 17px 30px;

    font-size: 1.08rem;
  }
}

/* =========================================================
   VERY SMALL PHONES
========================================================= */

@media (max-width: 400px) {
  .funnel-form-modal {
    padding: 14px 10px 22px;
  }

  .funnel-form-box {
    padding: 50px 16px 20px;

    border-radius: 19px;
  }

  .funnel-form-box h2 {
    font-size: 1.9rem;
  }

  .funnel-form-button {
    padding: 16px 26px;
  }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .funnel-form-box {
    animation: none;
  }

  .funnel-form-button,
  .funnel-form-button::after,
  .funnel-form-submit,
  .funnel-form-close,
  .funnel-form input {
    transition: none;
  }
}

/* =========================================================
   FUNNEL FORM HONEYPOT
========================================================= */

.twm-honeypot,
.twm-honeypot input,
.twm-honeypot label {
  display: none !important;
}

/* =========================================================
   FUNNEL FORM MESSAGES
========================================================= */

.funnel-form-message {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
}

.funnel-form-success {
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.4);
}

.funnel-form-error {
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.4);
}

/* =========================================================
   THANK YOU BUTTONS
========================================================= */

.twm-thank-you-buttons {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 42px;
}

.twm-button {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-height: 72px;
  padding: 20px 32px;

  border-radius: 18px;

  background: linear-gradient(135deg, #4db8ff, #0077ff);

  color: #ffffff;
  text-decoration: none;
  text-align: center;

  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;

  box-shadow: 0 10px 30px rgba(0, 119, 255, 0.28);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.twm-button:hover {
  transform: translateY(-3px);

  box-shadow: 0 16px 38px rgba(0, 119, 255, 0.38);

  background: linear-gradient(135deg, #66c5ff, #0b6cff);
}

.twm-button-secondary {
  background: rgba(255, 255, 255, 0.06);

  border: 2px solid rgba(77, 184, 255, 0.45);

  color: #ffffff;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.twm-button-secondary:hover {
  background: rgba(77, 184, 255, 0.12);

  border-color: #4db8ff;

  box-shadow: 0 14px 34px rgba(77, 184, 255, 0.25);
}

@media (max-width: 768px) {
  .twm-button {
    min-height: 64px;

    font-size: 1.05rem;

    padding: 18px 24px;
  }
}
