/* Wizard general */
#wizard {
  width: 100%;
  margin: 2.5rem auto;
  font-family: Arial, sans-serif;
  max-width: 100%;
  overflow-x: hidden;
}

/* Pasos */
.wizard-step {
  opacity: 0;
  display: none;
  transform: translateY(1.25rem);
  transition: opacity 0.4s ease, transform 0.4s ease;
  width: 100%;
}
.wizard-step.active {
  opacity: 1;
  display: block;
  transform: translateY(0);
}

/* Contenedor de pasos */
#wizard #step1,
#wizard #step2,
#wizard #step3,
#wizard #step5 {
  width: 60%;
  margin: 0 auto 2.5rem auto;
  padding: 2rem 2rem 6rem 2rem;
  background-color: #fff;
  border-radius: 0.625rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.1);
}
#wizard #step4 {
  width: 100%;
  margin: 0 auto 2.5rem auto;
  padding: 2rem 2rem 6rem 2rem;
  background-color: #fff;
  border-radius: 0.625rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.1);
}

/* Inputs, selects, textareas */
#wizard input,
#wizard select,
#wizard textarea {
  width: 100%;
  padding: 1.125rem 0.875rem;
  margin: 1rem 0;
  border: 0.125rem solid #0490B8;
  border-radius: 0.375rem;
  font-size: 1.125rem;
  background: transparent;
  color: #0490B8;
  transition: border-color 0.3s ease, color 0.3s ease;
}
#wizard textarea { resize: none; }
#wizard input:focus,
#wizard select:focus,
#wizard textarea:focus {
  outline: none;
  border-color: #027097;
  color: #027097;
}
#wizard input:read-only,
#wizard textarea:read-only {
  background-color: #f5f5f5;
  color: #777;
  cursor: not-allowed;
}

/* Labels flotantes */
.form-group {
  position: relative;
  margin: 1.5rem 0;
}
.form-group label {
  position: absolute;
  left: 0.75rem;
  top: 2.125rem;
  font-size: 1.125rem;
  color: #aaa;
  pointer-events: none;
  transition: all 0.3s ease;
  background-color: transparent;
  z-index: 2;
}
.form-group input:focus ~ label,
.form-group input.filled ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group select:focus ~ label,
.form-group select.filled ~ label,
.form-group select:required:valid ~ label,
.form-group textarea:focus ~ label,
.form-group textarea.filled ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
  top: 0.4rem;
  font-size: 0.875rem;
  color: #0490B8;
  background: #fff;
  padding: 0 0.25rem;
}
/* Campo Fecha */
.form-group .calendar-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 1.25rem;
}

#datepicker {
  display: none;
  position: absolute;
  background: #fff;
  border: 1px solid #ccc;
  margin-top: 0.5rem;
  z-index: 10;
}
.form-group input::placeholder {
  opacity: 1; /* visible */
}
.form-group.date-field {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  margin: 1.5rem 0 0 0;
}
.form-group.date-field input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none; /* Safari */
  -moz-appearance: none;
  appearance: none;
}
.form-group.date-field input:placeholder-shown ~ label {
  top: 0.4rem;
  font-size: 0.875rem;
  color: #0490B8;
  background: #fff;
  padding: 0 0.25rem;
}
.fecha-error {
  color: red;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  padding-right: 36px; /* espacio para el icono */
  box-sizing: border-box;
}

.calendar-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-icon svg {
  width: 20px;
  height: 20px;
  fill: #0490B8 !important;
}


/*.calendar-icon {
  position: absolute;
  right: 10px;
  cursor: pointer;
  color: #0490B8; /* se aplica al SVG gracias a fill="currentColor" 
}*/

/* Checkbox especiales */
.form-group label:has(input[type="checkbox"]) {
  position: static;
  transform: none;
  font-size: 1rem;
  color: #0490B8;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
#step4 .form-group {
  text-align: center;
  margin-top: 1.25rem;
}
#step4 input[type="checkbox"] {
  width: auto;
  height: 1.25rem;
  cursor: pointer;
}
/* Selects */
.form-group select {
  appearance: none;
  position: relative;
  z-index: 1;
}
.form-group select::-ms-expand {
  display: none;
}

/* Placeholder flotante */
#wizard input::placeholder,
#wizard textarea::placeholder {
  color: #aaa;
  transition: 0.3s ease;
}
#wizard input:focus::placeholder,
#wizard input:not(:placeholder-shown)::placeholder,
#wizard textarea:focus::placeholder,
#wizard textarea:not(:placeholder-shown)::placeholder {
  transform: translateY(-1.25rem) scale(0.8);
  color: #0490B8;
}

/* Botones */
#wizard button {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  border: none;
  border-radius: 0.375rem;
  background-color: #0490B8;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
#wizard button:hover {
  background-color: #5dc2e0;
}
.wizard-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.9375rem;
  margin-top: 1.25rem;
}
.wizard-buttons button {
  flex: 0 0 auto;
}

/* Títulos */
#wizard h3 {
  text-align: center;
  color: #0490B8;
  margin-bottom: 1.25rem;
}

/* Consentimiento */
#wizard .consentimiento-wrap {
  color: #333;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  text-align: justify;
}
#wizard .consentimiento-wrap h2,
#wizard .consentimiento-wrap h3 {
  color: #0490B8;
  margin-top: 0.625rem;
}
#wizard .consentimiento-wrap ul,
#wizard .consentimiento-wrap ol {
  margin-left: 1.25rem;
}

/* Barra de progreso */
.progress-bar {
  width: 100%;
  height: 0.75rem;
  background-color: #e0f4f9;
  border-radius: 0.375rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background-color: #0490B8;
  width: 0;
  border-radius: 0.375rem;
  transition: width 0.4s ease;
}

/* Errores */
.input-invalid {
  border: 0.125rem solid red !important;
  background-color: #ffe6e6;
}
.label-invalid {
  color: red !important;
}
.fecha-error,
.input-error {
  color: red;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}
.input-error {
  color: red;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Animaciones */
.wizard-step.fade-in {
  animation: fadeIn 0.4s ease forwards;
}
.wizard-step.fade-out {
  animation: fadeOut 0.4s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(1.25rem); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(1.25rem); }
}

/* Responsivo móvil */
@media (max-width: 768px) {
  #wizard {
    width: 100%;
    margin: 0 auto;
    box-shadow: none;
    border-radius: 0;
  }

  #wizard #step1,
  #wizard #step2,
  #wizard #step3,
  #wizard #step4,
  #wizard #step5 {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 1.25rem auto;
    padding: 1rem;
    box-shadow: none;
    border-radius: 0;
  }

  #wizard input,
  #wizard select,
  #wizard textarea {
    font-size: 1rem;
    padding: 0.75rem 0.625rem;
  }

  .form-group label {
    top: 1.75rem;
    font-size: 1rem;
  }

  .form-group input:focus ~ label,
  .form-group input.filled ~ label,
  .form-group input:not(:placeholder-shown) ~ label,
  .form-group select:focus ~ label,
  .form-group select.filled ~ label,
  .form-group select:required:valid ~ label,
  .form-group textarea:focus ~ label,
  .form-group textarea.filled ~ label,
  .form-group textarea:not(:placeholder-shown) ~ label {
    top: 0.46rem;
    font-size: 0.75rem;
  }

  .wizard-buttons {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .wizard-buttons button {
    width: 100%;
    margin-top: 0.625rem;
  }
}
