/* === FORMULARIO PRINCIPAL === */
.formulario {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  column-gap: 1rem;
  row-gap: 1rem;
  width: 100%;
  font-family: "Helvetica", Sans-serif;

  .form-group {
    width: 100%;
    
    label {
      width: 100%;
    }

    .title {
      color: #203C87;
    }
  }
  
  &.mdw_eventos {
    display: flex;
    flex-wrap: wrap;
    
    .form-group {
      @media only screen and (min-width: 1340px) {
        width: calc(50% - 0.5rem);

        .form-label {
          &.custom-checkbox {
            color: black;
          }
        }
      }
      
      label {
        width: 100%;
      }

      .title {
        color: black;
      }
    }
  }

  /* Form group más grande */
  .form-group.bigger {
    width: 100%;

    label {
      width: 100%;
    }
  }
}

@media only screen and (min-width: 1340px) {
  .formulario {
    grid-template-columns: repeat(3, minmax(0, 1fr));

  }
}

/* Form group más grande */
.form-group.bigger {
  width: 100%;

  label {
    width: 100%;
  }
}

@media only screen and (min-width: 1340px) {
  .form-group.bigger {
    grid-column: span 2;
  }

  .form-group.bigger.form-validation {
    grid-column: span 3;
  }

  .form-group.bigger.form-validation.aceptance-checkbox {
    grid-row-start: 5;
  }

  .form-group.bigger.form-validation.more18-checkbox {
    grid-row-start: 3;
  }

  .form-group.bigger.form-validation.more18-instructions {
    grid-row-start: 4;
  }

  .form-group.bigger.form-validation.more18-parent-title {
    grid-row-start: 7;
  }
}

/* === CAMPOS DE FORMULARIO === */
.form-label {
  font-size: 14px;
  line-height: 16px;
  letter-spacing: 0.27px;
}

.form-label.flex {
  gap: 0.5rem;
  display: flex;
  align-items: center;
}

/* === CHECKBOX PERSONALIZADO === */
.form-label.custom-checkbox {
  position: relative;
  display: inline-block;
  cursor: pointer;
  font-size: 9px;
  user-select: none;
  padding-left: 28px;
  color: #203C87;
}

.form-label.custom-checkbox.error .checkmark {
  border: 2px solid #e63344;
}

.form-label.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.form-label.custom-checkbox .checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: transparent;
  border: 1px solid #203C87;
}

.form-label.custom-checkbox .checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 2px;
  top: 2px;
  width: 15px;
  height: 15px;
  background-image: url("./../../assets/img/icon-check.svg");
  background-size: cover;
}

.form-label.custom-checkbox input:checked ~ .checkmark:after {
  display: block;
}

.formulario {
  &.boletin {
    display: flex;
    flex-direction: column;

    .form-group {
      .bigger {
        display: flex;
        width: 100%;
        max-width: 620px;
  
        .button {
          border: none;
          border-bottom: solid 1px black;
        }
  
        .form-control {
          font-size: 18px;
          padding: 21px 28px;
        }
      }
    }
  }
    /* === CAMPOS DE TEXTO === */
  .form-control {
    outline: 0;
    width: 100%;
    height: 100%;
    padding: 10px;
    color: #203C87;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid #203C87;
    transition: border-color 0.3s ease;
    border-radius: 0;
    font-size: 12px;
  }

  .form-control::placeholder {
    color: rgba(32, 60, 135, 0.6);
  }

  .form-control:hover,
  .form-control:focus {
    border-bottom: 1px solid #203C87;
  }

  .form-control.error {
    border-bottom: 1px solid #e63344;
  }

  .dr-error-msg {
    font-size: 7px;
    color: #e63344;
    margin-top: 0.25rem;
  }

  &.mdw_eventos {
    .form-control {
      color: #000000;
      border-bottom: 1px solid #000000;

      &::placeholder {
        color: rgba(0, 0, 0, 0.6);
      }
    }

    .form-validation .form-instructions {
      color: black;
    }
  }
}

  #dr-form-msg, #dr-form-msg-boletin {
    font-family: "Helvetica", Sans-serif;
    font-size: 12px;
  }

