/* ── Botón flotante ─────────────────────────────────────────────────────── */
.cpfwa-floating-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
}

.cpfwa-button {
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35);
  transition: all 0.3s ease;
}

.cpfwa-button:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(37, 211, 102, 0.45);
}

@keyframes cpfwa-breathing {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.cpfwa-breath {
  animation: cpfwa-breathing 3s infinite ease-in-out;
  will-change: transform;
}

/* ── Overlay ────────────────────────────────────────────────────────────── */
.cpfwa-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 16px;
  box-sizing: border-box;
}

.cpfwa-modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ── Modal ──────────────────────────────────────────────────────────────── */
.cpfwa-modal {
  background: #ffffff;
  width: 100%;
  max-width: 420px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  transform: translateY(32px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cpfwa-modal-overlay.active .cpfwa-modal {
  transform: translateY(0) scale(1);
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.cpfwa-modal-header {
  background: #0f6e56;
  padding: 22px 24px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.cpfwa-modal-header-text {
  flex: 1;
}

.cpfwa-modal-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.cpfwa-modal-header h3 {
  margin: 0 0 5px;
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
}

.cpfwa-modal-subtitle {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.4;
}

.cpfwa-close {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.75);
  font-size: 18px;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease;
  line-height: 1;
}

.cpfwa-close:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* ── Cuerpo ─────────────────────────────────────────────────────────────── */
.cpfwa-modal-body {
  padding: 24px 24px 28px;
}

/* ── Campos ─────────────────────────────────────────────────────────────── */
.cpfwa-field {
  margin-bottom: 16px;
}

.cpfwa-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.cpfwa-field label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.cpfwa-field label i {
  font-size: 13px;
  color: #9ca3af;
}

.cpfwa-field input,
.cpfwa-field select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid #e5e7eb;
  font-size: 14px;
  font-family: inherit;
  background: #f9fafb;
  color: #111827;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}

.cpfwa-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.cpfwa-field input:focus,
.cpfwa-field select:focus {
  border-color: #25D366;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12);
}

.cpfwa-field input::placeholder {
  color: #9ca3af;
}

/* ── Estados de validación ──────────────────────────────────────────────── */
.cpfwa-field input.cpfwa-invalid,
.cpfwa-field input.cpfwa-invalid:focus {
  border-color: #ef4444;
  background: #fff5f5;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.cpfwa-field input.cpfwa-valid,
.cpfwa-field input.cpfwa-valid:focus {
  border-color: #25D366;
  background: #f0fff6;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.cpfwa-field-hint {
  display: none;
  font-size: 12px;
  margin-top: 5px;
  padding-left: 2px;
  line-height: 1.4;
}

.cpfwa-field-hint.cpfwa-hint-error {
  color: #ef4444;
}

.cpfwa-field-hint.cpfwa-hint-ok {
  color: #16a34a;
}

/* ── Bloque de privacidad ───────────────────────────────────────────────── */
.cpfwa-privacy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f3faf6;
  border: 1px solid #d1fae5;
  margin-bottom: 18px;
}

.cpfwa-privacy i {
  font-size: 17px;
  color: #0f6e56;
  flex-shrink: 0;
  margin-top: 1px;
}

.cpfwa-privacy p {
  margin: 0;
  font-size: 12px;
  color: #374151;
  line-height: 1.5;
}

/* ── Botón enviar ───────────────────────────────────────────────────────── */
.cpfwa-submit {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 50px;
  background: #25D366;
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
}

.cpfwa-submit i {
  font-size: 20px;
}

.cpfwa-submit:hover {
  background: #1db954;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
}

.cpfwa-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .cpfwa-modal {
    border-radius: 16px;
  }

  .cpfwa-modal-header {
    padding: 18px 20px 16px;
  }

  .cpfwa-modal-body {
    padding: 20px 20px 24px;
  }

  .cpfwa-field-row {
    grid-template-columns: 1fr;
  }
}
