/* ===== ESTILOS PERSONALIZADOS PARA FORMULARIO TRUSTARC - ESCUDO REC ===== */

html {
  scroll-behavior: smooth !important;
}

#trustarchform,
#trusarchform {
  border: none !important;
  background: transparent !important;
}

#trustarchform *,
#trusarchform * {
  border-color: rgba(255, 255, 255, 0.5) !important;
  color: #FFFFFF !important;
}

#trustarchform .ta-upm-label,
#trusarchform .ta-upm-label {
  color: #FFFFFF !important;
}

#trustarchform .ta-upm-input,
#trusarchform .ta-upm-input {
  background: transparent !important;
  color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
}

/* Contenedor principal del formulario */
.ta-upm-modal-content {
  background: transparent !important;
  border-radius: 25px !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.ta-upm-modal-header {
  background: transparent !important;
  padding: 20px !important;
  text-align: center !important;
  border-bottom: none !important;
}

.ta-upm-form {
  background: transparent !important;
}

/* Grupos de formulario */
.ta-upm-form-group {
  margin-bottom: 25px !important;
  background: transparent !important;
  border-radius: 15px !important;
  padding: 20px !important;
  border: none !important;
  transition: all 0.3s ease !important;
  position: relative !important;
  z-index: 1 !important;
  overflow: visible !important;
}

.ta-upm-form-group:hover {
  border-color: transparent !important;
  box-shadow: none !important;
}

.ta-upm-form-group:has(.ta-upm-select__control--menu-is-open) {
  z-index: 100 !important;
  overflow: visible !important;
}

/* Labels */
.ta-upm-label {
  color: #FFFFFF !important;
  font-family: "Montserrat", sans-serif !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  margin-bottom: 8px !important;
  display: block !important;
}

/* Campos de texto */
.ta-upm-input {
  width: 100% !important;
  padding: 15px !important;
  border: 2px solid rgba(255, 255, 255, 0.5) !important;
  border-radius: 10px !important;
  font-family: "Montserrat", sans-serif !important;
  font-size: 16px !important;
  color: #FFFFFF !important;
  background: transparent !important;
  transition: all 0.3s ease !important;
}

.ta-upm-input:focus {
  outline: none !important;
  border-color: #E31C23 !important;
  box-shadow: 0 0 0 3px rgba(227, 28, 35, 0.3) !important;
}

.ta-upm-input::placeholder {
  color: rgba(255, 255, 255, 0.6) !important;
}

/* Select personalizado */
.ta-upm-select__control {
  border: 2px solid rgba(255, 255, 255, 0.5) !important;
  border-radius: 10px !important;
  background: transparent !important;
  min-height: 50px !important;
  box-shadow: none !important;
}

.ta-upm-select__control:hover {
  border-color: rgba(255, 255, 255, 0.8) !important;
}

.ta-upm-select__control--is-focused {
  border-color: #E31C23 !important;
  box-shadow: 0 0 0 3px rgba(227, 28, 35, 0.3) !important;
}

.ta-upm-select__value-container {
  padding: 0 15px !important;
  color: #FFFFFF !important;
  font-family: "Montserrat", sans-serif !important;
}

.ta-upm-select__placeholder {
  color: rgba(255, 255, 255, 0.6) !important;
  font-family: "Montserrat", sans-serif !important;
}

.ta-upm-select__single-value {
  color: #FFFFFF !important;
  font-family: "Montserrat", sans-serif !important;
  font-weight: 600 !important;
}

.ta-upm-select__indicator-separator {
  background-color: rgba(255, 255, 255, 0.3) !important;
}

.ta-upm-select__dropdown-indicator {
  color: #FFFFFF !important;
}

/* Menu desplegable de los selects */
.ta-upm-select__menu {
  z-index: 9999 !important;
  background: rgba(0, 0, 0, 0.95) !important;
  border: 2px solid #E31C23 !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
  margin-top: 5px !important;
}

.ta-upm-select__menu-list {
  padding: 5px !important;
  max-height: 300px !important;
  overflow-y: auto !important;
}

.ta-upm-select__option {
  padding: 12px 15px !important;
  color: #FFFFFF !important;
  font-family: "Montserrat", sans-serif !important;
  font-weight: 500 !important;
  border-radius: 5px !important;
  margin: 2px 0 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.ta-upm-select__option:hover {
  background: rgba(227, 28, 35, 0.3) !important;
}

.ta-upm-select__option--is-focused {
  background: rgba(227, 28, 35, 0.2) !important;
}

.ta-upm-select__option--is-selected {
  background: rgba(227, 28, 35, 0.5) !important;
  color: #FFFFFF !important;
}

.ta-upm-select__menu-portal {
  z-index: 9999 !important;
}

/* Checkbox personalizado */
.ta-upm-checkbox {
  width: 22px !important;
  height: 22px !important;
  border: 2px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 5px !important;
  background: transparent !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
}

.ta-upm-checkbox:hover {
  background: rgba(227, 28, 35, 0.2) !important;
}

.ta-upm-checkbox[aria-checked="true"] {
  background: #E31C23 !important;
  border-color: #E31C23 !important;
}

.ta-upm-checkbox[aria-checked="true"] svg {
  fill: #FFFFFF !important;
}

.ta-upm-checkbox-container {
  display: flex !important;
  align-items: flex-start !important;
  gap: 15px !important;
  cursor: pointer !important;
}

.ta-upm-static-text-details {
  color: #FFFFFF !important;
  font-family: "Montserrat", sans-serif !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  margin-top: 2px !important;
}

.ta-upm-static-text-details a {
  color: #E31C23 !important;
  text-decoration: underline !important;
  font-weight: 600 !important;
}

.ta-upm-static-text-details a:hover {
  color: #FF4444 !important;
}

/* Footer del modal */
.ta-upm-modal-footer {
  background: transparent !important;
  padding: 25px 30px !important;
  border-top: none !important;
  text-align: center !important;
}

/* Botones */
.ta-upm-button {
  padding: 15px 30px !important;
  border-radius: 25px !important;
  font-family: "Montserrat", sans-serif !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  transition: all 0.3s ease !important;
  border: none !important;
  cursor: pointer !important;
  min-width: 140px !important;
}

/* Boton primario (Enviar) - Rojo Escudo */
.ta-upm-button__primary {
  background: linear-gradient(135deg, #E31C23 0%, #B71C1C 100%) !important;
  color: #FFF !important;
  box-shadow: 0 5px 15px rgba(227, 28, 35, 0.4) !important;
}

.ta-upm-button__primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(227, 28, 35, 0.5) !important;
}

/* Boton secundario (Borrar) */
.ta-upm-button__secondary {
  background: transparent !important;
  color: #FFFFFF !important;
  border: 2px solid #FFFFFF !important;
}

.ta-upm-button__secondary:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #FFFFFF !important;
  transform: translateY(-2px) !important;
}

/* Indicador de campo requerido */
.ta-upm-required {
  color: #E31C23 !important;
  font-weight: 700 !important;
  margin-left: 5px !important;
}

/* Campo de telefono */
.ta-phone-country-select {
  display: flex !important;
  gap: 10px !important;
  align-items: center !important;
}

.ta-phone-country-select .ta-upm-select {
  flex: 0 0 auto !important;
  width: 120px !important;
}

.ta-phone-country-select .ta-upm-input {
  flex: 1 !important;
}

/* Campo de fecha */
.ta-upm-date-picker-input-container {
  width: 100% !important;
  padding: 15px !important;
  border: 2px solid rgba(255, 255, 255, 0.5) !important;
  border-radius: 10px !important;
  font-family: "Montserrat", sans-serif !important;
  font-size: 16px !important;
  color: #FFFFFF !important;
  background: transparent !important;
}

/* Calendario desplegable */
.react-datepicker-popper {
  z-index: 9999 !important;
}

.react-datepicker {
  font-family: "Montserrat", sans-serif !important;
  border: 2px solid #E31C23 !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
  background-color: rgba(0, 0, 0, 0.95) !important;
}

.react-datepicker__header {
  background-color: rgba(227, 28, 35, 0.3) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.react-datepicker__current-month,
.react-datepicker__day-name {
  color: #FFFFFF !important;
  font-weight: 600 !important;
}

/* Selectores de mes y año */
.react-datepicker__month-select,
.react-datepicker__year-select,
select.react-datepicker__month-select,
select.react-datepicker__year-select {
  background-color: #1a1a1a !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  border-radius: 5px !important;
  padding: 5px 10px !important;
  font-family: "Montserrat", sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  margin: 0 5px !important;
}

.react-datepicker__month-select:focus,
.react-datepicker__year-select:focus {
  outline: none !important;
  border-color: #E31C23 !important;
}

.react-datepicker__month-select option,
.react-datepicker__year-select option {
  background-color: #1a1a1a !important;
  color: #FFFFFF !important;
}

.react-datepicker__header__dropdown {
  margin: 10px 0 !important;
}

.react-datepicker__day {
  color: #FFFFFF !important;
  font-weight: 500 !important;
}

.react-datepicker__day:hover {
  background-color: rgba(227, 28, 35, 0.3) !important;
  color: #FFFFFF !important;
}

.react-datepicker__day--selected {
  background-color: #E31C23 !important;
  color: #FFFFFF !important;
}

.react-datepicker__day--disabled {
  color: rgba(255, 255, 255, 0.3) !important;
}

.react-datepicker__month {
  background-color: rgba(0, 0, 0, 0.95) !important;
}

.react-datepicker__navigation-icon::before {
  border-color: #FFFFFF !important;
}

/* Botones de navegación Previous/Next Month */
.react-datepicker__navigation {
  top: 12px !important;
  width: 32px !important;
  height: 32px !important;
  background: rgba(227, 28, 35, 0.8) !important;
  border-radius: 50% !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.react-datepicker__navigation:hover {
  background: #E31C23 !important;
  transform: scale(1.1) !important;
}

.react-datepicker__navigation--previous {
  left: 10px !important;
}

.react-datepicker__navigation--next {
  right: 10px !important;
}

.react-datepicker__navigation-icon {
  font-size: 0 !important;
}

.react-datepicker__navigation-icon::before {
  border-width: 2px 2px 0 0 !important;
  width: 8px !important;
  height: 8px !important;
  top: 50% !important;
  left: 50% !important;
}

.react-datepicker__navigation-icon--previous::before {
  transform: translate(-25%, -50%) rotate(-135deg) !important;
}

.react-datepicker__navigation-icon--next::before {
  transform: translate(-75%, -50%) rotate(45deg) !important;
}

/* Fix general para desplegables */
.ta-upm-form-group-container {
  position: relative !important;
  z-index: inherit !important;
}

.ta-upm-form-group:focus-within {
  z-index: 50 !important;
  overflow: visible !important;
}

.ta-upm-modal-body {
  overflow: visible !important;
}

.ta-upm-form {
  overflow: visible !important;
}

/* Responsive */
@media (max-width: 768px) {
  .ta-upm-modal-content {
    margin: 20px !important;
    border-radius: 20px !important;
  }

  .ta-upm-modal-body {
    padding: 0px !important;
  }

  .ta-upm-form-group {
    padding: 15px !important;
    margin-bottom: 20px !important;
  }

  .ta-upm-button {
    padding: 12px 25px !important;
    font-size: 14px !important;
    min-width: 120px !important;
  }

  .ta-upm-modal-footer {
    padding: 20px !important;
  }

  .ta-phone-country-select {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .ta-phone-country-select .ta-upm-select {
    width: 100% !important;
  }
}

/* Animaciones */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ta-upm-form-group {
  animation: fadeInUp 0.5s ease forwards !important;
}

.ta-upm-form-group:nth-child(1) { animation-delay: 0.1s !important; }
.ta-upm-form-group:nth-child(2) { animation-delay: 0.2s !important; }
.ta-upm-form-group:nth-child(3) { animation-delay: 0.3s !important; }
.ta-upm-form-group:nth-child(4) { animation-delay: 0.4s !important; }
.ta-upm-form-group:nth-child(5) { animation-delay: 0.5s !important; }
.ta-upm-form-group:nth-child(6) { animation-delay: 0.6s !important; }
.ta-upm-form-group:nth-child(7) { animation-delay: 0.7s !important; }
.ta-upm-form-group:nth-child(8) { animation-delay: 0.8s !important; }

/* Estados de error */
.ta-upm-input[aria-invalid="true"] {
  border-color: #FF6B6B !important;
  background: rgba(255, 107, 107, 0.1) !important;
}

/* Estados de deshabilitado */
.ta-upm-input:disabled,
.ta-upm-button:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

/* ===== ANIMACIONES DE EXITO Y CELEBRACION ===== */

.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.success-overlay.show {
  opacity: 1;
}

.success-content {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border-radius: 30px;
  padding: 50px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(227, 28, 35, 0.4);
  position: relative;
  animation: scaleIn 0.5s ease forwards;
  max-width: 500px;
  border: 3px solid #E31C23;
}

@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.success-icon {
  margin-bottom: 30px;
}

.circle-animation {
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  animation: drawCircle 0.8s ease forwards;
}

.checkmark-animation {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawCheckmark 0.5s ease forwards 0.8s;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes drawCircle {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes drawCheckmark {
  to {
    stroke-dashoffset: 0;
  }
}

.success-title {
  color: #E31C23;
  font-family: "Montserrat", sans-serif;
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 15px;
  animation: fadeInUp 0.6s ease forwards 0.3s;
  opacity: 0;
}

.success-message {
  color: #FFFFFF;
  font-family: "Montserrat", sans-serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  animation: fadeInUp 0.6s ease forwards 0.5s;
  opacity: 0;
}

.success-submessage {
  color: #999;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 400;
  animation: fadeInUp 0.6s ease forwards 0.7s;
  opacity: 0;
}

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 100000;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall linear forwards;
  transform-origin: center;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

.ta-upm-button.loading {
  position: relative;
  color: rgba(255, 255, 255, 0.7) !important;
  pointer-events: none;
}

.button-loading {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.ta-upm-button__primary:active {
  transform: scale(0.98);
}

@media (max-width: 768px) {
  .success-content {
    padding: 30px;
    margin: 20px;
  }

  .success-title {
    font-size: 24px;
  }

  .success-message {
    font-size: 16px;
  }

  .success-submessage {
    font-size: 12px;
  }

  .success-icon svg {
    width: 80px;
    height: 80px;
  }
}

/* ===== FIX PARA INPUT DE FECHA CON VALOR ===== */
.react-datepicker__input-container input,
.react-datepicker__input-container input[value],
.react-datepicker__input-container .ta-upm-date-picker-input-container,
input.ta-upm-date-picker-input-container,
.ta-upm-date-picker-input-container[value] {
  background: transparent !important;
  background-color: transparent !important;
  color: #FFFFFF !important;
  border: 2px solid rgba(255, 255, 255, 0.5) !important;
  border-radius: 10px !important;
}

/* Asegurar que el texto sea visible con cualquier valor */
.react-datepicker__input-container input:not(:placeholder-shown),
input.ta-upm-date-picker-input-container:not(:placeholder-shown) {
  background: transparent !important;
  color: #FFFFFF !important;
}

/* Override para estados filled/valid */
.react-datepicker-wrapper,
.react-datepicker__input-container {
  width: 100% !important;
}

.react-datepicker__input-container input:valid,
.react-datepicker__input-container input:focus,
.react-datepicker__input-container input[aria-invalid=false] {
  background: transparent !important;
  background-color: transparent !important;
  color: #FFFFFF !important;
}

/* ===== FIX AGRESIVO PARA INPUT DE FECHA ===== */
input[class*="date-picker"],
input[id*="date-picker"],
.react-datepicker__input-container > input,
.react-datepicker-wrapper input,
div[class*="react-datepicker"] input,
input.w-100.ta-upm-date-picker-input-container {
  background: transparent !important;
  background-color: transparent !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
}

/* Override inline styles */
[style*="background"].ta-upm-date-picker-input-container,
[style*="background-color"].ta-upm-date-picker-input-container {
  background: transparent !important;
  background-color: transparent !important;
  color: #FFFFFF !important;
}

/* ===== FIX DEFINITIVO - CONTENEDOR DEL DATEPICKER ===== */
.react-datepicker__input-container {
  background: transparent !important;
  background-color: transparent !important;
}

.react-datepicker-wrapper {
  background: transparent !important;
  width: 100% !important;
}

.ta-upm-date-field-container,
.ta-single-date-picker,
.ta-upm-date-picker-container {
  background: transparent !important;
}

/* ===== FIX FINAL DATEPICKER - Alta especificidad ===== */
div.react-datepicker__input-container,
.react-datepicker__input-container,
[class*='react-datepicker__input-container'] {
  background: transparent !important;
  background-color: transparent !important;
}

div.ta-upm-date-picker-input-container,
.ta-upm-date-picker-input-container,
[class*='ta-upm-date-picker-input-container'],
[class*='date-picker-input'] {
  background: transparent !important;
  background-color: transparent !important;
  color: #FFFFFF !important;
}

/* Selector de atributo para styled-components */
div[class^='sc-'][class*='Input'],
input[class^='sc-'] {
  background: transparent !important;
  background-color: transparent !important;
  color: #FFFFFF !important;
}