/* === INSTRUCCIONES MENORES DE EDAD === */
.form-validation .form-instructions {
  font-size: 9px;
  line-height: 10px;
  color: #203C87;
  margin: 0;
  list-style: none;
  padding-left: 1rem;
  
  li {
    margin-bottom: 0.5rem;
  }
}

/* === CAMPOS PARENT (SOLO SI MENOR DE EDAD) === */
.form-validation.more18-field {
  grid-row-start: 7;
}

@media screen and (min-width: 1340px) {
  .form-validation.more18-aceptance-checkbox {
    grid-row-start: 10;
  }

  .form-validation.more18-aceptance-checkbox span:not(.checkmark) {
    font-size: 9px;
  }
}

/* === BOTÓN === */
.formulario {
  .button {
    padding: 7px 18px;
    align-items: center;
    text-align: center;
    font-size: 10px;
    background-color: transparent;
    color: #203C87;
    border: solid 1px #203C87;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease-in;
  }
  
  .button:hover {
    background-color: #8AC7A6;
    color: #203C87;
  }
  
  &.mdw_eventos {
    .button {
      padding: 14px;
      width: 326px;
      font-size: 14px;
      background-color: #2E151D;
      color: #203C87;
      border: solid 1px #2E151D;
      border-radius: 30px;
      cursor: pointer;
      transition: all 0.2s ease-in;
    }
    
    .button:hover {
      background-color: transparent;
      color: #2E151D;
    }
  }
}

@media screen and (min-width: 1340px) {
  .formulario .button {
    grid-row: 2;
    grid-column: 3 / span 1;
  }
}

/* === RESPONSIVE GENERAL === */
@media only screen and (max-width: 1340px) {
  .form-group {
    margin-bottom: 1rem;
  }
}


/* =========================================
   FORMULARIO TRABAJA CON NOSOTROS
   ========================================= */

/* --- VERSIÓN DESKTOP (Min-width: 768px) --- */
@media only screen and (min-width: 768px) {
  
  /* 1. Definición de la cuadrícula (2 columnas) */
  .formulario.mdw_work {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2rem;
    row-gap: 1.5rem;
  }

  /* 2. Elementos que deben ocupar todo el ancho (2 columnas) */
  .formulario.mdw_work .form-group.bigger,
  .formulario.mdw_work .form-validation {
    grid-column: 1 / -1; /* Ocupa desde la línea 1 hasta el final */
  }

  /* 3. CORRECCIÓN DEL BOTÓN (Lo más importante) */
  .formulario.mdw_work button[type="submit"],
  .formulario.mdw_work .button {
    grid-column: 1 / -1;       /* Ocupa todo el ancho */
    grid-row: auto !important; /* <--- ESTO SOLUCIONA QUE SE VAYA ARRIBA */
    
    justify-self: center;      /* Centrado horizontalmente */
    margin-top: 2rem;          /* Separación del contenido superior */
    width: auto;
    min-width: 280px;
    padding: 14px 40px;
    
    /* Estilos visuales del botón (Outline Azul) */
    background-color: transparent;
    color: #203C87;
    border: 1px solid #203C87;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 1px;
    border-radius: 0;
  }

  .formulario.mdw_work button[type="submit"]:hover,
  .formulario.mdw_work .button:hover {
    background-color: #203C87;
    color: #ffffff;
  }
  
  /* 4. Ajuste para que el texto "* Campos obligatorios" se alinee a la derecha */
  .formulario.mdw_work .form-group.bigger:last-of-type {
    text-align: right;
  }
}

/* --- ESTILOS GENERALES (Móvil y Desktop) --- */
.formulario.mdw_work .file-upload-wrapper {
  display: block;
  border-bottom: 1px solid #203C87;
  padding: 5px 0;
  width: 100%;
}

.formulario.mdw_work input[type="file"] {
  width: 100%;
  border: none;
  font-size: 12px;
  color: #203C87;
  background: transparent;
}