/* =========================================================
   CF7 Email OTP Verification — Frontend Styles
   ========================================================= */

/* --- Email field wrapper --------------------------------- */
.cf7-otp-email-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cf7-otp-email-wrapper input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
}

/* --- Verify button --------------------------------------- */
.cf7-otp-verify-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid #2ECC71;
  border-radius: 5px;
  background: transparent;
  color: #2ECC71;
  transition: background 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
  flex-shrink: 0;
}

.cf7-otp-verify-btn:hover:not(:disabled) {
  background: rgba(46, 204, 113, 0.08);
  border-color: #27ae60;
  color: #27ae60;
}

.cf7-otp-verify-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.cf7-otp-verify-btn.verified {
  background: #2ECC71;
  border-color: #2ECC71;
  color: #fff;
  cursor: default;
}

/* --- Inline status message ------------------------------- */
.cf7-otp-status {
  width: 100%;
  font-size: 13px;
  margin-top: 5px;
  min-height: 18px;
}

.cf7-otp-status.success { color: #2ECC71; }
.cf7-otp-status.error   { color: #e74c3c; }

/* =========================================================
   Modal overlay
   ========================================================= */
.cf7-otp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 999990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.cf7-otp-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* --- Modal box ------------------------------------------- */
.cf7-otp-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 400px;
  position: relative;
  transform: translateY(12px);
  transition: transform 0.22s ease;
  font-family: inherit;
}

.cf7-otp-overlay.open .cf7-otp-modal {
  transform: translateY(0);
}

/* close button */
.cf7-otp-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #888;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.cf7-otp-modal-close:hover {
  background: #f1f1f1;
  color: #333;
}

/* heading */
.cf7-otp-modal h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

.cf7-otp-modal .cf7-otp-modal-sub {
  font-size: 14px;
  color: #666;
  margin: 0 0 24px;
  line-height: 1.5;
}

/* OTP digit inputs */
.cf7-otp-digits {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.cf7-otp-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid #d0d0d0;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: #1a1a1a;
  caret-color: transparent;
}

.cf7-otp-digit:focus {
  border-color: #2ECC71;
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.18);
}

.cf7-otp-digit.filled {
  border-color: #2ECC71;
  background: #f0fdf4;
}

/* modal status */
.cf7-otp-modal-status {
  font-size: 13px;
  text-align: center;
  min-height: 18px;
  margin-bottom: 16px;
}

.cf7-otp-modal-status.success { color: #2ECC71; }
.cf7-otp-modal-status.error   { color: #e74c3c; }

/* submit button */
.cf7-otp-modal-submit {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 7px;
  background: #2ECC71;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 14px;
}

.cf7-otp-modal-submit:hover:not(:disabled) {
  background: #27ae60;
}

.cf7-otp-modal-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* resend row */
.cf7-otp-resend-row {
  text-align: center;
  font-size: 13px;
  color: #666;
}

.cf7-otp-resend-btn {
  background: none;
  border: none;
  color: #2ECC71;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  text-decoration: underline;
  transition: color 0.15s;
}

.cf7-otp-resend-btn:hover:not(:disabled) {
  color: #27ae60;
}

.cf7-otp-resend-btn:disabled {
  color: #aaa;
  cursor: not-allowed;
  text-decoration: none;
}

/* countdown badge */
.cf7-otp-countdown {
  display: inline-block;
  font-weight: 600;
  color: #555;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 480px) {
  .cf7-otp-digit {
    width: 40px;
    height: 48px;
    font-size: 20px;
  }

  .cf7-otp-digits {
    gap: 7px;
  }

  .cf7-otp-email-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }

  .cf7-otp-email-wrapper input[type="email"] {
    width: 100%;
  }

  .cf7-otp-verify-btn {
    width: 100%;
    justify-content: center;
  }
}

/* =========================================================
   CF7 Submit button — locked state (before OTP verified)
   ========================================================= */
.cf7-otp-submit-locked,
.cf7-otp-submit-locked:hover,
.cf7-otp-submit-locked:focus,
.cf7-otp-submit-locked:active {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: grayscale(30%) !important;
}
