/* ======================================================================
 *  Salesforce Web-to-Lead Form – Validation & Popup Styles
 *  Scoped to .w2l-gs-form so it won't bleed into other elements.
 * ====================================================================== */

/* ===== FIELD-LEVEL VALIDATION ===== */
.w2l-gs-form .w2l-invalid {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.18) !important;
}

.w2l-gs-form .w2l-error-msg {
  display: block;
  color: #c0392b;
  font-family: 'TerminaTest-Medium', sans-serif;
  font-size: 12px;
  line-height: 18px;
  margin-top: 4px;
  margin-bottom: 0;
  padding: 0;
}

/* ===== SUBMIT BUTTON – Submitting state ===== */
.w2l-gs-form input[type="submit"].w2l-submitting,
.w2l-gs-form button[type="submit"].w2l-submitting {
  opacity: 0.65 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  background-image: none !important;
  position: relative;
}

.w2l-gs-form input[type="submit"].w2l-submitting::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 10px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: middle;
  animation: w2l-spin 0.7s linear infinite;
}

@keyframes w2l-spin {
  to { transform: rotate(360deg); }
}

/* ===== THANK-YOU POPUP OVERLAY ===== */
.w2l-thankyou-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
  padding: 20px;
}

.w2l-thankyou-overlay.w2l-thankyou-visible {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

/* ===== POPUP BOX ===== */
.w2l-thankyou-box {
  background: #FAF9EC;
  border-radius: 6px;
  padding: 50px 40px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.w2l-thankyou-visible .w2l-thankyou-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Close button */
.w2l-thankyou-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #53150D;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}

.w2l-thankyou-close:hover {
  color: #b05526;
}

/* Icon */
.w2l-thankyou-icon {
  margin-bottom: 18px;
}

.w2l-thankyou-icon svg {
  display: inline-block;
}

/* Title */
.w2l-thankyou-title {
  font-family: 'TerminaTest-Bold', sans-serif;
  font-size: 28px;
  color: #53150D;
  margin: 0 0 12px;
  text-transform: uppercase;
}

/* Body text */
.w2l-thankyou-text {
  font-family: 'TerminaTest-Medium', sans-serif;
  font-size: 15px;
  line-height: 24px;
  color: #53150D;
  margin: 0 0 28px;
}

/* OK button – matches site brand */
.w2l-thankyou-btn {
  font-family: 'TerminaTest-Medium', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background-color: #b05526;
  color: #fff;
  border: none;
  padding: 12px 50px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.w2l-thankyou-btn:hover {
  background-color: #53150D;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 520px) {
  .w2l-thankyou-box {
    padding: 40px 24px 30px;
  }

  .w2l-thankyou-title {
    font-size: 22px;
  }

  .w2l-thankyou-text {
    font-size: 14px;
    line-height: 22px;
  }
}

/* ===== ERROR / WARNING TOAST ===== */
.w2l-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000000;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 440px;
  width: calc(100% - 48px);
  padding: 16px 18px;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  font-family: 'TerminaTest-Medium', sans-serif;
  font-size: 14px;
  line-height: 20px;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.w2l-toast--visible {
  transform: translateX(0);
  opacity: 1;
}

.w2l-toast--error {
  background: #fdf2f2;
  border: 1px solid #c0392b;
  color: #7a1a1a;
}

.w2l-toast--warning {
  background: #fefce8;
  border: 1px solid #d4a017;
  color: #7a5d00;
}

.w2l-toast-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.w2l-toast--error .w2l-toast-icon {
  color: #c0392b;
}

.w2l-toast--warning .w2l-toast-icon {
  color: #d4a017;
}

.w2l-toast-msg {
  flex: 1;
}

.w2l-toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 0 2px;
  transition: opacity 0.2s;
}

.w2l-toast-close:hover {
  opacity: 1;
}

@media (max-width: 520px) {
  .w2l-toast {
    top: 12px;
    right: 12px;
    max-width: none;
    width: calc(100% - 24px);
    font-size: 13px;
  }
}
