/* UPWEGO — Widget Formulario WhatsApp / Messenger */

.uwg-form-wrap {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 32px rgba(0,0,0,.08);
  font-family: inherit;
  max-width: 560px;
  width: 100%;
  box-sizing: border-box;
}

/* Títulos */
.uwg-form-title {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
}
.uwg-form-subtitle {
  margin: 0 0 24px;
  font-size: .95rem;
  color: #666;
  line-height: 1.5;
}

/* Campos */
.uwg-field-wrap {
  margin-bottom: 18px;
}
.uwg-field-wrap label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}
.uwg-required {
  color: #e53e3e;
  margin-left: 3px;
}
.uwg-field-wrap input:not([type=radio]):not([type=checkbox]),
.uwg-field-wrap textarea,
.uwg-field-wrap select {
  width: 100%;
  padding: 11px 14px;
  font-size: .95rem;
  border: 1.5px solid #dde1e7;
  border-radius: 8px;
  background: #fafafa;
  color: #1a1a1a;
  transition: border-color 200ms, box-shadow 200ms, background 200ms;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

/* Radio y checkbox — mantener apariencia nativa y corregir tamaño */
.uwg-field-wrap input[type=radio],
.uwg-field-wrap input[type=checkbox] {
  width: 17px;
  height: 17px;
  min-width: 17px;
  margin: 0;
  cursor: pointer;
  accent-color: #25D366;
  flex-shrink: 0;
}
.uwg-field-wrap select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.uwg-field-wrap textarea { resize: vertical; min-height: 90px; }

.uwg-field-wrap input:not([type=radio]):not([type=checkbox]):focus,
.uwg-field-wrap textarea:focus,
.uwg-field-wrap select:focus {
  border-color: #25D366;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,211,102,.12);
}
.uwg-field-wrap input:not([type=radio]):not([type=checkbox]).uwg-invalid,
.uwg-field-wrap textarea.uwg-invalid,
.uwg-field-wrap select.uwg-invalid {
  border-color: #e53e3e;
  box-shadow: 0 0 0 3px rgba(229,62,62,.1);
}

/* Mensaje de error */
.uwg-error-msg {
  display: none;
  font-size: .78rem;
  color: #e53e3e;
  margin-top: 4px;
}
.uwg-error-msg.is-visible { display: block; }

/* Botones */
.uwg-btn-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.uwg-btn {
  flex: 1;
  min-width: 160px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  font-size: .95rem;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 180ms, box-shadow 180ms, filter 180ms;
  font-family: inherit;
  letter-spacing: .01em;
  -webkit-tap-highlight-color: transparent;
}
.uwg-btn:hover  { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.uwg-btn:active { transform: scale(.97); }
.uwg-btn:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

.uwg-btn-wa { background: #25D366; box-shadow: 0 4px 14px rgba(37,211,102,.3); }
.uwg-btn-ms { background: #0084FF; box-shadow: 0 4px 14px rgba(0,132,255,.3); }

/* Loading state */
.uwg-btn.is-loading {
  pointer-events: none;
  opacity: .75;
}
.uwg-btn.is-loading svg { animation: uwg-spin .7s linear infinite; }
@keyframes uwg-spin { to { transform: rotate(360deg); } }

/* Toast */
.uwg-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a1a;
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 500;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: transform 300ms cubic-bezier(.4,0,.2,1), opacity 300ms;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,.3);
}
.uwg-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.uwg-toast.uwg-toast--success { background: #1a1a1a; border-left: 4px solid #25D366; }
.uwg-toast.uwg-toast--info    { background: #1a1a1a; border-left: 4px solid #0084FF; }
.uwg-toast.uwg-toast--error   { background: #1a1a1a; border-left: 4px solid #e53e3e; }

/* Responsive */
@media (max-width: 480px) {
  .uwg-form-wrap  { padding: 22px 18px; }
  .uwg-btn-group  { flex-direction: column; }
  .uwg-btn        { min-width: 0; }
}
